Dual CFG Guider
Two prompts, two CFG dials, one pass
- model
- cond1
- cond2
- negative
- GUIDER
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,
cond2is guided againstnegativeatcfg_cond2_negative- this is a "clean base" prediction, but pulled towardcond2. - Then the result is pulled further toward
cond1bycfg_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-regularornested.
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_negativeisn'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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| cond1 | CONDITIONING | — | |
| cond2 | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| cfg_conds | FLOAT | 8.00–100 | — |
| cfg_cond2_negative | FLOAT | 8.00–100 | — |
| style | COMBO | 2 options: regular, nested |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GUIDER | GUIDER | — |