Apply SageAttention
The free-ish speedup, if you can install it
- model
- MODEL
This is the simplest node in the whole ComfyUI-Lightning pack, and also the one most likely to fight you before it helps you. Apply SageAttention swaps your model's attention computation for SageAttention's quantized attention kernels - same math, less precision where it doesn't matter, and a real speed bump when it's actually running. The catch, and it's a real one, is that "when it's actually running" is doing a lot of work in that sentence.
What it is and why you'd use it
Attention is the part of a diffusion transformer that spends the most time doing matrix multiplication, and SageAttention (from the same lineage as SpargeAttn, both out of thu-ml) speeds it up by quantizing the attention computation to INT8-ish precision instead of doing it in full fp16/bf16. It's not free - you're trading a sliver of numerical precision - but for image and video diffusion the community's consensus is that the quality hit is basically invisible while the speedup is not. This is one of the three techniques (alongside TeaCache and torch.compile) that people habitually stack together to make Wan and Flux tolerable on consumer GPUs.
How it works
The node patches your loaded model so its attention layers route through SageAttention's kernel instead of PyTorch's default (or ComfyUI's own optimized) attention. It's a swap-in, not a training-time change - nothing about your checkpoint changes, only how the forward pass computes attention at each step.
The inputs and outputs that matter
There are exactly two things to know here:
model- your loaded diffusion model, wired in from a checkpoint/UNet/diffusion-model loader.use_SageAttention(boolean, defaulttrue) - the whole node is a toggle. Flip it off and the node becomes a no-op passthrough, which is handy for A/B testing without rewiring your graph.
Output is a patched MODEL - send it straight into your sampler chain, or into the next Lightning node (FBCache, TeaCache, torch.compile) if you're stacking accelerations.
How to install it
The node pack itself installs the normal way:
- ComfyUI Manager - search "ComfyUI-Lightning", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/shenduldh/ComfyUI-Lightning, then restart.
That's the easy part. SageAttention itself is a separate install, and it's the part that generates support threads. It needs Triton, which on Linux is a pip install and on Windows is genuinely painful - matching CUDA toolkit version, CUDA_HOME environment variables, Visual Studio Build Tools, and a torch build that all agree with each other. If any of those are off by a version, the build fails with an error that doesn't obviously point back at "wrong Triton/CUDA/torch combo."
Common issues & troubleshooting
The node runs but nothing gets faster. If SageAttention isn't actually installed (or Triton failed silently), the node likely falls back to normal attention rather than crashing - check your console log for whether SageAttention actually loaded, not just whether the workflow completed. People report toggling this on, seeing no speed change, and the word "sageattention" never appearing anywhere in the console - that's the tell that it silently didn't engage.
Build fails with a CUDA/Triton error on Windows. This is the single most common complaint around SageAttention, full stop. The fix path that consistently works: install a pre-built Triton wheel for Windows instead of compiling from source, make sure your CUDA toolkit version matches what your PyTorch build expects, and don't mix a nightly PyTorch with a stable-only CUDA path. There are community install scripts that automate this end to end - worth using one rather than fighting the manual steps yourself.
Old GPU, no speedup. SageAttention leans on newer hardware features. If you're on an older card, don't expect the same win people report on 30-series and up.
It's not saving VRAM the way you expected. SageAttention's main win is speed, not memory. If you're VRAM-constrained, this node isn't your lever - quantizing the model itself (fp8/GGUF) is.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| use_SageAttention | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |