struct AI::OpenAI::Tools::ImageGeneration

Overview

Image Generation tool.

Allows generating images using a text prompt.

Defined in:

ai/openai/tool/openai_tools.cr

Constant Summary

ID = "openai.image_generation"
NAME = "image_generation"

Constructors

Instance Method Summary

Constructor Detail

def self.new(background : String | Nil = nil, input_fidelity : String | Nil = nil, input_image_mask : ImageMask | Nil = nil, model : String | Nil = nil, moderation : String | Nil = nil, output_compression : Int32 | Nil = nil, output_format : String | Nil = nil, partial_images : Int32 | Nil = nil, quality : String | Nil = nil, size : String | Nil = nil) #

[View source]

Instance Method Detail

def args : Hash(String, JSON::Any) #

[View source]
def background : String | Nil #

Background type: auto, opaque, transparent.


[View source]
def id : String #

[View source]
def input_fidelity : String | Nil #

Input fidelity: low, high.


[View source]
def input_image_mask : ImageMask | Nil #

Optional mask for inpainting.


[View source]
def model : String | Nil #

The image generation model to use.


[View source]
def moderation : String | Nil #

Moderation level: auto.


[View source]
def name : String #

[View source]
def output_compression : Int32 | Nil #

Compression level (0-100).


[View source]
def output_format : String | Nil #

Output format: png, jpeg, webp.


[View source]
def partial_images : Int32 | Nil #

Number of partial images in streaming mode (0-3).


[View source]
def quality : String | Nil #

Quality: auto, low, medium, high.


[View source]
def size : String | Nil #

Size: auto, 1024x1024, 1024x1536, 1536x1024.


[View source]
def type : String #

[View source]