AdaptiveGuider
Free 25% by dropping CFG the moment the two passes agree
- model
- positive
- negative
- GUIDER
Every step of real CFG runs your model twice: once toward your prompt, once toward the negative (or empty) conditioning, and the difference gets amplified. For most of the denoising that second pass is doing real work. But late in generation the two predictions converge, and you're paying double for a difference that's approaching zero.
AdaptiveGuider is the node that notices. It's a guider - a drop-in for SamplerCustomAdvanced - from asagi4's small pack Adaptive Guidance for ComfyUI, a port of the Adaptive Guidance paper out of Universidad de los Andes, Meta GenAI and KAUST. The paper's claim, which this node reproduces: adaptively dropping CFG to 1.0 once the conditional and unconditional predictions align saves about 25% of the compute with no visible quality loss.
How it actually works is refreshingly legible. Each step, the guider computes both the positive and negative predictions, then takes the cosine similarity between them. The moment that similarity crosses your threshold, it sets CFG to 1.0 for every remaining step. And here's the trick that makes it fast rather than cosmetic: at CFG exactly 1.0 ComfyUI doesn't compute the unconditioned pass at all - it's skipped as an optimization, not just multiplied out. So the flip halves the cost of each remaining step, and the negative prompt quietly stops being evaluated. The author is upfront that he hand-translated the paper's math and isn't sure the similarity calculation matches the original exactly - "but it appears to work." For a research port, that's a fair deal.
The inputs that matter are few. threshold (default 0.99) is the similarity at which CFG drops; the README is emphatic that you keep it between 0.99 and 1.0. cfg is just your normal guidance scale, whatever you'd run without the node. Then positive and negative conditioning, like any guider. The two optional knobs are worth a look: cfg_start_pct runs the first fraction of the schedule with CFG off entirely (0 default), and uncond_zero_scale enables "uncond zero" CFG after the flip - a trick borrowed from Extraltodeus's Uncond-Zero pack that nudges the sample off the conditional direction instead of running free. It can help slightly, but the author flags it as unstable and subject to change, so don't build a production workflow on it.
Wiring is standard custom-sampling: the GUIDER output goes into a SamplerCustomAdvanced, with a BasicScheduler, KSamplerSelect and RandomNoise alongside. The repo ships an example workflow that renders the same image with and without it so you can see the difference yourself.
Install is painless. In ComfyUI Manager search "Adaptive Guidance for ComfyUI", or:
cd ComfyUI/custom_nodes
git clone https://github.com/asagi4/ComfyUI-Adaptive-Guidance
then restart. No requirements.txt, no model downloads, nothing heavy - it only imports core ComfyUI's comfy.samplers. It's on the Comfy Registry too, so a registry install works.
Where people get burned:
- threshold at 1.0 never triggers (the code requires similarity strictly below 1), so you get plain CFGGuider behavior with zero speedup. Threshold much below 0.99 flips too early and prompt adherence fades.
- The guider only works in a
SamplerCustomAdvancedgraph. You can't drop it into a plainKSampler. - The one genuinely fiddly interaction: the popular r/StableDiffusion Flux guide that made this node known paired it with Dynamic Thresholding, and dynthres keeps patching after CFG drops to 1, washing out the final image - that guide's author had to patch dynthres to stop. If you run both and your last steps look desaturated, that's why.
- It's built for models that actually use CFG (the SD 1.5/SDXL family). On guidance-distilled checkpoints like Flux or Z-Image Turbo there's no unconditioned pass to skip in the first place.
Honest verdict: 20–25% faster high-step SDXL renders, with the side effect that late steps run at CFG 1 - which is the model's most natural state, so it tends to look slightly cleaner, not worse. For an obscure one-person pack, that's a surprisingly good ratio of payoff to setup.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| threshold | FLOAT | 0.99000.9–1 | — |
| cfg | FLOAT | 8.00–100 | — |
| uncond_zero_scaleopt | FLOAT | 0.00 | — |
| cfg_start_pctopt | FLOAT | 0.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GUIDER | GUIDER | — |