The Outpainting API extends the boundaries of an image, creating a larger canvas while ensuring a seamless transition between the original content and the newly generated areas. This feature is ideal for adjusting aspect ratios or enhancing the overall composition of an image.
taskId.Enum: application/json
Bearer authentication token. Example: Bearer {{APIKey}}.
The URL of the source image. Constraints: maximum resolution of 16 megapixels and a maximum file size of 10MB.
Specifies the number of pixels to extend in each direction. Format: { "left": integer, "right": integer, "top": integer, "bottom": integer }.
Returns 0 for success, or a specific error code.
Returns "success" or a descriptive error message.
The unique identifier for the task. Use this ID with the Polling API to retrieve the generated output.
Use the Polling API to retrieve the processing results.
Alternatively, you can enable Callback to receive task results automatically upon completion.
{
"code": 0,
"message": "success",
"data": {
"task": {
"taskId": "b08337dc08d7428daa64b3d5e61b8350",
"status": 3,
"taskType": "outpainting"
},
"images": [
{
"imageType": "png",
"imageUrl": "https://dreamface-resource-cv.oss-us-east-1.aliyuncs.com/aigc-dreamface-outpainting/2025-06-27/outpainting-result.png"
}
]
}
}curl -X POST 'https://api.newportai.com/api/async/outpainting' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
"url": "https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/INj5UrnnrKIzCR1uYBWv0.png",
"outPaintSize": {
"left": 100,
"right": 100,
"top": 100,
"bottom": 100
}
}'{
"code": 0,
"message": "success",
"data": {
"taskId": "b08337dc08d7428daa64b3d5e61b8350"
}
}