RDNA3 Flash Attention
The fused attention your 7900 XTX has been missing
- model
- model
If you're generating on a Radeon RX 7900 XTX, this is the single most interesting node to hit ComfyUI in a while. AMD's official flash-attention backend ships CDNA-only kernels, and the AOTriton path in PyTorch is still gated behind an experimental env flag - so a stock ComfyUI on RDNA3 runs the non-fused math attention path, materializing the full seqlen × seqlen score matrix in VRAM. That's the slow way, and it's the way you've been generating this whole time. ApplyRDNA3FlashAttention swaps in a real FlashAttention-2 Triton kernel tuned for your card.
The node is a thin front-end on fa-rdna3, a genuinely deep kernel project by chelokot (MIT-licensed, with backward, split-K decode, and paged-KV variants that don't even touch ComfyUI). Through the actual ComfyUI tensor-layout adapter on a 7900 XTX, the README measures self-attention at 1.84 ms versus 14.4 ms for the stock path - about 7.8× - and cross-attention at 4.75×. Those are per-call numbers, not end-to-end generation speedups; the win compounds the more attention calls you have, which is exactly the long-context, high-resolution regime where the quadratic path hurts most.
How it works
FlashAttention-2 tiles the attention computation and keeps a running online softmax, so the score matrix is never materialized. What makes this one RDNA3-specific: autotuned block sizes sized for the card's 32-lane WMMA fragments and 64 KB LDS limit, num_stages=1 (RDNA3 has no cp.async, so deep pipelining costs LDS for nothing), and a hard requirement on gfx1100 - the 7900 XT/XTX/GRE.
Under the hood, patch() clones your model and sets ComfyUI's per-model optimized_attention_override (the same mechanism SageAttention and friends use), then installs a process-wide scaled_dot_product_attention dispatcher for model components that call PyTorch directly. Anything the kernel doesn't support - dropout, head dims above 512, non-gfx1100 GPUs - falls back to the original implementation, and existing attention overrides stay outermost and delegate to the RDNA3 backend.
The one input that matters
This is as close to a zero-config node as ComfyUI gets:
model(MODEL, required) - the model from your checkpoint or diffusion-model loader.model(MODEL, output) - the same model, patched. Wire it straight into your sampler.
That's it. No optional inputs, no toggles, no resolution choices. Drop it between the loader and the sampler and go.
Installing it
The prerequisite is a working ROCm build of PyTorch 2.8+ (with its matching pytorch-triton-rocm). fa-rdna3 deliberately declares no dependencies, so neither pip nor ComfyUI Manager will replace your working ROCm stack with generic CUDA-flavored wheels - which is a feature, not an oversight. The verified stack in the README is PyTorch 2.9.1 for ROCm 6.4, Triton 3.5.1 on gfx1100.
cd ComfyUI/custom_nodes
git clone https://github.com/chelokot/flash-attention-rdna3.git RDNA3-Flash-Attention
Restart ComfyUI (0.4.0 or newer required), and the node appears under model_patches/attention. You don't need --use-pytorch-cross-attention - the per-model override handles it.
Where people get burned
- It is 7900-series only. Non-
gfx1100cards get a clear runtime error, not silent wrong output - but on a 6700 XT or 7800 XT this node does nothing for you. - The first generation on a new shape is slow - it compiles and caches that shape's Triton specialization. Subsequent runs are the fast ones. Don't judge it on the first call.
- Conflicting backend selectors. If you have another backend node that sets an override without delegating (a SageAttention selector is the usual culprit), it keeps precedence - remove it and let RDNA3 handle the call.
- NVIDIA? No. This is ROCm-only, and it checks for a ROCm build of PyTorch at patch time.
If you're on a 7900 XTX and attention has always felt like the weak link in your ComfyUI setup, this is the node that fixes it - the gap it fills is real, the benchmarks are reproducible, and it falls back gracefully when it can't help. Long-context and high-res workflows on RDNA3 have never been in a better place.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |