AdaptiveProjectedGuidance
CFG that pushes sideways instead of into the manifold
- model
- MODEL
Every real-CFG step steers the sample along the full difference between the conditional and unconditional predictions. The problem: part of that difference points in the same direction as the conditional prediction itself, and pushing along it overshoots - that's a large chunk of why high CFG burns colors, crushes contrast, and distorts faces. Projected guidance is the fix that splits the push into a component parallel to the conditional prediction and one orthogonal to it, and lets you scale them separately.
AdaptiveProjectedGuidance is a model patch that does exactly that. Note the type: this is not a guider like the other two nodes in this pack. It takes a MODEL in and returns a MODEL out, wrapping it with a custom CFG post-function, so it slots into any ordinary KSampler (or into a guider's model input). It also lives in ComfyUI's _for_testing category, which is the author admitting it's experimental. Read it as a research prototype with a convenient handle.
How it works, straight from the source: each step it takes the guidance direction (cond − uncond), smooths it with a momentum term - a running average, default 0.5 - clamps its L2 norm with norm_threshold (default 15, set 0 to disable the clamp), then decomposes it with an orthogonal projection onto the conditional prediction. The final prediction is cond + (cfg − 1) × (orthogonal + eta × parallel). So eta (default 1.0) is the big knob: at 1 it's essentially ordinary CFG; at 0 you're running pure orthogonal guidance - prompt adherence from the sideways push only, which is the classic anti-saturation move. adaptive_momentum (default 0.18) decays the momentum over the later part of the schedule, so the accumulated direction doesn't keep slamming the sample at the end, where CFG overshoot hurts most.
The mode input picks whether the projection uses the raw predictions or the denoised ones ("normal" vs "denoised"); the code also carries a vpred branch for v-prediction checkpoints. momentum accepts negative values, which inverts the accumulated direction - an odd but occasionally useful trick you'll only discover by playing with it.
Inputs are minimal: model is the only required one, everything else is optional. That's the whole appeal - you drop it between your checkpoint and sampler, set eta to taste, and see whether high-CFG burn goes away without giving up adherence.
Install is the same as the rest of the pack: 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, no model downloads.
Where to be skeptical: this is a _for_testing node with effectively no community signal - zero impressions on this page, nothing to copy from. The pack author is candid that the math is a hand translation. Expect to spend an afternoon on settings if you want it to beat plain CFG, and keep expectations modest: the honest use case is "my image burns at CFG 7" → clamp the norm and drop eta, not a universal quality upgrade. If your model already runs fine at its natural CFG, this buys you nothing and adds a layer of mystery.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| momentumopt | FLOAT | 0.50-1–1 | — |
| etaopt | FLOAT | 1.000–1 | — |
| norm_thresholdopt | FLOAT | 15.00–50 | — |
| modeopt | COMBO | 2 options: normal, denoised | |
| adaptive_momentumopt | FLOAT | 0.180–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |