Nodes/ComfyUI/Dual CFG Guider
ComfyUI Node Runs on cloud

Dual CFG Guider

Two prompts, two CFG dials, one pass

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,962
Dual CFG Guider
  • model
  • cond1
  • cond2
  • negative
  • GUIDER
cfg_conds8.0
cfg_cond2_negative8.0
style

Dual CFG Guider runs guidance with two conditioning streams, each with its own CFG weight, plus a negative. Where CFGGuider gives you one positive and one negative, this one gives you cond1 and cond2 - two prompt-conditioned passes - with independent strengths, so you can hold a strong main prompt and a weaker secondary prompt in the same run.

It ships with ComfyUI core (comfy_extras.nodes_custom_sampler), added in April 2024. The original commit message names the intended use: "Add DualCFGGuider used in IP2P models for example" - InstructPix2Pix-style models, where one conditioning stream carries the instruction and another carries the input image's content. It's the node behind what ComfyUI calls "dual prompt guidance."

How it works

The math is a cascade. Treat cond1 as your primary prompt, cond2 as a middle condition, and negative as the floor:

  • First, cond2 is guided against negative at cfg_cond2_negative - this is a "clean base" prediction, but pulled toward cond2.
  • Then the result is pulled further toward cond1 by cfg_conds.

So cfg_conds is how hard the main prompt steers, and cfg_cond2_negative is how hard the secondary condition steers against the negative. The style combo (regular vs nested) changes how those two CFG scales compose - nested composes them as a layered prediction, regular as the flat cascade. Regular is the default and is what you'll leave it on.

The inputs:

  • model - the checkpoint.
  • cond1 - the primary conditioning.
  • cond2 - the secondary conditioning.
  • negative - the negative conditioning.
  • cfg_conds - CFG for the primary condition, default 8.
  • cfg_cond2_negative - CFG for the secondary condition vs negative, default 8.
  • style - regular or nested.

It outputs a GUIDER for SamplerCustomAdvanced.

When you'd actually use it

Two situations, both niche. First, InstructPix2Pix-style editing, where one condition describes the edit and the other carries the source image - the node's original reason to exist. Second, Ideogram 4 workflows, where the structured JSON prompt splits into multiple conditioning streams and the dual-CFG structure is how the official workflows blend them. You'll also see it in "combine a subject prompt with a style prompt" experiments - the ability to weight the two separately is the whole appeal.

Where people get burned

  • It's not two separate samplers. Some people expect each condition to get its own sampling run. No - it's one run with two guidance pulls. If you want independent passes, that's two samplers in series, not this node.
  • cfg_cond2_negative isn't a second negative. It's the weight of the middle condition against the negative. Set it to 0 and cond2 stops contributing; crank it and the middle prompt dominates the base.
  • Default CFG values are SDXL-era numbers. Defaults of 8 are from 2024. If you're on a distilled model, both dials should be near 1 - and then this node's machinery is mostly idling, so consider whether a BasicGuider is the honest choice.
  • The middle condition is treated as a negative-ish prompt internally. ComfyUI marks cond2's prompt type as "negative" under the hood, which surprises people when they inspect conditioning metadata. The effect is what the two CFG dials describe; don't overthink the internals.

If you need one main prompt and nothing else, plain CFG Guider is simpler. Reach for this when a second, separately-weighted condition is genuinely doing work.

Categorymodel/sampling/guiders

Inputs (7)

NameTypeDefaultDescription
modelMODEL
cond1CONDITIONING
cond2CONDITIONING
negativeCONDITIONING
cfg_condsFLOAT8.00–100
cfg_cond2_negativeFLOAT8.00–100
styleCOMBO2 options: regular, nested

Outputs (1)

NameTypeDescription
GUIDERGUIDER