SMC-CFG
Control theory grafted onto classifier-free guidance
- model
- MODEL
This is the newest and most academically fresh node in the pack - an implementation of "CFG-Ctrl: Control-Based Classifier-Free Diffusion Guidance," a paper that dropped with code in March 2026 and got a genuinely substantial reddit thread out of it (+157, the author showing up in the comments to confirm it's meant to generalize beyond SD1.5/SDXL). Sliding mode control is a real, decades-old idea from control-systems engineering: instead of steering a system smoothly toward a target, you define a "sliding surface" and drive the system onto it and along it. SMC-CFG reframes CFG guidance the same way - the two knobs on this node are, almost literally, "shape of the surface" and "force pushing you onto it."
Reaction to the underlying method was interested but appropriately skeptical. The best-scoring reply to the announcement wasn't a rebuttal, it was a methodology reminder: run a real batch of generations per setting and count how many actually show improved prompt adherence, rather than eyeballing one before/after pair and mistaking a luckier seed for a real gain. That's good advice for tuning this node specifically, since both its parameters are unusually sensitive to bad luck on a single sample.
The inputs that matter
Both fields ship with tooltips quoting the paper's own validated ranges - treat those ranges, not the slider's full range, as where you should actually be experimenting:
lambda(default 6, slider goes to 100) - "shape hyperparameter of the sliding mode surface. Too high/low values may lead to guidance instabilities." The paper itself only tested 2.0 to 8.0 - the default of 6 sits comfortably inside that, but the slider will happily let you set 80, which the paper never validated and which the tooltip explicitly warns against.k(default 0.1, slider goes to 2) - "force hyperparameter, controls the force towards the sliding mode surface. Low values may weaken text-image alignment but increase overall realism/aesthetic." Paper-tested range is 0.01 to 0.8. This is a genuine trade-off knob, not a "more is better" one - pushing it up tightens prompt adherence at the cost of the more photoreal, less "guided" look you get lower.
Output is a MODEL, wired straight into your KSampler.
The README lists this node as "not limited to SD1.5/SDXL," and reddit texture on the paper backs that up - one commenter on the announcement thread specifically reported it applying to Wan 2.1/2.2 image-to-video, though that's community testing of the underlying method rather than a claim about this exact ComfyUI implementation.
How to install it
ComfyUI Manager: search "Perturbed-Attention Guidance" - SMC-CFG ships inside that pack, not as a separate registry entry. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/pamparamm/sd-perturbed-attention
Restart ComfyUI. No models to download, no extra dependencies.
Common issues & troubleshooting
Guidance instability at higher settings. Both tooltips warn about this directly. If output is degrading rather than improving as you raise lambda or k, you've likely wandered outside the paper's validated ranges (2.0–8.0 for lambda, 0.01–0.8 for k) - pull back into those bands before concluding the node doesn't work for your use case.
Prompt adherence gets worse as realism improves, or vice versa. That's k doing exactly what its tooltip says - it's a real trade-off, not a bug. If you need tighter adherence, accept a bit more of the "guided" look; if you want more photoreal output, accept some looser adherence.
You compared one image with and without it and weren't impressed. Per the community's own strongest objection to this method: a single-seed comparison doesn't tell you much. If you want a real read on whether this is helping your workflow, generate several seeds at a fixed setting and actually count how many improved, rather than judging off one pair.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| lambda | FLOAT | 6.00–100 | Shape hyperparameter of the sliding mode surface. Too high/low values may lead to guidance instabilities. Values from range [2.0, 8.0] were used in the original paper |
| k | FLOAT | 0.100–2 | Force hyperparameter, controls the force towards the sliding mode surface. Low values may weaken text-image alignment but increase overall realism/aesthetic. Values from range [0.01, 0.8] were used in the original paper |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |