Eric Qwen Layer Decompose (Diffusers)
Turn a flat photo into real PSD layers — the node that made people say Photoshop is dead
- image
- layers
- alpha_masks
- layer_count
- layer_info
- auto_caption
When Qwen-Image-Layered dropped in December 2025, the top comment on the release thread was "In 6 months, Photoshop will be useless" at +910. Hyperbolic, sure, but the direction is real: a 20B model that looks at one flat RGB image and splits it into separate RGBA layers - background, subjects, foreground elements - each with its own alpha. This node is how you drive that model from ComfyUI, and it's the reason this whole pack exists.
What it does
EricQwenDecompose wraps Alibaba's QwenImageLayeredPipeline from the diffusers library. Feed it an image, tell it how many layers you want, and it hands back a batch of RGBA layers plus a matching set of alpha masks. The model isn't just masking; it's generating - it decomposes semantically, so the layer named "white_flower_with_green_leaves" actually contains the flower. That's a world away from the old luminance-and-color separation hacks.
The pipeline loads in bfloat16 either by auto-downloading from HuggingFace or from a local diffusers repo you've dropped into ComfyUI/models/diffusion_models/. The model_source dropdown is built dynamically, so a properly placed local folder shows up as [Local Repo] Qwen-Image-Layered.
The inputs that matter
- num_layers (2–10): start at 4. Push higher for busy images with many distinct elements.
- resolution: 1024 gives ~1MP output quality, 640 gives ~0.4MP and runs faster. The official sample code actually recommends 640 - this is a heavy model.
- seed and steps (default 50): standard reproducibility knobs.
- cfg_scale (default 4.0): this maps to
true_cfg_scalein the pipeline, not the classic ComfyUI CFG. - upscale_to_original: resizes the generated layers back to your input image's resolution - worth it if you're compositing later.
- caption_layers: runs the model's vision encoder per layer to name them ("Aged_paper_background_with_text"). Adds ~5–10 seconds per layer, but the names are great.
- keep_model_loaded (default true): keeps the ~15GB pipeline resident in VRAM for the next run. Set it false to free memory every pass.
The five outputs are layers (IMAGE batch, each RGBA), alpha_masks, layer_count, layer_info (a JSON string with names and coverage), and auto_caption (the vision model's description of the whole image). Wire layers and alpha_masks into the pack's Layer Save node; feed layer_info into Save's layer_info input so the PSD layers get proper names.
Installing and the trap to avoid
Install via ComfyUI Manager (search "Eric Qwen") or:
cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Qwen_Layers_Diffuser_Pipeline_Comfyui
then restart and pip install diffusers transformers accelerate psd-tools tifffile if your environment doesn't have them. Here's the trap: the pack's requirements.txt treats diffusers/transformers/accelerate as optional, and if they're missing this node does not error out - it silently falls back to "simulated" layers made from luminance bands. The auto_caption output literally says (simulated - diffusers not installed). If your "decomposition" looks like a gradient bar test pattern, that's what happened; check the console.
Where people get burned
The model is a 20B diffusion transformer. The full bf16 download is roughly 40GB and wants a big card - the README's "16GB+ VRAM recommended" is optimistic for that build. Community consensus is that this thing is slow: with 4 layers it renders a composite plus a guidance frame plus a reference frame plus each layer, which the r/comfyui crowd pegged at about 6x a normal Qwen generation. FP8 (~20GB) and NF4 (~10GB) quantizations exist if your GPU is tighter. And if you set keep_model_loaded to true, remember the Unload Model node exists - that pipeline won't leave VRAM on its own.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| num_layers | INT | 42–10 | Number of layers to decompose into (2-10) |
| resolution | COMBO | 1024 | Processing resolution. 1024 gives ~1MP output, 640 gives ~0.4MP. |
| model_source | COMBO | HuggingFace (Download) | Choose HuggingFace download or local safetensors file |
| promptopt | STRING | Optional prompt to guide decomposition. Leave empty for auto-caption. | |
| negative_promptopt | STRING | Optional negative prompt | |
| seedopt | INT | 00–18446744073709550000 | Random seed for reproducibility |
| cfg_scaleopt | FLOAT | 4.01–20 | CFG scale (true_cfg_scale in pipeline) |
| stepsopt | INT | 5010–100 | Number of inference steps |
| cfg_normalizeopt | BOOLEAN | false | Enable CFG normalization |
| use_en_promptopt | BOOLEAN | true | Use English for auto-captioning |
| upscale_to_originalopt | BOOLEAN | false | Upscale output layers back to original input image size |
| upscale_methodopt | COMBO | lanczos | Interpolation method for upscaling |
| keep_model_loadedopt | BOOLEAN | true | Keep model in VRAM after processing. Disable to free memory after each run. |
| caption_layersopt | BOOLEAN | false | Use vision model to generate descriptive names for each layer (slower but more accurate) |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| layers | IMAGE | — |
| alpha_masks | MASK | — |
| layer_count | INT | — |
| layer_info | STRING | — |
| auto_caption | STRING | — |