Nodes/ComfyUI-gen2/Gen2 QwenImage Control Sampler (outdated)
ComfyUI Node

Gen2 QwenImage Control Sampler (outdated)

The VideoX denoise loop with True CFG

By petmycat·Created 7 months ago·Updated 12 days ago· 23
Gen2 QwenImage Control Sampler (outdated)
  • model
  • positive
  • negative
  • lora
  • image
width1024
height1024
seed0
steps30
cfg4.0
shift3
samplerFlow
attention_backendAUTO

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, or Flow_DPM++, default Flow.

Optional:

  • lora - GEN2_LORA from Gen2 Load QwenImage LoRA; if wired, the sampler merges the LoRA stack into the transformer before denoising.
  • attention_backend - AUTO, FLASH_ATTENTION, SAGE_ATTENTION, or SDPA, default AUTO. 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 fixed true_cfg_scale of 4.0. Your cfg input 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_scale upstream 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_CONDITIONING from this pack's text encoder, not stock conditioning.
  • LoRA no effect. The lora input 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.

CategoryGen2/QwenImage

Inputs (12)

NameTypeDefaultDescription
modelGEN2_WRAPPED_MODEL
positiveGEN2_CONDITIONING
negativeGEN2_CONDITIONING
widthINT1024256–4096
heightINT1024256–4096
seedINT00–18446744073709550000
stepsINT301–200
cfgFLOAT4.00–20
shiftINT31–100
samplerCOMBOFlow3 options: Flow, Flow_Unipc, Flow_DPM++
loraoptGEN2_LORA
attention_backendoptCOMBOAUTO4 options: AUTO, FLASH_ATTENTION, SAGE_ATTENTION, SDPA

Outputs (1)

NameTypeDescription
imageIMAGE