WaveSpeedAI APIWavespeed AIQwen Image Layered

Qwen Image Layered

Qwen Image Layered

Playground

Try it on WavespeedAI!

Qwen-Image Layered is a unified image-layer decomposition model for prompt-guided compositing. Provide points, boxes, or rough masks to isolate subjects and regions, and the model splits a single image into multiple RGBA layers with clean alpha, soft edges, and correct occlusion order. Ready-to-use REST inference API with fast response, no cold starts, and affordable pricing.

Features

qwen-image/layered (Image-to-RGBA Layers)

qwen-image/layered is a layered image decomposition model that splits a single image into multiple clean RGBA layers, enabling flexible compositing, background separation, and layer-based creative editing. It supports an optional prompt for better semantic separation and explicit control over the number of output layers.


🌟 Why it stands out

  • Controllable layer count: choose exactly how many RGBA layers you want via num_layers.
  • Clean RGBA outputs: each layer includes transparency for easy compositing and editing.
  • Prompt-guided separation: optionally describe the scene to improve layer grouping in complex images.
  • Workflow-friendly: ideal for design iteration, asset cleanup, and creative pipelines.

⚙️ Capabilities

  • Image-to-multi-layer RGBA decomposition
  • Transparent background handling per layer (RGBA output)
  • Optional prompt conditioning for semantic grouping
  • Works best on images with clear subjects, strong contrast, and limited heavy occlusion

⚙️ Parameters

ParameterDescription
image*Input image file or public URL.
promptOptional caption to guide layer separation (e.g., “a person in front of a building”).
num_layersNumber of RGBA layers to generate (e.g., 4).

💰 Pricing

Reference table:

num_layersTotal Price
1$0.05
2$0.10
3$0.15
4$0.20
5$0.25
8$0.40

How to use

  1. Upload the source image (or provide a public URL).
  2. Set num_layers to the number of layers you want.
  3. Optional: add a prompt to improve semantic separation.
  4. Run the model.
  5. Download the RGBA layers and composite/edit them in your workflow.

💡 Best Use Cases

  • Layer-based editing and compositing workflows
  • Background separation and subject isolation
  • Poster / banner / creative layout design
  • Rapid asset preparation for marketing and social creatives

📝 Notes

  • Best results: clear subjects, good lighting, minimal motion blur, and strong foreground/background separation.
  • Higher num_layers can help break complex scenes into smaller components, but may also create finer splits that require selection/merging in post.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result


# Submit the task
curl --location --request POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/qwen-image/layered" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
    "num_layers": 4,
    "enable_sync_mode": false,
    "enable_base64_output": false
}'

# Get the result
curl --location --request GET "https://api.wavespeed.ai/api/v3/predictions/${requestId}/result" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}"

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
imagestringYes-The image to decompose into layers.
promptstringNo-A text description of the image content.
num_layersintegerNo41 ~ 8The number of layers to generate (1-8).
enable_sync_modebooleanNofalse-If set to true, the function will wait for the result to be generated before returning the response. This property is only available through the API.
enable_base64_outputbooleanNofalse-If enabled, the output will be encoded into a BASE64 string instead of a URL. This property is only available through the API.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayArray of URLs to the generated content (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.has_nsfw_contentsarrayArray of boolean values indicating NSFW detection for each output
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction, the ID of the prediction to get
data.modelstringModel ID used for the prediction
data.outputsstringArray of URLs to the generated layer images (empty when status is not completed).
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2025 WaveSpeedAI. All rights reserved.