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.

a39b591d8c3b.json
Fetching workflow JSON…

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

// Install (beta)
npm i @comfyorg/sdk

// Run this workflow (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });
const wf = await client.workflows.fromFile("workflow_api.json");
const job = await client.run(wf);
await job.getOutputs("<output-node-id>")[0].toFile("output.png");

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).

Comfy Cloud API access requires a plan with an API key.

FAQ

Frequently Asked Questions

View all workflows
Showing 30 of 30 templates