Skip to content

Seedream5.0 Flash - Layer Decomposition ​

Endpoint ​

POST /images/generations

Full URL: https://modelfold.ai/v1/images/generations

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.

Input parameters for the layer separation task

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe 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。 Example:seedream/5-flash-layer-decomposition。
promptstringYesPrompt required by the ModelFold gateway; at most 2000 characters. 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 &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
- Length: 4–5000 characters minLength: 4. maxLength: 2000. Example: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。
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 Example:https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png。
sizestringNoResolution 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。 Example:2K。
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。 Example:jpeg。

Request Example ​

bash
curl -X POST "https://modelfold.ai/v1/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "seedream/5-flash-layer-decomposition",
  "image_url": "https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png",
  "prompt": "Separate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers",
  "size": "auto",
  "output_format": "jpeg"
}'
json
{
  "model": "seedream/5-flash-layer-decomposition",
  "image_url": "https://static.aiquickdraw.com/tools/example/1786019968051_cKRYLHHu.png",
  "prompt": "Separate the title text <bbox>179 58 809 197</bbox> and the parrot <bbox>330 274 641 991</bbox> into independent layers",
  "size": "auto",
  "output_format": "jpeg"
}

Response ​

200 — Generation completed. usage contains actual billing details; result URLs are illustrative. ​

json
{
  "ok": true,
  "created": 1792134000,
  "data": [
    {
      "url": "https://modelfold.ai/uploads/outputs/result.png"
    }
  ],
  "usage": {}
}

ModelFold — one API for all the best AI models.