Class ImageEditParams.Builder
-
- All Implemented Interfaces:
public final class ImageEditParams.Builder
A builder for ImageEditParams.
-
-
Method Summary
-
-
Method Detail
-
body
final ImageEditParams.Builder body(ImageEditParams.Body body)
Sets the entire request body.
This is generally only useful if you are already constructing the body separately. Otherwise, it's more convenient to use the top-level setters instead:
-
image
final ImageEditParams.Builder image(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.
-
image
final ImageEditParams.Builder image(MultipartField<InputStream> image)
Sets Builder.image to an arbitrary multipart value.
You should usually call Builder.image with a well-typed InputStream value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
image
final ImageEditParams.Builder image(ByteArray 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.
-
image
final ImageEditParams.Builder image(Path 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 ImageEditParams.Builder prompt(String prompt)
A text description of the desired image(s). The maximum length is 1000 characters.
-
prompt
final ImageEditParams.Builder prompt(MultipartField<String> prompt)
Sets Builder.prompt to an arbitrary multipart value.
You should usually call Builder.prompt with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
mask
final ImageEditParams.Builder mask(InputStream mask)
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
mask
final ImageEditParams.Builder mask(MultipartField<InputStream> mask)
Sets Builder.mask to an arbitrary multipart value.
You should usually call Builder.mask with a well-typed InputStream value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
mask
final ImageEditParams.Builder mask(ByteArray mask)
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
mask
final ImageEditParams.Builder mask(Path mask)
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where
image
should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions asimage
.
-
model
final ImageEditParams.Builder model(ImageModel model)
The model to use for image generation. Only
dall-e-2
is supported at this time.
-
model
final ImageEditParams.Builder model(Optional<ImageModel> model)
Alias for calling Builder.model with
model.orElse(null)
.
-
model
final ImageEditParams.Builder model(MultipartField<ImageModel> model)
Sets Builder.model to an arbitrary multipart value.
You should usually call Builder.model with a well-typed ImageModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final ImageEditParams.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed ImageModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
n
final ImageEditParams.Builder n(Long n)
The number of images to generate. Must be between 1 and 10.
-
n
final ImageEditParams.Builder n(Long n)
Alias for Builder.n.
This unboxed primitive overload exists for backwards compatibility.
-
n
final ImageEditParams.Builder n(Optional<Long> n)
Alias for calling Builder.n with
n.orElse(null)
.
-
n
final ImageEditParams.Builder n(MultipartField<Long> n)
Sets Builder.n to an arbitrary multipart value.
You should usually call Builder.n with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final ImageEditParams.Builder responseFormat(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.
-
responseFormat
final ImageEditParams.Builder responseFormat(Optional<ImageEditParams.ResponseFormat> responseFormat)
Alias for calling Builder.responseFormat with
responseFormat.orElse(null)
.
-
responseFormat
final ImageEditParams.Builder responseFormat(MultipartField<ImageEditParams.ResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary multipart value.
You should usually call Builder.responseFormat with a well-typed ResponseFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
size
final ImageEditParams.Builder size(ImageEditParams.Size size)
The size of the generated images. Must be one of
256x256
,512x512
, or1024x1024
.
-
size
final ImageEditParams.Builder size(Optional<ImageEditParams.Size> size)
Alias for calling Builder.size with
size.orElse(null)
.
-
size
final ImageEditParams.Builder size(MultipartField<ImageEditParams.Size> size)
Sets Builder.size to an arbitrary multipart value.
You should usually call Builder.size with a well-typed Size value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
user
final ImageEditParams.Builder user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
user
final ImageEditParams.Builder user(MultipartField<String> user)
Sets Builder.user to an arbitrary multipart value.
You should usually call Builder.user with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalHeaders
final ImageEditParams.Builder additionalHeaders(Headers additionalHeaders)
-
additionalHeaders
final ImageEditParams.Builder additionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
putAdditionalHeader
final ImageEditParams.Builder putAdditionalHeader(String name, String value)
-
putAdditionalHeaders
final ImageEditParams.Builder putAdditionalHeaders(String name, Iterable<String> values)
-
putAllAdditionalHeaders
final ImageEditParams.Builder putAllAdditionalHeaders(Headers additionalHeaders)
-
putAllAdditionalHeaders
final ImageEditParams.Builder putAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
replaceAdditionalHeaders
final ImageEditParams.Builder replaceAdditionalHeaders(String name, String value)
-
replaceAdditionalHeaders
final ImageEditParams.Builder replaceAdditionalHeaders(String name, Iterable<String> values)
-
replaceAllAdditionalHeaders
final ImageEditParams.Builder replaceAllAdditionalHeaders(Headers additionalHeaders)
-
replaceAllAdditionalHeaders
final ImageEditParams.Builder replaceAllAdditionalHeaders(Map<String, Iterable<String>> additionalHeaders)
-
removeAdditionalHeaders
final ImageEditParams.Builder removeAdditionalHeaders(String name)
-
removeAllAdditionalHeaders
final ImageEditParams.Builder removeAllAdditionalHeaders(Set<String> names)
-
additionalQueryParams
final ImageEditParams.Builder additionalQueryParams(QueryParams additionalQueryParams)
-
additionalQueryParams
final ImageEditParams.Builder additionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
putAdditionalQueryParam
final ImageEditParams.Builder putAdditionalQueryParam(String key, String value)
-
putAdditionalQueryParams
final ImageEditParams.Builder putAdditionalQueryParams(String key, Iterable<String> values)
-
putAllAdditionalQueryParams
final ImageEditParams.Builder putAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
putAllAdditionalQueryParams
final ImageEditParams.Builder putAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
replaceAdditionalQueryParams
final ImageEditParams.Builder replaceAdditionalQueryParams(String key, String value)
-
replaceAdditionalQueryParams
final ImageEditParams.Builder replaceAdditionalQueryParams(String key, Iterable<String> values)
-
replaceAllAdditionalQueryParams
final ImageEditParams.Builder replaceAllAdditionalQueryParams(QueryParams additionalQueryParams)
-
replaceAllAdditionalQueryParams
final ImageEditParams.Builder replaceAllAdditionalQueryParams(Map<String, Iterable<String>> additionalQueryParams)
-
removeAdditionalQueryParams
final ImageEditParams.Builder removeAdditionalQueryParams(String key)
-
removeAllAdditionalQueryParams
final ImageEditParams.Builder removeAllAdditionalQueryParams(Set<String> keys)
-
build
final ImageEditParams build()
Returns an immutable instance of ImageEditParams.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.image() .prompt()
-
-
-
-