Request Headers
Supports:
application/json
Bearer authentication format, for example: Bearer {{API Key}}.
Request Body
The prompt for image generation.The recommended length is no more than 600 English words. If the prompt is too long, the information may become scattered. The model might ignore details and only concentrate on the main points, resulting in a image with missing elements.
Enter the Base64 encoding or an accessible URL of the image to edit. Supports inputting a single image or multiple images.
- Image URL: Make sure that the image URL is accessible.
-
Base64 encoding: The format must be
data:image/<image format>;base64,<Base64 encoding>
.
An input image must meet the following requirements:- Image format: jpeg, png
- Aspect ratio (width/height): In the range [1/3, 3]
- Width and height (px): > 14
- Size: No more than 10 MB
- The value of total pixels: No more than 6000×6000
- supports uploading a maximum of 10 reference images.
Set the specification for the generated image. Two methods are available but cannot be used together.
- Method 1, specify the resolution.
- Optional values:
1K
,2K
,4K
- Optional values:
- Method 2, specify the width and height of the generated image in pixels.
- Default:
2048x2048
- The value range of total pixels:
[1024x1024, 4096x4096]
- The aspect ratio value range:
[1/16, 16]
- Default:
Aspect ratio | Width and Height Pixel Values |
---|---|
1:1 | 2048x2048 |
4:3 | 2304x1728 |
3:4 | 1728x2304 |
16:9 | 2560x1440 |
9:16 | 1440x2560 |
3:2 | 2496x1664 |
2:3 | 1664x2496 |
21:9 | 3024x1296 |
Controls whether to disable the batch generation feature.
auto
: In automatic mode, the model automatically determines whether to return multiple images and how many images it will contain based on the user’s prompt.disabled
: Disables batch generation feature. The model will only generate one image.
Specifies the maximum number of images to generate in this request. This parameter is only effective when
sequential_image_generation
is set to auto
.Value range: [1, 15]
DescriptionThe actual number of generated images is affected by
max_images
and the number of input reference images. Number of input reference images + Number of generated images ≤ 15.Adds a watermark to the generated image.
false
: Does not add a watermark.true
: Adds a watermark with the text “AI generated” in the bottom-right corner of the image.
Response
An array containing links to download the generated images.