Nodes/CFG Megapack/FBG: Feedback Guidance (Koulischer et al. 2025)
ComfyUI Node

FBG: Feedback Guidance (Koulischer et al. 2025)

FBG picks your CFG for you every step — and ignores your KSampler's

By AbstractEyes·Created 5 days ago·Updated 5 days ago· 3
FBG: Feedback Guidance (Koulischer et al. 2025)
  • model
  • MODEL
◄scale-1.0►
◄hybridfalse►
◄pi0.850►
◄t00.75►
◄t10.50►
◄lambda_max10.0►
◄spaceauto (the method's own)►

Everybody who has tuned CFG knows the shape of the problem: one number has to serve the whole run, even though the early steps are deciding layout and the late steps are deciding texture. Feedback Guidance (Koulischer, Handke, Deleu, Demeester & Ambrogioni, NeurIPS 2025) throws the number out. It decides the scale at each step from a running estimate of how well the sample already matches the prompt - push hard while the image is still wrong, ease off to almost nothing once it's right.

The mechanism, briefly

Think of it as a bet the node keeps updating. It carries a log posterior L over "this sample is conditional", starting at zero, and converts it to a scale as lambda = e^L / (e^L - (1 - pi)). After each step it nudges L using the difference between the sample's squared distance to the conditional mean and to the unconditional mean - closer to the conditional, L goes up, the scale falls. So the guidance self-damps over the run instead of following a schedule you wrote.

It is genuinely stateful, which matters below.

The inputs that matter

  • scale - appears on the node like every other paper node, and is only used when hybrid is on. -1 means the sampler's cfg. With hybrid off, the KSampler's cfg is ignored entirely.
  • hybrid - adds plain CFG's (w - 1) on top of FBG's own scale. Turn it on when FBG alone comes out under-guided for your taste; then the KSampler cfg becomes a real knob again.
  • pi - the prior that the sample is conditional. 0.85 here, which is the paper's value for its Stable Diffusion images; the paper's reference code ships 0.95. t0 and t1 are the two calibration points (0.75 and 0.5 here, versus 0.5 and 0.4 in the code), and lambda_max caps the scale at 10.

Those four are the whole tuning surface, and the pack deliberately starts them at the paper's image settings rather than its code defaults, because on SDXL the code defaults leave the first steps nearly unguided and the image washes out. If you go reading the repo and "correct" the node back to 0.95 / 0.5 / 0.4, that's the result you'll get.

space can stay on auto; -1 and the rest of the model default is the behaviour you want.

Output and wiring

One output: MODEL. Chain it between the checkpoint and the KSampler like every other node in the pack:

Load Checkpoint → FBG: Feedback Guidance → KSampler

Installing it

ComfyUI Manager → search CFG Megapack → install → restart. Or comfy node install comfy-cfg-megapack. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/AbstractEyes/comfy-cfg-megapack

Restart, and the nodes appear under the CFG Megapack menu folders. No requirements.txt, no model downloads, no extra dependencies - torch and ComfyUI's own node API. Optional: CFG_MEGAPACK_VRAM_FRACTION=0.6 before launching caps the pack's share of GPU memory on a busy card.

Traps worth knowing before you blame the node

  • "Nothing changed." You set cfg 7 on the KSampler and FBG ignored it, because hybrid is off and FBG sets its own scale. This is the number one gotcha with this node.
  • It's stateful, so a second sampling pass starts over. The runtime resets per-run state whenever sigma rises, which is how it knows a new run began. A two-pass hires-fix style workflow is not one continuous run of FBG; don't read the second pass as a continuation.
  • It is driven from the previous step's signal. The pack's implementation reads the latent and sigma as it goes, which is the intended use for ordinary single-stage samplers. If your sampler isn't simple, expect rough behaviour rather than a crash.
  • Chaining order inside the pack doesn't matter - the stages always run in the fixed order (when, weak branch, combine, where, correct, govern, measure), so a combine node is a combine node wherever you drop it. But another pack's CFG-function node (RescaleCFG, Mahiro, RenormCFG) chained after this one takes ComfyUI's single CFG-function slot and silently wins.
  • It doesn't multiply your render time. Unlike the weak-branch nodes that run the model an extra time, FBG costs two squared-distance sums per step. It costs you predictability, not speed.

Also worth a look: the Per-Step Probe node, which writes the scale FBG actually used, step by step, into output/cfg_probe/. Tuning a node that hides its own scale is much less fun without it.

CategoryCFG Megapack/papers/combining the two predictions

Inputs (8)

NameTypeDefaultDescription
modelMODEL—
scaleFLOAT-1.0-1–100The guidance scale w for this rule. -1 uses the sampler's cfg value.
hybridBOOLEANfalseAdd the sampler's plain CFG (w - 1) on top (FBG + CFG).
piFLOAT0.8500.5–0.999Prior that the sample is conditional (the paper's Stable Diffusion images 0.85; its code's default 0.95).
t0FLOAT0.750–1Noise level where the scale should reach its target (paper SD images 0.75; code 0.5).
t1FLOAT0.500–1Second calibration point (paper SD images 0.5; code 0.4).
lambda_maxFLOAT10.01–50Highest scale.
spaceCOMBOauto (the method's own)Where the rule is computed. Linear rules give the same image in any space; nonlinear ones do not. 'auto' uses the space the method was published in (noise for most, denoised for APG and the angle rule, velocity for flow models).

Outputs (1)

NameTypeDescription
MODELMODEL—