Nodes/ComfyUI-LTXVideo/LTX Apply Perturbed Attention
ComfyUI Node Runs on cloud

LTX Apply Perturbed Attention

Cleaner structure without a negative prompt

By Lightricks·Created 2 years ago·Updated about a month ago· 3,956
LTX Apply Perturbed Attention
  • model
  • attn_override
  • MODEL
scale2.00
rescale0.50
cfg3.00

This is LTX's take on Perturbed Attention Guidance (PAG), a technique that improves the structural coherence of a generation without you having to write a negative prompt. It's a cousin of the STG stuff in the pack - same family of "run a degraded version of the model and steer away from it" - but the degradation here comes from perturbing self-attention specifically. When LTX output has that slightly-melty, structure's-not-quite-right look, this is one of the levers that firms it up.

How it works

PAG creates a deliberately weakened prediction by messing with the model's self-attention - roughly, it blinds the model to some of its own spatial reasoning - and then guides the sample away from that weak prediction. Because the weak version is bad at structure, steering away from it pushes toward better structure. The nice part is it doesn't need a negative prompt to work; the perturbed pass is the thing you're avoiding. This node patches the model with that behavior and passes it on to your sampler.

The inputs and output

  • scale (default 2) - how strongly you steer away from the perturbed prediction. This is your main strength dial.
  • cfg (default 3) - the guidance scale used alongside PAG.
  • rescale (default 0.5) - a correction that pulls the result back toward a sane range so strong guidance doesn't oversaturate. Leave it near the default unless colors start blowing out.
  • attn_override (optional) - advanced targeting of which attention layers get perturbed. Skip it unless you're deliberately tuning layer selection.

Output is the patched MODEL.

Installing it

  • ComfyUI Manager - search LTXVideo, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Lightricks/ComfyUI-LTXVideo, then restart.

No download of its own - it's a patch on the loaded model.

Common issues

Output oversaturated or contrast-crushed. Too much guidance. Bring scale down, and if colors are still cooked, lean on rescale - that's exactly what it's there to fix. The default 0.5 is a starting point, not a law.

It slowed generation down. PAG runs an extra model pass to produce the perturbed prediction, so it costs compute, same as any guidance-doubling technique. On LTX that's usually still fast, but it's not free - decide whether the structure gain is worth it for a given shot.

It's stacking badly with STG or FETA. All three are attention-level "make it better" tricks and piling them on at full strength gets muddy. Add one at a time, and if you're already running STG for structure you may not need PAG on top - pick the one that's actually earning its place.

Categoryltxtricks/attn

Inputs (5)

NameTypeDefaultDescription
modelMODEL
scaleFLOAT2.000–100
rescaleFLOAT0.500–100
cfgFLOAT3.000–100
attn_overrideoptATTN_OVERRIDE

Outputs (1)

NameTypeDescription
MODELMODEL