Seedream5.0 Flash - Layer Decomposition
This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.
Endpoint
POST /jobs/createTask
Full URL: https://ai.modelfold.online/v1/jobs/createTask
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Layer decomposition with Seedream 5.0 Flash: split an image into a base image and separate layers.
TIP
The base image and every separated layer each count as one billed image; in auto mode the model decides the number of layers, so the cost varies per request. For current prices, see ai.modelfold.online/pricing.
Query Task Status
After submitting a task, use the unified query endpoint to check progress and retrieve results:
- Get Task Details — Learn how to query task status and retrieve generation results
TIP
For production use, we recommend using the callBackUrl parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.
Related Resources
- Market Overview — Explore all available models
- Common API — Check credits and account usage
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name used to execute the layer separation task. Required field. - Must be seedream/5-flash-layer-decomposition for this endpoint Default:"seedream/5-flash-layer-decomposition"。 Allowed values:seedream/5-flash-layer-decomposition。 示例:seedream/5-flash-layer-decomposition。 |
callBackUrl | string | No | The URL to receive task completion notifications. Optional, but recommended for production environments. - Upon task completion, the system will send a POST request to this URL - The callback content includes task status, generated result URLs, and task information - You can also actively query the task status through the get task details interface - For callback signature verification methods, please refer to the Webhook Verification Guide 示例: https://your-domain.com/api/callback。 |
input | object | Yes | Input parameters for the layer separation task |
input.prompt | string | No | Optional prompt for layer separation. - When a prompt is provided, the model separates the specified elements based on the prompt - When no prompt is provided, the model automatically identifies the main elements in the image - Supports using <bbox>x1 y1 x2 y2</bbox> to precisely specify element positions, recommending the use of normalized coordinates in the 0-1000 range- Length: 4–5000 characters 示例: Separate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers。 |
input.image_url | string | Yes | The source image URL for layer separation. - Must upload exactly 1 image - Supported formats: PNG, JPEG. - Image size must not exceed 30 MB - Total pixel range is 262,144-36,000,000 - Aspect ratio range is 1:16-16:1 示例: https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png。 |
input.size | string | No | Resolution level of the output image. The base image maintains the aspect ratio of the input image, and each separated layer maintains the aspect ratio of the corresponding element in the original image. - auto: Automatically selected based on the input image size- 1K: 1K resolution level- 1.5K: 1.5K resolution level- 2K: 2K resolution level Default:"auto"。 Allowed values:auto / 1K / 1.5K / 2K。 示例:2K。 |
input.output_format | string | No | Output format of the base image. This parameter only controls the base image format; all separated layers are fixed to output as PNG. Default:"jpeg"。 Allowed values:png / jpeg。 示例:jpeg。 |
Request Example
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream/5-flash-layer-decomposition",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Separate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers",
"image_url": "https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png",
"size": "2K",
"output_format": "jpeg"
}
}'{
"model": "seedream/5-flash-layer-decomposition",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Separate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers",
"image_url": "https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png",
"size": "2K",
"output_format": "jpeg"
}
}Response
200 — Request successful.
{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_seedream_1765172101886"
}
}500 — Server error.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | Response status code - 200: Success - Request has been processed successfully - 401: Unauthorized - Authentication credentials are missing or invalid - 402: Insufficient Credits - Account does not have enough credits to perform the operation - 404: Not Found - The requested resource or endpoint does not exist - 408: Timeout - No result has been returned for over 10 minutes. - 422: Validation Error - The request parameters failed validation checks - 429: Rate Limited - Request limit has been exceeded for this resource - 455: Service Unavailable - System is currently undergoing maintenance - 500: Server Error - An unexpected error occurred while processing the request - 501: Generation Failed - Content generation task failed - 505: Feature Disabled - The requested feature is currently disabled |
msg | string | 是 | Response message, error description when failed |
data | object | 是 | — |
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}Callback
onImageGenerated
Callback URL: {$request.body#/callBackUrl} (the callBackUrl in the request body).
Sent when the task succeeds or fails.
Callback body parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | 200: success. 501: failure; see data.failCode and data.failMsg. Allowed values:200 / 501。 示例:200。 |
msg | string | 否 | Status message 示例:Playground task completed successfully.。 |
data | object | 否 | — |
data.taskId | string | 否 | Task ID 示例:79e8e9c3012235f2277ce118f19d930a。 |
data.model | string | 否 | Model used for the image layer decomposition task 示例:seedream/5-flash-layer-decomposition。 |
data.state | string | 否 | Task status Allowed values:success / fail。 示例:success。 |
data.param | string | 否 | Parameters submitted when creating the task, in JSON string format 示例:{"input":"{\"size\":\"auto\",\"output_format\":\"png\",\"image_url\":\"https://static.aiquickdraw.com/tools/example/1790672695524_2ISGVaOd.png\",\"prompt\":\"Split the content in the image into 3 layers by combining some text elements:\\nLayer 1: Text <bbox>67 34 944 164</bbox>, <bbox>76 181 285 199</bbox>, <bbox>815 181 946 199</bbox>\\nLayer 2: 1 arctic fox <bbox>219 310 873 696</bbox>\\nLayer 3: Text <bbox>77 797 941 880</bbox>, <bbox>175 899 855 923</bbox>\",\"nsfw_checker\":true}","callBackUrl":"https://your-domain.com/api/callback","model":"seedream/5-flash-layer-decomposition"}。 |
data.resultJson | string | 否 | JSON string of the generation result. Present only when state is success. After parsing: resultUrls lists the base image first, followed by each separated layer; resultObject.layers_data describes each layer (z_index 0 is the base image and has no bounding_box/name/description). 示例:{"resultObject":{"layers_data":[{"z_index":0,"size":"1024x1536","output_format":"png","url":"https://tempfile.aiquickdraw.com/seedream5flash/1791456820549-y4diwaen2p.png"},{"z_index":1,"size":"1321x265","output_format":"png","bounding_box":{"absolute":[82,1239,944,1412],"normalized":[80,807,921,919]},"name":"Bottom caption text","description":"Extract the bottom caption text elements including 'ARCTIC QUIET' and 'BEAUTY IN THE STILLNESS', no other content included.","url":"https://tempfile.aiquickdraw.com/seedream5flash/1791456821060-yw7wmtc7saq.png"},{"z_index":2,"size":"821x720","output_format":"png","bounding_box":{"absolute":[228,482,897,1070],"normalized":[223,314,875,696]},"name":"Arctic fox","description":"Extract the full body of the standing white arctic fox, no background elements included.","url":"https://tempfile.aiquickdraw.com/seedream5flash/1791456821475-egwgijina1s.png"},{"z_index":3,"size":"1314x373","output_format":"png","bounding_box":{"absolute":[74,51,950,300],"normalized":[72,33,927,195]},"name":"Top header text","description":"Extract the top header text elements including 'ModelFold AI', 'FIELD NOTES' and 'VOL. 01', no other content included.","url":"https://tempfile.aiquickdraw.com/seedream5flash/1791456822084-cnlvwfwro2g.png"}]},"resultUrls":["https://tempfile.aiquickdraw.com/seedream5flash/1791456820549-y4diwaen2p.png","https://tempfile.aiquickdraw.com/seedream5flash/1791456821060-yw7wmtc7saq.png","https://tempfile.aiquickdraw.com/seedream5flash/1791456821475-egwgijina1s.png","https://tempfile.aiquickdraw.com/seedream5flash/1791456822084-cnlvwfwro2g.png"]}。 |
data.completeTime | integer | 否 | Task completion time, represented as a Unix timestamp in milliseconds 示例:1791456822552。 |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. 示例:34。 |
data.createTime | integer | 否 | Task creation time, represented as a Unix timestamp in milliseconds 示例:1791456787658。 |
data.creditsConsumed | number | 否 | Credits consumed by the task; 0 for failed tasks. 示例:12.96。 |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. 示例:1791456822552。 |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. 示例:500。 |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. 示例:<error detail>。 |
Success
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "79e8e9c3012235f2277ce118f19d930a",
"model": "seedream/5-flash-layer-decomposition",
"state": "success",
"param": "{\"input\":\"{\\\"size\\\":\\\"auto\\\",\\\"output_format\\\":\\\"png\\\",\\\"image_url\\\":\\\"https://static.aiquickdraw.com/tools/example/1790672695524_2ISGVaOd.png\\\",\\\"prompt\\\":\\\"Split the content in the image into 3 layers by combining some text elements:\\\\nLayer 1: Text <bbox>67 34 944 164</bbox>, <bbox>76 181 285 199</bbox>, <bbox>815 181 946 199</bbox>\\\\nLayer 2: 1 arctic fox <bbox>219 310 873 696</bbox>\\\\nLayer 3: Text <bbox>77 797 941 880</bbox>, <bbox>175 899 855 923</bbox>\\\",\\\"nsfw_checker\\\":true}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"seedream/5-flash-layer-decomposition\"}",
"resultJson": "{\"resultObject\":{\"layers_data\":[{\"z_index\":0,\"size\":\"1024x1536\",\"output_format\":\"png\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5flash/1791456820549-y4diwaen2p.png\"},{\"z_index\":1,\"size\":\"1321x265\",\"output_format\":\"png\",\"bounding_box\":{\"absolute\":[82,1239,944,1412],\"normalized\":[80,807,921,919]},\"name\":\"Bottom caption text\",\"description\":\"Extract the bottom caption text elements including 'ARCTIC QUIET' and 'BEAUTY IN THE STILLNESS', no other content included.\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5flash/1791456821060-yw7wmtc7saq.png\"},{\"z_index\":2,\"size\":\"821x720\",\"output_format\":\"png\",\"bounding_box\":{\"absolute\":[228,482,897,1070],\"normalized\":[223,314,875,696]},\"name\":\"Arctic fox\",\"description\":\"Extract the full body of the standing white arctic fox, no background elements included.\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5flash/1791456821475-egwgijina1s.png\"},{\"z_index\":3,\"size\":\"1314x373\",\"output_format\":\"png\",\"bounding_box\":{\"absolute\":[74,51,950,300],\"normalized\":[72,33,927,195]},\"name\":\"Top header text\",\"description\":\"Extract the top header text elements including 'ModelFold AI', 'FIELD NOTES' and 'VOL. 01', no other content included.\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5flash/1791456822084-cnlvwfwro2g.png\"}]},\"resultUrls\":[\"https://tempfile.aiquickdraw.com/seedream5flash/1791456820549-y4diwaen2p.png\",\"https://tempfile.aiquickdraw.com/seedream5flash/1791456821060-yw7wmtc7saq.png\",\"https://tempfile.aiquickdraw.com/seedream5flash/1791456821475-egwgijina1s.png\",\"https://tempfile.aiquickdraw.com/seedream5flash/1791456822084-cnlvwfwro2g.png\"]}",
"completeTime": 1791456822552,
"createTime": 1791456787658,
"costTime": 34,
"creditsConsumed": 12.96,
"updateTime": 1791456822552
}
}Failure
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "79e8e9c3012235f2277ce118f19d930a",
"model": "seedream/5-flash-layer-decomposition",
"state": "fail",
"param": "{\"input\":\"{\\\"size\\\":\\\"auto\\\",\\\"output_format\\\":\\\"png\\\",\\\"image_url\\\":\\\"https://static.aiquickdraw.com/tools/example/1790672695524_2ISGVaOd.png\\\",\\\"prompt\\\":\\\"Split the content in the image into 3 layers by combining some text elements:\\\\nLayer 1: Text <bbox>67 34 944 164</bbox>, <bbox>76 181 285 199</bbox>, <bbox>815 181 946 199</bbox>\\\\nLayer 2: 1 arctic fox <bbox>219 310 873 696</bbox>\\\\nLayer 3: Text <bbox>77 797 941 880</bbox>, <bbox>175 899 855 923</bbox>\\\",\\\"nsfw_checker\\\":true}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"seedream/5-flash-layer-decomposition\"}",
"failCode": "500",
"failMsg": "<error detail>",
"completeTime": 1791456822552,
"createTime": 1791456787658,
"costTime": 34,
"creditsConsumed": 0,
"updateTime": 1791456822552
}
}