Piper Attention
A zero-knob attention swap for 30-, 40-, and 50-series NVIDIA
- model
- model
Piper Attention is a model patch node with exactly one job: take the MODEL your loader hands it, and make every compatible attention call inside that model run through a custom Triton kernel instead of whatever ComfyUI picked. MODEL in, MODEL out, no widgets, no settings. It's the first node from Boffee's piper-nodes pack - the ComfyUI front door to the piper-kernels inference library - and it shipped only in August 2026, so this is early-adopter territory.
Why reach for it? Attention is where a diffusion model spends a big chunk of its compute, and swapping the attention kernel is the classic speed lever - the same idea behind SageAttention, xformers, and ComfyUI's own flash-attention options. Piper Attention is the opinionated version: no backend dropdown, no precision flags. It claims every attention call it's confident about, and silently hands everything else back to the attention implementation ComfyUI had already selected. If the kernel doesn't apply, you get the exact rendering you'd have gotten anyway - just no speedup.
How it works
Under the hood it clones the model patcher and installs an optimized_attention_override - the same seam ComfyUI itself and Kijai's nodes use for attention swapping. Every attention call then passes through a gate that checks, in order:
- NVIDIA CUDA with compute capability major 8 (SM8x - RTX 30- and 40-series, A100) or major 12 (SM12x - RTX 50-series). Anything else, including AMD, is a no-op.
- fp16 or bf16 dtype, head dimension 64 or 128 (the SD-lineage and Flux-style sizes), no attention mask, no grouped-query attention, low-precision attention enabled, not in training.
If all checks pass, it reshapes the tensors from B×L×(H·D) to B×H×L×D, calls the piper_attention kernel, and reshapes back. Anything else falls back. Two details worth knowing: kernel execution errors are deliberately not swallowed, so a real kernel bug surfaces as a real error instead of a silent slowdown - which is honestly nicer for debugging; and if another model node already installed an attention override, Piper preserves it as the fallback instead of clobbering it, so attention patches compose rather than fight.
The inputs that matter
There are two sockets, and that's the whole node:
model(MODEL, required) - wire in from your loader or any prior patch node.- Output
model(MODEL) - wire into your sampler, or whatever else consumed the model.
Because it patches a clone of the patcher, the loader's output stays untouched. That makes A/B testing trivial: run one sampler branch through Piper and one straight from the loader, lock the seed, and you'll see exactly what the kernel is buying you.
How to install it
Easiest is ComfyUI Manager - search the pack title "piper-nodes". The documented manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/Boffee/piper-nodes
cd piper-nodes && python -m pip install -r requirements.txt
...using ComfyUI's Python, then restart. That one requirements line, piper-kernels[triton], is the whole dependency tree: it pulls Triton, and on Windows it resolves to the community-maintained triton-windows wheels. Two gotchas to brace for: the pack insists on Python 3.13+, so if your ComfyUI embed is on 3.11/3.12 the pip install dies at the resolver; and it's NVIDIA-only by design - an AMD or Intel GPU gets a node that quietly does nothing.
Common issues
- "Did it even do anything?" Silent fallback means you can't tell from the output. Anything with a mask or grouped-query attention won't use the kernel, and that's correct behavior, not breakage.
- A subtle quality shift on some models. Kernel attention isn't always bit-identical to the reference path, and the community has documented at least one model family (Z-Image Base) that degrades badly under Sage-family attention. If a render looks subtly off with the patch in, bypass the node and compare on a fixed seed before you blame your prompt.
- Nothing installs. Python version, as above - check with
python --versionbefore you clone.
If you're on a 40- or 50-series and want the kernel the video crowd actually talks about, the pack's other node - Piper SageAttention2++ - does the same job with SageAttention2's backend and a newer-GPU requirement.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |