Class ImageGenerateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class ImageGenerateParams implements Params
Creates an image given a prompt.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ImageGenerateParams.Body
public final class
ImageGenerateParams.Builder
A builder for ImageGenerateParams.
public final class
ImageGenerateParams.Quality
The quality of the image that will be generated.
hd
creates images with finer details and greater consistency across the image. This param is only supported fordall-e-3
.public final class
ImageGenerateParams.ResponseFormat
The format in which the generated images are returned. Must be one of
url
orb64_json
. URLs are only valid for 60 minutes after the image has been generated.public final class
ImageGenerateParams.Size
The size of the generated images. Must be one of
256x256
,512x512
, or1024x1024
fordall-e-2
. Must be one of1024x1024
,1792x1024
, or1024x1792
fordall-e-3
models.public final class
ImageGenerateParams.Style
The style of the generated images. Must be one of
vivid
ornatural
. 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. This param is only supported fordall-e-3
.
-
Method Summary
Modifier and Type Method Description final String
prompt()
A text description of the desired image(s). final Optional<ImageModel>
model()
The model to use for image generation. final Optional<Long>
n()
The number of images to generate. final Optional<ImageGenerateParams.Quality>
quality()
The quality of the image that will be generated. final Optional<ImageGenerateParams.ResponseFormat>
responseFormat()
The format in which the generated images are returned. final Optional<ImageGenerateParams.Size>
size()
The size of the generated images. final Optional<ImageGenerateParams.Style>
style()
The style of the generated images. final Optional<String>
user()
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final JsonField<String>
_prompt()
Returns the raw JSON value of prompt. final JsonField<ImageModel>
_model()
Returns the raw JSON value of model. final JsonField<Long>
_n()
Returns the raw JSON value of n. final JsonField<ImageGenerateParams.Quality>
_quality()
Returns the raw JSON value of quality. final JsonField<ImageGenerateParams.ResponseFormat>
_responseFormat()
Returns the raw JSON value of responseFormat. final JsonField<ImageGenerateParams.Size>
_size()
Returns the raw JSON value of size. final JsonField<ImageGenerateParams.Style>
_style()
Returns the raw JSON value of style. final JsonField<String>
_user()
Returns the raw JSON value of user. final Map<String, JsonValue>
_additionalBodyProperties()
final Headers
_additionalHeaders()
final QueryParams
_additionalQueryParams()
Headers
_headers()
The full set of headers in the parameters, including both fixed and additional headers. QueryParams
_queryParams()
The full set of query params in the parameters, including both fixed and additional query params. final ImageGenerateParams.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ImageGenerateParams.Builder
builder()
Returns a mutable builder for constructing an instance of ImageGenerateParams. -
-
Method Detail
-
prompt
final String prompt()
A text description of the desired image(s). The maximum length is 1000 characters for
dall-e-2
and 4000 characters fordall-e-3
.
-
model
final Optional<ImageModel> model()
The model to use for image generation.
-
n
final Optional<Long> n()
The number of images to generate. Must be between 1 and 10. For
dall-e-3
, onlyn=1
is supported.
-
quality
final Optional<ImageGenerateParams.Quality> quality()
The quality of the image that will be generated.
hd
creates images with finer details and greater consistency across the image. This param is only supported fordall-e-3
.
-
responseFormat
final Optional<ImageGenerateParams.ResponseFormat> responseFormat()
The format in which the generated images are returned. Must be one of
url
orb64_json
. URLs are only valid for 60 minutes after the image has been generated.
-
size
final Optional<ImageGenerateParams.Size> size()
The size of the generated images. Must be one of
256x256
,512x512
, or1024x1024
fordall-e-2
. Must be one of1024x1024
,1792x1024
, or1024x1792
fordall-e-3
models.
-
style
final Optional<ImageGenerateParams.Style> style()
The style of the generated images. Must be one of
vivid
ornatural
. 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. This param is only supported fordall-e-3
.
-
user
final Optional<String> user()
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
_prompt
final JsonField<String> _prompt()
Returns the raw JSON value of prompt.
Unlike prompt, this method doesn't throw if the JSON field has an unexpected type.
-
_model
final JsonField<ImageModel> _model()
Returns the raw JSON value of model.
Unlike model, this method doesn't throw if the JSON field has an unexpected type.
-
_n
final JsonField<Long> _n()
Returns the raw JSON value of n.
Unlike n, this method doesn't throw if the JSON field has an unexpected type.
-
_quality
final JsonField<ImageGenerateParams.Quality> _quality()
Returns the raw JSON value of quality.
Unlike quality, this method doesn't throw if the JSON field has an unexpected type.
-
_responseFormat
final JsonField<ImageGenerateParams.ResponseFormat> _responseFormat()
Returns the raw JSON value of responseFormat.
Unlike responseFormat, this method doesn't throw if the JSON field has an unexpected type.
-
_size
final JsonField<ImageGenerateParams.Size> _size()
Returns the raw JSON value of size.
Unlike size, this method doesn't throw if the JSON field has an unexpected type.
-
_style
final JsonField<ImageGenerateParams.Style> _style()
Returns the raw JSON value of style.
Unlike style, this method doesn't throw if the JSON field has an unexpected type.
-
_user
final JsonField<String> _user()
Returns the raw JSON value of user.
Unlike user, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
toBuilder
final ImageGenerateParams.Builder toBuilder()
-
builder
final static ImageGenerateParams.Builder builder()
Returns a mutable builder for constructing an instance of ImageGenerateParams.
The following fields are required:
.prompt()
-
-
-
-