ComfyUI Node

PLADIS

Sparser attention at inference, no retraining involved

By pamparamm·Created 2 years ago·Updated 5 months ago· 299
PLADIS
  • model
  • MODEL
scale2.0
sparse_funcentmax1.5
unet_block_list

Softmax attention spreads weight across every token, even the ones that shouldn't matter much for a given patch of the image. PLADIS - "Pushing the Limits of Attention in Diffusion Models at Inference Time by Leveraging Sparsity" - swaps that out for a sparse alternative at inference time, no retraining or fine-tuning required. The idea is that a sparser attention distribution lets the model actually commit to the tokens that matter for a given region instead of diluting attention across everything, which the paper argues buys a real quality gain for free.

The inputs that matter

  • scale (default 2) - guidance strength, same general role as scale on the pack's other nodes.
  • sparse_func (default entmax1.5) - a dropdown of sparse attention functions to swap in for standard softmax. entmax1.5 is a real, established sparse-softmax variant (from the entmax family), which produces attention distributions that can go genuinely to zero on irrelevant tokens instead of just getting small - that's the actual mechanism behind "leveraging sparsity" in the paper's title.
  • Optional unet_block_list - worth reading closely, because PLADIS's default scope is different from its podmates. Per the tooltip: "when the list is empty, PLADIS is being applied to all u and d blocks" - that's every output and input block, not just middle the way PAG and SEG default to. Out of the box, PLADIS has a noticeably broader footprint across the UNet than its siblings.

Output is a MODEL, wired into your KSampler like everything else here.

One real gap worth flagging plainly: unlike PAG, SEG, NAG, and TPG in this same pack, PLADIS has no sigma_start/sigma_end fields in its schema. There's no built-in way to restrict it to part of the denoise - it's either patched in for the whole run or not patched in at all.

How to install it

ComfyUI Manager: search "Perturbed-Attention Guidance" - PLADIS ships inside that pack. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/pamparamm/sd-perturbed-attention

Restart afterward. No model downloads, no extra Python dependencies.

Common issues & troubleshooting

This is one of the newer, quieter nodes in the pack - there's no meaningful community discussion of it yet, so the following is grounded in the schema and the mechanism rather than field reports.

It feels heavier or slower than PAG. That's plausibly the default block scope talking - PLADIS touches all u and d blocks by default, versus PAG's single middle block. If you want a lighter footprint, set unet_block_list explicitly to a narrower set of blocks rather than leaving it empty.

You want it active for only part of the sampling process. You can't, at least not through this node - there's no sigma window exposed. If step-range control matters to you, that's a real distinguishing limitation versus PAG/SEG/NAG in the same pack, not an oversight on your part.

Not sure which sparse_func to pick. The schema exposes it as a dropdown but the default, entmax1.5, is the one named in the paper's own framing and is a reasonable place to start and stay unless you have a specific reason to explore the alternatives.

Categorymodel_patches/unet

Inputs (4)

NameTypeDefaultDescription
modelMODEL
scaleFLOAT2.00–100
sparse_funcCOMBOentmax1.52 options: entmax1.5, sparsemax
unet_block_listoptSTRINGComma-separated blocks to which Pladis is being applied to. When the list is empty, PLADIS is being applied to all `u` and `d` blocks. Read README from sd-perturbed-attention for more details.

Outputs (1)

NameTypeDescription
MODELMODEL