DiffSynth: Qwen Image 2.1 Inference
Qwen Image 2.1 Inference — generation and editing from the same node
- pipe
- edit_image
- controlnet_inputs
- image
The interesting thing about Qwen-Image 2.1 is that it's one model doing two jobs. The v1 family needed a base model for generation and a separate Edit line for instruction editing, with LoRA libraries that didn't even transfer between them. The 2.x generation-design merged those into a single network, and this node exposes both sides with one required-fields list and a pile of optional sockets.
If you're coming from the v1 workflow: shorter graph, one node, same rules.
The core six
pipe from the loader, then prompt, seed, num_inference_steps, height, width.
The defaults are 40 steps at 1024×1024 and CFG 1. Read that CFG value carefully - it's the guidance-distilled configuration, which is where the whole 2026 model generation landed. At CFG 1 there's no unconditional pass, the render is roughly half the cost of a CFG-2 run, and the negative prompt field does nothing. ComfyUI still draws the box. Filling it with blurry, bad anatomy is harmless and pointless; write your constraints as things you want to see.
The pack's own template runs 50 steps at 1024×1024, seed 42. Trust it over your muscle memory.
Generation
Wire nothing but the pipe. That's text-to-image.
Editing
edit_image takes an IMAGE, and the prompt is a plain-language instruction - change the jacket, remove the sign, put it at golden hour. This is the job the Qwen-Edit line won in the open-weights world, and the reason it won was licensing as much as quality: Apache 2.0 means the community could build LoRAs on it, which is not true on the Flux Kontext side.
Because 2.1 is unified, you don't need a different checkpoint or a different loader for this. Same pipeline, one extra wire.
The optional sockets
negative_prompt- present, multiline, inert at CFG 1 (see above). It starts doing something if you raisecfg_scaleabove 1, at which point you're paying double for each step.controlnet_inputs- a wildcard (*) socket. It accepts whatever the ControlNet path in DiffSynth produces. Documentation is thin; check DiffSynth-Studio's own docs before assuming ComfyUI-style ControlNet images are what it wants.sigmas- a comma-separated string of sigma values, so you can drive the schedule by hand instead of using the step count. Format is numbers, comma-separated; leave it empty for the normal path.use_kv_cache(default true) - caching for repeated/related generations. Leave it on.use_flex_attention(default false) - swap in flex attention for the attention pass. Worth a try if you're chasing speed on a long sequence; a way to break things if your build doesn't have it.tiled(default false),tile_size(256),tile_stride(192) - tiled decoding when a straight full-resolution decode doesn't fit. Smaller stride means more overlap and more time; there's a visible seam risk if you push tiles too far apart.
Output is a single image.
Install
ComfyUI Manager → DiffSynth-ComfyUI → install → restart. Or:
pip install git+https://github.com/modelscope/DiffSynth-Studio.git
cd ComfyUI/custom_nodes && git clone https://github.com/modelscope/DiffSynth-ComfyUI.git
Start from the featured_qwen_image_2_1 template in the Template tab. It has the loader, the four ModelConfigs and this node already wired.
Where people get burned
CFG 4 because that's what Qwen used to want. On the v1 base, CFG 4 is correct. Here it double-runs the model and overcooks the image. If your output looks like a high-contrast poster, that's your first suspect.
Waiting for the negative prompt to fix anatomy. It can't, at CFG 1. Change the positive prompt.
Editing an image whose aspect ratio fights the model. The editing path is sensitive to resolution, and the community habit for the Qwen editor is to keep input dimensions on multiples of 112 rather than eyeballing it.
Assuming a 2.x checkpoint is automatically lighter. Unified design doesn't mean small. Check what you're actually loaded with before planning a batch of two hundred renders.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | DIFFSYNTH_PIPE | — | |
| prompt | STRING | — | |
| seed | INT | 00–4294967295 | — |
| num_inference_steps | INT | 401–200 | — |
| height | INT | 102464–4096 | — |
| width | INT | 102464–4096 | — |
| negative_promptopt | STRING | — | |
| cfg_scaleopt | FLOAT | 1.00–10000 | — |
| edit_imageopt | IMAGE | — | |
| controlnet_inputsopt | * | — | |
| sigmasopt | STRING | — | |
| use_kv_cacheopt | BOOLEAN | true | — |
| use_flex_attentionopt | BOOLEAN | false | — |
| tiledopt | BOOLEAN | false | — |
| tile_sizeopt | INT | 2560–4294967295 | — |
| tile_strideopt | INT | 1920–4294967295 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |