Attention: Sage 3 (Blackwell)
Sage 3 attention on your RTX 50-series, without leaving stock ComfyUI
- model
- MODEL
If you've got an RTX 50-series card, this is the node that finally lets SageAttention 3 do its thing inside plain, stock ComfyUI flows. No wrapper model, no custom sampler, no fork. It's one tiny switch that swaps the attention math under everything downstream. The name is accurate for once: this is strictly Sage 3 (Blackwell), not a fallback chain.
What it actually is
By now you know SageAttention - it's the memory-efficient attention kernel that the Wan and Hunyuan crowd treat as mandatory for video. Sage 3 is THU-ML's third generation, and it's a Blackwell-only affair: it targets the RTX 50-series specifically, leaning on those cards' fp4/NVFP4 paths for what the paper claims is a big step over SageAttention 2's speedup. The catch that made this node exist: stock ComfyUI doesn't expose Sage 3 through its normal --use-sage-attention flag (that's Sage 2), so getting Sage 3 into an official workflow meant wrangling it in yourself.
wallen0322 - who you may know from ComfyUI-Wan22FMLF and various Wan workflows - solved it the dirty way that works: a monkeypatch. The node replaces torch.nn.functional.scaled_dot_product_attention with sageattn3.api.sageattn3_blackwell for the whole session, then hands your MODEL straight back. It's marked "experimental" in the README, and it should be - this is a single-utility pack, not a framework.
How it works
Drop it between your model loader and your sampler, pass MODEL through, flip enable=True, and every SDPA call from that point on runs the Sage 3 Blackwell kernel. A few things worth knowing from reading the source:
- The patch is global, not per-model. Enabling it patches
F.scaled_dot_product_attentionprocess-wide. If you're batching multiple models in one session, they all get Sage 3 whether you asked or not. Toggleenable=Falseto restore the original torch implementation. - The shim is blunt. It ignores the attention mask, causal flag, dropout, and scale that SDPA would normally respect, and casts fp32 tensors down to fp16 for the kernel (then back up). For standard diffusion attention - which is almost always full, unmasked attention - that's fine in practice. If your workflow depends on masking, test before trusting it.
- If
sageattn3isn't installed or importable, enabling the node raises aRuntimeErrorwith the underlying import error, so you'll know exactly why it died.
The inputs that matter
Only three, and two of them are obvious:
model- yourMODEL, wired in from the loader and passed through untouched.enable- defaultTrue. On enables the patch; off removes it and restores stock SDPA.print_backend- defaultTrue. Prints[SageAttention3] Using: sageattn3.api.sageattn3_blackwell(or the disabled message) to the console so you can confirm the patch took.
Output is one MODEL, which you feed into your sampler exactly as before.
Installing it
ComfyUI Manager users can search "ComfyUI-SageAttention3". Otherwise:
cd ComfyUI/custom_nodes
git clone https://github.com/wallen0322/ComfyUI-SageAttention3
The pack's own requirements.txt is a single line - sageattn3>=1.0.0 - but that's the heavy part. The README points you at pip install sageattn3, and if no wheel matches your setup, you're building it from the thu-ml/SageAttention repo's sageattention3_blackwell directory, which needs a CUDA 12.8+ toolkit and a matching PyTorch build. Expect pip-resolver fun here; Blackwell PyTorch wheels (cu128/cu130) are notorious for fighting other packages.
Where people get burned
- No Blackwell GPU, no dice. The
_blackwellsuffix isn't decorative. On a 30/40-series card the kernel won't run - this node gives you nothing that plain SageAttention 2 doesn't, and it won't fall back gracefully. - The wrong PyTorch build. Sage 3 needs a CUDA 12.8+ torch wheel. If you're on cu121, the wheel install or the source build will fail before the node ever loads.
- Global patch surprises. Because the swap is process-wide, a disabled node in one workflow doesn't un-patch a workflow you already ran - restart ComfyUI or toggle the node to be sure of a clean state.
For RTX 50-series owners running long Wan or FLUX pipelines, this is the genuinely fast path to Sage 3 in stock ComfyUI. Everyone else: it's a peek at where the attention kernel race is heading.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| enable | BOOLEAN | true | — |
| print_backend | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |