Gen2 QwenImage Control Sampler (outdated)
The VideoX denoise loop with True CFG
- model
- positive
- negative
- lora
- image
The endpoint of the (outdated) QwenImage pipeline - the sampler that turns a wrapped model, two conditioning embeds, and your settings into an image. Where the rest of this section is about loading and preparation, this node runs VideoX-Fun's exact denoising loop, which is the thing that actually makes the output match VideoX's diffusers results. If you're not chasing that reproducibility, a modern QwenImage workflow doesn't need it - but inside this pack's chain, this is the only sampler that understands GEN2_WRAPPED_MODEL and GEN2_CONDITIONING.
Inputs
model-GEN2_WRAPPED_MODEL, from Gen2 Apply QwenImage ControlNet.positive/negative-GEN2_CONDITIONING, from Gen2 QwenImage Text Encode.width/height- default 1024 each, 256–4096, step 16. Values are aligned to the latent grid internally, so pick multiples of 16.seed- the RNG seed (0 to 2^64).steps- default 30, 1–200.cfg- default 4.0, 0–20. This is the guidance scale for the classifier-free part of the loop.shift- default 3, 1–100. The timestep shift for the flow-matching schedule.sampler-Flow,Flow_Unipc, orFlow_DPM++, defaultFlow.
Optional:
lora-GEN2_LORAfrom Gen2 Load QwenImage LoRA; if wired, the sampler merges the LoRA stack into the transformer before denoising.attention_backend-AUTO,FLASH_ATTENTION,SAGE_ATTENTION, orSDPA, defaultAUTO. Only change this if you know your hardware's attention library situation.
Output: image (IMAGE).
How it works, briefly
It's a flow-matching denoise loop over a rectified-flow schedule (the same family as the current-generation image models - see the KB's flow-matching coverage for the general idea). Two details are worth knowing:
- True CFG. When a negative prompt is present, the sampler runs the standard two-model pass - positive and negative noise predictions, combined as
neg + true_cfg_scale × (pos − neg)with a fixedtrue_cfg_scaleof 4.0. Yourcfginput drives the classifier-free guidance side of that combination. If there's no negative, it runs a single-model pass. - The wrapped model carries everything the loop needs - the ControlNet context and layers, the VAE for latent/image conversion, the control scale. This is why the sampler is self-contained once you feed it the wrapped model.
It also handles quantized/GGUF models: it detects the storage dtype and picks a compute dtype (bf16 by default), printing a warning if the model dtype and compute dtype mismatch. Precision modes run bf16/fp16, fp8, and GGUF via ComfyUI-GGUF.
Installation
Needs the full QwenImage stack: VideoX-Fun as a custom node, diffusers, optionally ComfyUI-GGUF. Pack install via ComfyUI Manager (search "ComfyUI-gen2"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/petmycat/ComfyUI-gen2
cd ComfyUI-gen2
pip install -r requirements.txt
Common issues
- "dtype mismatch" warning in console. The model's storage dtype doesn't match the compute dtype - common with quantized weights. It logs a warning and proceeds, but if output looks off, check what you loaded.
- ControlNet not affecting output. Re-check
control_context_scaleupstream in the Apply node, and confirm the negative input is actually connected if you expect True CFG behavior. - Wrong conditioning type error. Positive/negative must be
GEN2_CONDITIONINGfrom this pack's text encoder, not stock conditioning. - LoRA no effect. The
lorainput must be wired in - the sampler doesn't scan your loras folder on its own.
The "(outdated)" label is doing real work here: this sampler is precision-built for VideoX parity, and that's a narrow lane. If you're in it, it works; if you're not, the modern native QwenImage tooling is where the ecosystem's momentum went.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | GEN2_WRAPPED_MODEL | — | |
| positive | GEN2_CONDITIONING | — | |
| negative | GEN2_CONDITIONING | — | |
| width | INT | 1024256–4096 | — |
| height | INT | 1024256–4096 | — |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 301–200 | — |
| cfg | FLOAT | 4.00–20 | — |
| shift | INT | 31–100 | — |
| sampler | COMBO | Flow | 3 options: Flow, Flow_Unipc, Flow_DPM++ |
| loraopt | GEN2_LORA | — | |
| attention_backendopt | COMBO | AUTO | 4 options: AUTO, FLASH_ATTENTION, SAGE_ATTENTION, SDPA |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |