Image Expansion
Create Task
Expand the image in any direction based on the original image.
Request Header
Data Exchange Format
Authentication information, refer to API authentication
Request Body
Reference Image
- Supports image input as either Base64-encoded string or URL (ensure accessibility)
- Important: When using Base64, do NOT add any prefix like
data:image/png;base64,. Submit only the raw Base64 string.
- Correct Base64 format:
- Incorrect Base64 format (with data: prefix):
- Supported image formats: .jpg / .jpeg / .png
- Image file size must not exceed 10MB. Image dimensions must be at least 300px in width and height, aspect ratio: 1:2.5 ~ 2.5:1
Expand upwards range; calculated based on multiples of the original image height
- Value range: [0, 2]. The total area of the new image must not exceed 3 times that of the original image
- Example: If original height is 20 and value is 0.1, then:
- The distance from the top edge of the original image to the top edge of the new image is 20 × 0.1 = 2, and the area within is the expansion range
Expand downwards range; calculated based on multiples of the original image height
- Value range: [0, 2]. The total area of the new image must not exceed 3 times that of the original image
- Example: If original height is 20 and value is 0.2, then:
- The distance from the bottom edge of the original image to the bottom edge of the new image is 20 × 0.2 = 4, and the area within is the expansion range
Expand leftwards range; calculated based on multiples of the original image width
- Value range: [0, 2]. The total area of the new image must not exceed 3 times that of the original image
- Example: If original width is 30 and value is 0.3, then:
- The distance from the left edge of the original image to the left edge of the new image is 30 × 0.3 = 9, and the area within is the expansion range
Expand rightwards range; calculated based on multiples of the original image width
- Value range: [0, 2]. The total area of the new image must not exceed 3 times that of the original image
- Example: If original width is 30 and value is 0.4, then:
- The distance from the right edge of the original image to the right edge of the new image is 30 × 0.4 = 12, and the area within is the expansion range
Positive text prompt
- Cannot exceed 2500 characters
Number of generated images
- Value range: [1, 9]
Whether to generate watermarked results simultaneously
- Defined by the enabled parameter, format:
- true: generate watermarked result, false: do not generate
- Custom watermarks are not currently supported
The callback notification address for the result of this task. If configured, the server will actively notify when the task status changes.
- For specific message schema, see Callback Protocol
Customized Task ID
- Will not overwrite system-generated task ID, but supports querying task by this ID
- Must be unique within a single user account
Example code
Query Task (Single)
Request Header
Data Exchange Format
Authentication information, refer to API authentication
Path Parameters
The task ID generated by images. Request path parameter, directly fill the value in the request path.
Customized Task ID for audio generation
- The external_task_id filled in when creating the task. You can choose to query by external_task_id or task_id
- When creating a task, you can choose to query by external_task_id or task_id.
Query Task (List)
Request Header
Data Exchange Format
Authentication information, refer to API authentication
Query Parameters
Page number
- Value range: [1, 1000]
Data volume per page
- Value range: [1, 500]