Qwen Image Layered
Decompose one image into editable RGBA layers
- client
- images
- masks
Qwen Image Layered is the oddball in the pack's WaveSpeed section, and it's genuinely cool: feed it a single image and it decomposes it into separate RGBA layers - foreground subject, background, objects - with transparency built in. Out the other side you get a batch of layer images and a matching batch of alpha masks, ready for compositing work. It's like asking a model to do the layer separation you'd normally do by hand in Photoshop.
It's a WaveSpeed-hosted Qwen capability, so the mechanics are a billed API call: the image goes up, the model reasons about the scene's depth and object boundaries, and the result comes back as multiple layers. You control the granularity with num_layers - 2 to 8, default 4. More layers means finer separation (and, realistically, more chances for the model to split something oddly); fewer means chunkier, safer cuts. The prompt input lets you steer the decomposition - describe what matters ("keep the person separate from the car, merge the road and sky") in Chinese or English.
The inputs and outputs
image- the image to decompose, as a URL or path (a string, not a tensor)num_layers- 2 to 8, default 4prompt- optional guidance for how to split the sceneseed- cache control; randomize for a fresh decomposition each runenable_sync_mode/enable_base64_output- completion and encoding behaviorclient- optional WaveSpeed client
The two outputs are the point: images (IMAGE batch, the layer RGBs) and masks (MASK batch, one alpha per layer). Wire them into compositing nodes - the mask batch is exactly what the pack's Region Mask-style tooling or any mask-based compositor wants. Layer 1 through N correspond positionally between the two outputs, so images[i] pairs with masks[i].
Install and setup
cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt
Or "ERPK Custom Nodes" from ComfyUI Manager, restart, and set a WaveSpeed API key in ERPK Settings (right-click canvas).
Troubleshooting and honest expectations
"Image must be provided" is the validation error you'll hit if you queue it empty - no surprise there. The bigger caveat is expectations: model-based layer separation is impressive but not pixel-surgical. A busy scene with overlapping subjects will come back with imperfect edges, and num_layers doesn't guarantee the kinds of layers you want - you might get "person / background / shadow" instead of "person / car / road / sky." That's what the prompt guidance is for. If your source is a clean product shot or a single subject on a simple background, this node can save you serious masking time. For chaotic scenes, budget for cleanup. The transparency genuinely is real though - that's the part people don't expect, and it opens up the whole compositing toolbox.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | STRING | The image to decompose into layers (URL or path) | |
| seed | INT | -1-1–2147483647 | Seed for cache control. Randomizes by default. |
| promptopt | STRING | Optional text description to guide layer decomposition (Chinese or English) | |
| clientopt | WAVESPEED_AI_API_CLIENT | WaveSpeed API client (optional if API key is configured in Settings) | |
| num_layersopt | INT | 42–8 | Number of layers to decompose into (2-8) |
| enable_sync_modeopt | BOOLEAN | false | Wait for completion before returning response |
| enable_base64_outputopt | BOOLEAN | false | Return BASE64-encoded output instead of URL |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| masks | MASK | — |