View Source ExOpenAI.Components.CreateImageRequest (ex_openai.ex v2.0.0-beta2)
Module for representing the OpenAI schema CreateImageRequest.
Fields
:background- optional -:transparent | :opaque | :auto | nil
Allows to set transparency for the background of the generated image(s). This parameter is only supported for the GPT image models. Must be one oftransparent,opaqueorauto(default value). Whenautois used, the model will automatically determine the best background for the image.
If transparent, the output format needs to support transparency, so it
should be set to either png (default value) or webp.
Allowed values: "transparent", "opaque", "auto"
Default: "auto"
:model- optional -String.t() | :"gpt-image-1.5" | :"dall-e-2" | :"dall-e-3" | :"gpt-image-1" | :"gpt-image-1-mini" | nil
The model to use for image generation. One ofdall-e-2,dall-e-3, or a GPT image model (gpt-image-1,gpt-image-1-mini,gpt-image-1.5). Defaults todall-e-2unless a parameter specific to the GPT image models is used.
Default:"dall-e-2":moderation- optional -:low | :auto | nil
Control the content-moderation level for images generated by the GPT image models. Must be eitherlowfor less restrictive filtering orauto(default value).
Allowed values:"low","auto"
Default:"auto":n- optional -integer() | nil
The number of images to generate. Must be between 1 and 10. Fordall-e-3, onlyn=1is supported.
Default:1
Constraints: minimum: 1, maximum: 10:output_compression- optional -integer() | nil
The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with thewebporjpegoutput formats, and defaults to 100.
Default:100:output_format- optional -:png | :jpeg | :webp | nil
The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one ofpng,jpeg, orwebp.
Allowed values:"png","jpeg","webp"
Default:"png":partial_images- optional -ExOpenAI.Components.PartialImages.t():prompt- required -String.t()
A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters fordall-e-2and 4000 characters fordall-e-3.:quality- optional -:standard | :hd | :low | :medium | :high | :auto | nil
The quality of the image that will be generated.
auto(default value) will automatically select the best quality for the given model.high,mediumandloware supported for the GPT image models.hdandstandardare supported fordall-e-3.standardis the only option fordall-e-2.
Allowed values:"standard","hd","low","medium","high","auto"
Default:"auto"
:response_format- optional -:url | :b64_json | nil
The format in which generated images withdall-e-2anddall-e-3are returned. Must be one ofurlorb64_json. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.
Allowed values:"url","b64_json"
Default:"url":size- optional -:auto | :"1024x1024" | :"1536x1024" | :"1024x1536" | :"256x256" | :"512x512" | :"1792x1024" | :"1024x1792" | nil
The size of the generated images. Must be one of1024x1024,1536x1024(landscape),1024x1536(portrait), orauto(default value) for the GPT image models, one of256x256,512x512, or1024x1024fordall-e-2, and one of1024x1024,1792x1024, or1024x1792fordall-e-3.
Allowed values:"auto","1024x1024","1536x1024","1024x1536","256x256","512x512","1792x1024","1024x1792"
Default:"auto":stream- optional -boolean() | nil
Generate the image in streaming mode. Defaults tofalse. See the Image generation guide for more information. This parameter is only supported for the GPT image models.
Default:false:style- optional -:vivid | :natural | nil
The style of the generated images. This parameter is only supported fordall-e-3. Must be one ofvividornatural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.
Allowed values:"vivid","natural"
Default:"vivid":user- optional -String.t()
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
Summary
Types
@type t() :: %ExOpenAI.Components.CreateImageRequest{ background: ((:transparent | :opaque) | :auto) | nil, model: (String.t() | (((:"gpt-image-1.5" | :"dall-e-2") | :"dall-e-3") | :"gpt-image-1") | :"gpt-image-1-mini") | nil, moderation: (:low | :auto) | nil, n: integer() | nil, output_compression: integer() | nil, output_format: ((:png | :jpeg) | :webp) | nil, partial_images: ExOpenAI.Components.PartialImages.t() | nil, prompt: String.t(), quality: (((((:standard | :hd) | :low) | :medium) | :high) | :auto) | nil, response_format: (:url | :b64_json) | nil, size: (((((((:auto | :"1024x1024") | :"1536x1024") | :"1024x1536") | :"256x256") | :"512x512") | :"1792x1024") | :"1024x1792") | nil, stream: boolean() | nil, style: (:vivid | :natural) | nil, user: String.t() | nil }