Skip to content

Seedream5.0 Pro - 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 Pro: 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.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name used to execute the layer separation task. Required field.
- Must be seedream/5-pro-layer-decomposition for this endpoint Default:"seedream/5-pro-layer-decomposition"。 Allowed values:seedream/5-pro-layer-decomposition。 示例:seedream/5-pro-layer-decomposition。
callBackUrlstringNoThe 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。
inputobjectYesInput parameters for the layer separation task
  input.promptstringNoOptional 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 &lt;bbox&gt;x1 y1 x2 y2&lt;/bbox&gt; to precisely specify element positions, recommending the use of normalized coordinates in the 0-1000 range 示例:Separate the title text &lt;bbox&gt;179 58 809 197&lt;/bbox&gt; and the parrot &lt;bbox&gt;330 274 641 991&lt;/bbox&gt; into independent layers。
  input.image_urlstringYesThe 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.sizestringYesRequired. Output resolution tier: auto, 1K, 1.5K or 2K. auto follows the input image size. Allowed values:auto / 1K / 1.5K / 2K。 示例:2K。
  input.output_formatstringNoOutput 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 ​

bash
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-pro-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"
  }
}'
json
{
  "model": "seedream/5-pro-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"
  }
}

Response ​

200 — Request successful. ​

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_seedream_1765172101886"
  }
}

500 — Server error. ​

参数类型必填说明
codeinteger是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
msgstring是Response message, error description when failed
dataobject是—
json
{
  "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

参数类型必填说明
codeinteger否200: success. 501: failure; see data.failCode and data.failMsg. Allowed values:200 / 501。 示例:200。
msgstring否Status message 示例:Playground task completed successfully.。
dataobject否—
  data.completeTimeinteger否Task completion time, represented as a Unix timestamp in milliseconds 示例:1786417803000。
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks. 示例:43。
  data.createTimeinteger否Task creation time, represented as a Unix timestamp in milliseconds 示例:1786417758000。
  data.creditsConsumednumber否Credits consumed by the task; 0 for failed tasks. 示例:21。
  data.modelstring否Model used for the image layer decomposition task 示例:seedream/5-pro-layer-decomposition。
  data.paramstring否Parameters submitted when creating the task, in JSON string format 示例:{"input":"{\"size\":\"auto\",\"output_format\":\"jpeg\",\"image_url\":\"https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png\",\"prompt\":\"Split the title text &lt;bbox&gt;179 58 809 197&lt;/bbox&gt; and the parrot &lt;bbox&gt;330 274641 991&lt;/bbox&gt; into separate layers\"}","callBackUrl":"https://your-domain.com/api/callback","model":"seedream/5-pro-layer-decomposition"}。
  data.resultJsonstring否Layer decomposition result in JSON string format. resultObject.layers_data contains information about each layer, and resultUrls contains the list of all output file URLs. Present only when state is success. 示例:{"resultObject":{"layers_data":[{"z_index":0,"size":"1080x1080","output_format":"jpeg","url":"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417797749-4ts7v7lh2v9.jpeg"},{"z_index":1,"size":"1179x245","output_format":"png","bounding_box":{"absolute":[202,63,872,202],"normalized":[187,58,806,186]},"name":"Seedream Title Text","description":"Extract the yellow Seedream title text. Retain only the text itself, excluding annotation borders and background content.","url":"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417799558-xckcwufhvg.png"},{"z_index":2,"size":"425x995","output_format":"png","bounding_box":{"absolute":[385,331,686,1035],"normalized":[356,306,634,957]},"name":"Colorful Macaw","description":"Extract the colorful red, yellow, green, and blue macaw perched on the branch. Retain only the parrot itself, excluding annotation borders, the branch, and background content.","url":"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417801592-m1rf8z5zs0l.png"}]},"resultUrls":["https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417797749-4ts7v7lh2v9.jpeg","https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417799558-xckcwufhvg.png","https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417801592-m1rf8z5zs0l.png"]}。
  data.statestring否Task status Allowed values:success / fail。 示例:success。
  data.taskIdstring否Task ID 示例:d481b8cd378397dce459252764a33621。
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime. 示例:1786417803000。
  data.failCodestring否Failure code, a numeric string such as "400" or "500". Present only when state is fail. 示例:500。
  data.failMsgstring否Failure reason. Present only when state is fail. 示例:&lt;error detail&gt;。

Success

json
{
  "code": 200,
  "msg": "Playground task completed successfully.",
  "data": {
    "taskId": "d481b8cd378397dce459252764a33621",
    "model": "seedream/5-pro-layer-decomposition",
    "state": "success",
    "param": "{\"input\":\"{\\\"size\\\":\\\"auto\\\",\\\"output_format\\\":\\\"jpeg\\\",\\\"image_url\\\":\\\"https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png\\\",\\\"prompt\\\":\\\"Split the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274641 991</bbox> into separate layers\\\"}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"seedream/5-pro-layer-decomposition\"}",
    "resultJson": "{\"resultObject\":{\"layers_data\":[{\"z_index\":0,\"size\":\"1080x1080\",\"output_format\":\"jpeg\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417797749-4ts7v7lh2v9.jpeg\"},{\"z_index\":1,\"size\":\"1179x245\",\"output_format\":\"png\",\"bounding_box\":{\"absolute\":[202,63,872,202],\"normalized\":[187,58,806,186]},\"name\":\"Seedream Title Text\",\"description\":\"Extract the yellow Seedream title text. Retain only the text itself, excluding annotation borders and background content.\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417799558-xckcwufhvg.png\"},{\"z_index\":2,\"size\":\"425x995\",\"output_format\":\"png\",\"bounding_box\":{\"absolute\":[385,331,686,1035],\"normalized\":[356,306,634,957]},\"name\":\"Colorful Macaw\",\"description\":\"Extract the colorful red, yellow, green, and blue macaw perched on the branch. Retain only the parrot itself, excluding annotation borders, the branch, and background content.\",\"url\":\"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417801592-m1rf8z5zs0l.png\"}]},\"resultUrls\":[\"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417797749-4ts7v7lh2v9.jpeg\",\"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417799558-xckcwufhvg.png\",\"https://tempfile.aiquickdraw.com/seedream5pro-layer/1786417801592-m1rf8z5zs0l.png\"]}",
    "completeTime": 1786417803000,
    "createTime": 1786417758000,
    "costTime": 43,
    "creditsConsumed": 21,
    "updateTime": 1786417803000
  }
}

Failure

json
{
  "code": 501,
  "msg": "Playground task failed.",
  "data": {
    "taskId": "d481b8cd378397dce459252764a33621",
    "model": "seedream/5-pro-layer-decomposition",
    "state": "fail",
    "param": "{\"input\":\"{\\\"size\\\":\\\"auto\\\",\\\"output_format\\\":\\\"jpeg\\\",\\\"image_url\\\":\\\"https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png\\\",\\\"prompt\\\":\\\"Split the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274641 991</bbox> into separate layers\\\"}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"seedream/5-pro-layer-decomposition\"}",
    "failCode": "500",
    "failMsg": "<error detail>",
    "completeTime": 1786417803000,
    "createTime": 1786417758000,
    "costTime": 43,
    "creditsConsumed": 0,
    "updateTime": 1786417803000
  }
}

ModelFold — one API for all the best AI models.