Smoothed Energy Guidance (Advanced)
PAG's softer, more tunable sibling
- model
- MODEL
If Perturbed-Attention Guidance is the blunt version - swap self-attention for a hard perturbation and guide away from the mess - Smoothed Energy Guidance is the dial-in version. It's built from Susung Hong's "Smoothed Energy Guidance: Guiding Diffusion Models with Reduced Energy Curvature of Attention," and instead of a hard perturbation, SEG blurs self-attention by a controllable amount before computing the guidance term. Same family of trick as PAG - degrade a copy of the prediction and push away from it - but blur strength is a dial instead of an on/off switch, which is why the node exposes a field the plain PAG node doesn't.
The inputs that matter
scale(default 3) - same role as everywhere in the pack: how hard you push away from the degraded (here, blurred) prediction.blur_sigma(default -1) - the SEG-specific knob. Per the README, it's the standard deviation of the Gaussian blur applied to attention: higher values increase image "clarity," and negative values set it to infinity - meaning the default is already at maximum blur strength, not a neutral or off state. If you want a gentler SEG effect than the out-of-the-box behavior, you need to set this to a positive finite number, not leave it at default.unet_block/unet_block_id(defaultmiddle,0) - which UNet layer gets the blurred-attention treatment. Same convention as PAG.sigma_start/sigma_end(both -1) - restrict SEG to a noise window; -1/-1 means the whole denoise.rescale/rescale_mode(0 /full) - the same anti-oversaturation valve as PAG:fullweighs CFG and SEG together,partialonly SEG,snfuses saliency-adaptive noise fusion and ignores therescalenumber.- Optional
unet_block_listoverrides the single-block fields with the pack's compact multi-block syntax.
Output is a MODEL, wired straight into your sampler like the rest of this pack.
How to install it
ComfyUI Manager: search "Perturbed-Attention Guidance" (this node ships in that pack, not separately). 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
It's doing the maximum thing by default and you didn't realize it. blur_sigma = -1 isn't "off" - it's infinite blur, the strongest setting the node has. If SEG feels too aggressive out of the box, don't reach for scale first; drop in a positive finite blur_sigma (start somewhere moderate and work down) to soften the effect at its source.
Oversaturated or fried output at higher scale. Same fix as everywhere else in this pack: turn on rescale (start around 0.5–0.7) or try rescale_mode: snf, which is specifically pitched at high-guidance-scale quality.
No visible effect. Check the sigma window and the block target before assuming SEG isn't working - the defaults (middle block, always-on) should produce a visible effect at scale 3+ on SD1.5/SDXL, so if you're seeing nothing, verify the model patch is actually landing before the sampler in your graph (it needs to be between your checkpoint/LoRA loaders and the KSampler, not after).
Unsure whether to reach for this or plain PAG. There isn't a documented community verdict on which wins - SEG is genuinely the less-discussed of the two. If you already have a PAG setup you like, SEG's main selling point is the tunable blur_sigma giving you a softer middle ground between "no perturbation" and PAG's harder swap; worth an A/B on your own images rather than assuming one is strictly better.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| scale | FLOAT | 3.00–100 | — |
| blur_sigma | FLOAT | -1.00-1–9999 | — |
| unet_block | COMBO | middle | 3 options: input, middle, output |
| unet_block_id | INT | 0 | — |
| sigma_start | FLOAT | -1.00-1–10000 | — |
| sigma_end | FLOAT | -1.00-1–10000 | — |
| rescale | FLOAT | 0.000–1 | — |
| rescale_mode | COMBO | full | 3 options: full, partial, snf |
| unet_block_listopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |