Ideogram DualModelGuider (channelwise + APG)
Push Ideogram 4's CFG without the color burn
- model_cond
- model_uncond
- positive
- negative
- GUIDER
Ideogram 4's stock ComfyUI setup runs the model as two separate UNets - one conditional, one a dedicated unconditional network - and a dual-model guider combines their predictions every step. It works, but it inherits the same ceiling all CFG has: nudge the scale up and the image goes deep-fried, oversaturated, blown out in the highlights. This node is the tuned replacement for that guider. Same GUIDER socket, same wiring, and three extra dials that soak up the saturation so you can run guidance higher and get the punchier photoreal look without the burn.
If you've ever pushed CFG until the skin turned into a lava lamp, you know the cliff. This is a way to stand past it - on one specific model family, no more.
What "dual network" actually means here
Ideogram 4 isn't a single weights file you CFG against like SDXL. It ships two: ideogram4_fp8_scaled.safetensors for the conditional pass and ideogram4_unconditional_fp8_scaled.safetensors for the unconditional one (both from Comfy-Org's Ideogram-4 repo). The guider gets a model_cond and a model_uncond socket instead of one MODEL, and it runs both networks per step to build the guidance direction.
The wiring that actually works, per the README:
cond model → ModelSamplingAuraFlow(shift=5) → model_cond
uncond model → ModelSamplingAuraFlow(shift=5) → model_uncond
prompt CLIPTextEncode → positive
CLIPTextEncode → ConditioningZeroOut → negative
Ideogram DualModelGuider → SamplerCustomAdvanced (guider input)
Both model inputs must pass through identical ModelSampling patches. Each UNet turns the sampler's sigma into its denoised prediction using its own model-sampling; if the shifts differ, the two predictions live in different spaces and the combine is silently wrong. This is the classic AuraFlow-patch gotcha, and it's the #1 reason a "custom guider is broken" post is actually a wiring problem.
How the three techniques work
The node layers three published tricks on top of the plain two-model CFG combine (guided = cond + (cfg − 1) × (cond − uncond)):
- Channelwise CFG normalization (
channelwise_strength, default 0.7) rescales each latent channel's standard deviation to match the conditional prediction, then blends by the strength. That's Lin et al.'s "guidance rescale" - the anti color-burn trick, and it works. - APG (
apg_eta, default 0) projects the guidance vector and keeps mostly the part orthogonal to the conditional prediction. The parallel component is what drives oversaturation; 1.0 is plain CFG, 0.0 is fully orthogonal and maximally anti-saturation. From Sadat et al.'s APG paper. - CFG momentum (
momentum, default 0) is a running average of the guidance direction across steps. The paper uses roughly −0.5 - negative, because the goal is damping, not amplification.
Note the source is a clean-room implementation written from those two papers, explicitly not derived from RES4LYF's GPL-3.0 code. So this pack's licensing story is boring in the good way: MIT-friendly, no viral obligations, safe to drop into any workflow.
The inputs that matter
The four sockets (model_cond, model_uncond, positive, negative) plus cfg - default 4.5, and the point is to push it higher than your vanilla guider could stomach. Then the four dials above: channelwise_strength (0=off, ~0.7 is a good start), apg_eta, momentum, and apg_norm_threshold (0=off; try 4–15 if highlights still clip). The output is a single GUIDER that feeds the guider socket on SamplerCustomAdvanced.
One sanity check worth keeping in your pocket: apg_eta=1.0, channelwise_strength=0, momentum=0, apg_norm_threshold=0 reproduces vanilla dual-model CFG at the same cfg. A fixed-seed A/B against your stock guider with those settings tells you the plumbing is right before you trust any of the fancy math.
Install
Clone it into custom_nodes and restart. No pip dependencies, no model downloads in this pack - it rides on ComfyUI internals and the Ideogram 4 files you already have:
cd ComfyUI/custom_nodes
git clone https://github.com/TomiLikesToCode/comfyui-ideogram-guidance
Then restart ComfyUI and confirm the node appears under Ideogram/guidance with no import errors. ComfyUI Manager can find it by the pack title if you prefer.
Where people get burned
- Mismatched ModelSampling patches - the big one. Same shift on both UNets or the whole thing is garbage.
- VRAM. Both UNets get co-loaded onto the GPU each step (the node holds them resident together so neither evicts the other). Two models at once is heavy; on a tight card, expect it to hurt.
- You still pushed too far. APG and channelwise buy headroom; they don't make CFG 20 free. If highlights keep clipping, reach for
apg_norm_threshold, not a bigger cfg.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model_cond | MODEL | — | |
| model_uncond | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| cfg | FLOAT | 4.50–30 | Guidance scale. Push higher than vanilla — the rescale/APG below absorb the saturation. |
| channelwise_strength | FLOAT | 0.700–1 | Per-channel std match to the conditional prediction. 0=off, ~0.7 is a good start. Anti color-burn. |
| apg_eta | FLOAT | 0.000–1 | Parallel-component retention. 1.0=plain CFG, 0.0=fully orthogonal (max anti-saturation). |
| apg_norm_threshold | FLOAT | 0.00–50 | Optional clamp on guidance-vector magnitude. 0=off. Try 4-15 if highlights still clip. |
| momentum | FLOAT | 0.00-1–1 | Running average of guidance across steps. 0=off. APG paper uses ~ -0.5 to smooth oversaturation. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GUIDER | GUIDER | — |