Qwen Image Layer Decomp for Illustration v1

Qwen Image Layer Decomp for Illustration v1 is a guided layer-separation workflow for turning a flat illustration into editable layers and masks. It routes a loaded image through ImageScaleToMaxDimension to a recommended working size (640 px for speed, 1024 px for detail), then drives a custom Qwen-based decomposition stage that predicts per-element mattes you can save as PNGs. A PrimitiveStringMultiline node provides an optional, high-level text prompt so you can nudge the model toward the objects you want isolated (for example: "character, foreground props, midground buildings, sky").

Technically, the core is implemented with two custom nodes (f754a936-daaf-4b6e-9658-41fdc54d301d and 1ea4fa01-a81b-4420-a03c-f60019e69a92). The first performs the Qwen image layer decomposition using diffusion-style sampling controls (the author’s baseline is 50 steps, CFG 4.0), trading runtime for mask quality. The second is used for selection/refinement of the predicted layers (cleaning edges or exporting specific passes). LoadImage and SaveImage handle I/O, while MarkdownNote contains on-canvas guidance and links. The result is a practical, prompt-guided layer extraction pipeline that’s ideal for compositing, recoloring, and 2.5D motion work.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

GET https://comfy.org/workflows/download/a39b591d8c3b.json
Fetching workflow JSON…

Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

# Install (beta)
pip install comfy-sdk        # Python
npm i @comfyorg/sdk          # TypeScript

# Run this workflow (Python)
from comfy_sdk import Comfy

client = Comfy(api_key="comfyui-...")
wf = client.workflows.from_file("workflow_api.json")
job = client.run(wf)
for output in job.get_outputs("<output-node-id>"):
    output.to_file(output.name)

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key

FAQ

Frequently Asked Questions

View all workflows
Character
Cinematic
Image to Video
Lip Sync
Multiple Angles
Portrait
Style Reference
Style Transfer
Text to Video
Video Generation
Video
Showing 30 of 30 templates