Class ImageEditParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class ImageEditParams implements Params
Creates an edited or extended image given an original image and a prompt.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classImageEditParams.BuilderA builder for ImageEditParams.
public final classImageEditParams.Bodypublic final classImageEditParams.ResponseFormatThe format in which the generated images are returned. Must be one of
urlorb64_json. URLs are only valid for 60 minutes after the image has been generated.public final classImageEditParams.SizeThe size of the generated images. Must be one of
256x256,512x512, or1024x1024.
-
Method Summary
Modifier and Type Method Description final InputStreamimage()The image to edit. final Stringprompt()A text description of the desired 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.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<InputStream>_image()Returns the raw multipart value of image. final MultipartField<String>_prompt()Returns the raw multipart value of prompt. 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.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 Headers_additionalHeaders()final QueryParams_additionalQueryParams()final ImageEditParams.BuildertoBuilder()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. Booleanequals(Object other)IntegerhashCode()StringtoString()final static ImageEditParams.Builderbuilder()Returns a mutable builder for constructing an instance of ImageEditParams. -
-
Method Detail
-
image
final InputStream image()
The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.
-
prompt
final String prompt()
A text description of the desired image(s). The maximum length is 1000 characters.
-
mask
final Optional<InputStream> mask()
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
imageshould be edited. 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-2is supported at this time.
-
responseFormat
final Optional<ImageEditParams.ResponseFormat> responseFormat()
The format in which the generated images are returned. Must be one of
urlorb64_json. URLs are only valid for 60 minutes after the image has been generated.
-
size
final Optional<ImageEditParams.Size> size()
The size of the generated images. Must be one of
256x256,512x512, or1024x1024.
-
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<InputStream> _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.
-
_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.
-
_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.
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
toBuilder
final ImageEditParams.Builder toBuilder()
-
_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.
-
builder
final static ImageEditParams.Builder builder()
Returns a mutable builder for constructing an instance of ImageEditParams.
The following fields are required:
.image() .prompt()
-
-
-
-