PerturbedAttnGuide [Multival] ππ π
PAG as a direct model patch, with maskable strength
- model
- scale_multival
- MODEL
Displayed as PerturbedAttnGuide [Multival], this patches Perturbed-Attention Guidance directly onto your model. If you've read about PAG elsewhere in this pack (ADE_CFGExtrasPAG, which chains through Sample Settings), this is the other way to get it: no Sample Settings object required, just drop it in after your checkpoint or model loader.
What PAG is actually buying you
Pushing CFG higher usually trades saturation and burnt contrast for better prompt adherence. PAG gets some of that adherence back through a different mechanism: it runs the model with a deliberately degraded version of its own self-attention (perturbed toward uniform), compares that prediction against the normal one, and uses the difference as an extra guidance term pushing toward more structurally coherent output. Since it's the review community, not this pack, that proved this technique out - the original PAG release thread on r/StableDiffusion scored well into the hundreds, with reports of cleaner compositions and better latent-upscale coherence at the cost of noticeably slower generation, since PAG runs an additional forward pass per step. That trade-off - real quality gain, real speed cost - carries over here.
This node vs. the CFG Extras version
ADE_CFGExtrasPAG returns a CFG_EXTRAS object built to chain into this pack's Sample Settings system, composable with other guidance adjustments like RescaleCFG via prev_extras. This node skips all of that: it takes your MODEL directly and hands back a patched MODEL, the same shape as ComfyUI's own native PerturbedAttentionGuidance node. The one real difference from that stock node is the type of scale: here it's a MULTIVAL, not a bare float, so it can be masked spatially or fed a schedule rather than staying one flat number for the whole run - though for most people, a single float value plugged into the Multival builder is all you'll actually use.
Pick this node if you're not otherwise building a Sample Settings chain - it's the fastest path to PAG on a straightforward AnimateDiff workflow. Pick the CFG_EXTRAS version if RescaleCFG or custom CFG keyframes are already part of your setup and you want PAG to combine cleanly with them.
Inputs and output
Both required:
model(MODEL) - the model to patch.scale_multival(MULTIVAL) - PAG's strength, built withADE_MultivalDynamic(a plain float, or masked for spatial variation). There's no separate layer/location selector on this node; it exposes strength only and leaves the rest to the pack's defaults.
Output is MODEL, the patched version - wire it into your KSampler the same way you would any other model-patching node.
How to install it
ComfyUI Manager: search AnimateDiff Evolved, confirm the author is Kosinkadink, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved
No model download for this node itself - it's a sampling-time technique, not a weights file.
Common issues & troubleshooting
Output gets muddier or over-smoothed instead of cleaner. PAG pushed too hard can flatten fine detail the same way any guidance term can when overdone - start at a modest scale and increase gradually rather than assuming higher is strictly better.
Generation is noticeably slower. Expected - PAG runs an extra forward pass through the model's attention per step. If that cost isn't worth it for a given run, it's fine to skip PAG entirely rather than force it in.
Using this and ADE_CFGExtrasPAG at the same time. That's stacking two copies of the same guidance term - redundant at best, and likely to push you into the over-smoothed failure mode above faster than either alone. Pick one path.
No visible effect at all. Confirm the patched MODEL output is actually the one reaching your KSampler - if you wired a different, unpatched model into the sampler by mistake, this node's output is simply never used.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | β | |
| scale_multival | MULTIVAL | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | β |