VRAM & CUDA Tuning
SageAttention vs FlashAttention-2 Speedup in Flux & Wan2.2
Benchmark INT8-quantized QK attention in SageAttention (--use-sage-attention) versus FlashAttention-2 and PyTorch SDPA on L4 and L40S.
1.8x-2.3x Video Speedup · -14% Activation VRAM · Ada/Ampere
Why Video Diffusion Sees Massive SageAttention Gains
Wan2.2 spatiotemporal attention processes tens of thousands of tokens across 81 frames. SageAttention quantizes Q*K^T matrix products to INT8 on Tensor Cores, nearly doubling throughput.
CUDA 12.4 & Triton Compatibility
Install triton and sageattention inside a CUDA 12.4 + PyTorch 2.5 environment and pass --use-sage-attention in comfyui-launch.sh.
Measured Thresholds & ComfyUI Configuration Matrix
| Attention Backend | Flux.1 1024x1536 Speed | Wan2.2 720p 81f Speed |
|---|---|---|
| PyTorch SDPA (Default) | 1.00x baseline | 1.00x baseline |
| FlashAttention-2 | 1.18x faster (-8% peak VRAM) | 1.28x faster |
| SageAttention (--use-sage-attention) | 1.35x faster (-14% peak VRAM) | 1.95x-2.30x faster |