Class ImageEditParams.Body
-
- All Implemented Interfaces:
public final class ImageEditParams.Body
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
ImageEditParams.Body.Builder
A builder for Body.
-
Method Summary
Modifier and Type Method Description final ImageEditParams.Image
image()
The image(s) to edit. final String
prompt()
A text description of the desired image(s). final Optional<ImageEditParams.Background>
background()
Allows to set transparency for the background of the generated image(s). final Optional<InputStream>
mask()
An additional image whose fully transparent areas (e.g. final Optional<ImageModel>
model()
The model to use for image generation. final Optional<Long>
n()
The number of images to generate. final Optional<ImageEditParams.Quality>
quality()
The quality of the image that will be generated. final Optional<ImageEditParams.ResponseFormat>
responseFormat()
The format in which the generated images are returned. final Optional<ImageEditParams.Size>
size()
The size 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 MultipartField<ImageEditParams.Image>
_image()
Returns the raw multipart value of image. final MultipartField<String>
_prompt()
Returns the raw multipart value of prompt. final MultipartField<ImageEditParams.Background>
_background()
Returns the raw multipart value of background. final MultipartField<InputStream>
_mask()
Returns the raw multipart value of mask. final MultipartField<ImageModel>
_model()
Returns the raw multipart value of model. final MultipartField<Long>
_n()
Returns the raw multipart value of n. final MultipartField<ImageEditParams.Quality>
_quality()
Returns the raw multipart value of quality. final MultipartField<ImageEditParams.ResponseFormat>
_responseFormat()
Returns the raw multipart value of responseFormat. final MultipartField<ImageEditParams.Size>
_size()
Returns the raw multipart value of size. final MultipartField<String>
_user()
Returns the raw multipart value of user. final ImageEditParams.Body.Builder
toBuilder()
final ImageEditParams.Body
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ImageEditParams.Body.Builder
builder()
Returns a mutable builder for constructing an instance of Body. -
-
Method Detail
-
image
final ImageEditParams.Image image()
The image(s) to edit. Must be a supported image file or an array of images.
For
gpt-image-1
, each image should be apng
,webp
, orjpg
file less than 25MB. You can provide up to 16 images.For
dall-e-2
, you can only provide one image, and it should be a squarepng
file less than 4MB.
-
prompt
final String prompt()
A text description of the desired image(s). The maximum length is 1000 characters for
dall-e-2
, and 32000 characters forgpt-image-1
.
-
background
final Optional<ImageEditParams.Background> background()
Allows to set transparency for the background of the generated image(s). This parameter is only supported for
gpt-image-1
. Must be one oftransparent
,opaque
orauto
(default value). Whenauto
is 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 eitherpng
(default value) orwebp
.
-
mask
final Optional<InputStream> mask()
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
model
final Optional<ImageModel> model()
The model to use for image generation. Only
dall-e-2
andgpt-image-1
are supported. Defaults todall-e-2
unless a parameter specific togpt-image-1
is used.
-
quality
final Optional<ImageEditParams.Quality> quality()
The quality of the image that will be generated.
high
,medium
andlow
are only supported forgpt-image-1
.dall-e-2
only supportsstandard
quality. Defaults toauto
.
-
responseFormat
final Optional<ImageEditParams.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. This parameter is only supported fordall-e-2
, asgpt-image-1
will always return base64-encoded images.
-
size
final Optional<ImageEditParams.Size> size()
The size of the generated images. Must be one of
1024x1024
,1536x1024
(landscape),1024x1536
(portrait), orauto
(default value) forgpt-image-1
, and one of256x256
,512x512
, or1024x1024
fordall-e-2
.
-
user
final Optional<String> user()
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
_image
final MultipartField<ImageEditParams.Image> _image()
Returns the raw multipart value of image.
Unlike image, this method doesn't throw if the multipart field has an unexpected type.
-
_prompt
final MultipartField<String> _prompt()
Returns the raw multipart value of prompt.
Unlike prompt, this method doesn't throw if the multipart field has an unexpected type.
-
_background
final MultipartField<ImageEditParams.Background> _background()
Returns the raw multipart value of background.
Unlike background, this method doesn't throw if the multipart field has an unexpected type.
-
_mask
final MultipartField<InputStream> _mask()
Returns the raw multipart value of mask.
Unlike mask, this method doesn't throw if the multipart field has an unexpected type.
-
_model
final MultipartField<ImageModel> _model()
Returns the raw multipart value of model.
Unlike model, this method doesn't throw if the multipart field has an unexpected type.
-
_n
final MultipartField<Long> _n()
Returns the raw multipart value of n.
Unlike n, this method doesn't throw if the multipart field has an unexpected type.
-
_quality
final MultipartField<ImageEditParams.Quality> _quality()
Returns the raw multipart value of quality.
Unlike quality, this method doesn't throw if the multipart field has an unexpected type.
-
_responseFormat
final MultipartField<ImageEditParams.ResponseFormat> _responseFormat()
Returns the raw multipart value of responseFormat.
Unlike responseFormat, this method doesn't throw if the multipart field has an unexpected type.
-
_size
final MultipartField<ImageEditParams.Size> _size()
Returns the raw multipart value of size.
Unlike size, this method doesn't throw if the multipart field has an unexpected type.
-
_user
final MultipartField<String> _user()
Returns the raw multipart value of user.
Unlike user, this method doesn't throw if the multipart field has an unexpected type.
-
toBuilder
final ImageEditParams.Body.Builder toBuilder()
-
validate
final ImageEditParams.Body validate()
-
builder
final static ImageEditParams.Body.Builder builder()
Returns a mutable builder for constructing an instance of Body.
The following fields are required:
.image() .prompt()
-
-
-
-