ArtificialGuyBR

Home / Blog / AI video

Faster Local Video with SageAttention & TeaCache

Compare five acceleration techniques for ComfyUI video workflows — benchmarks, trade-offs, and install steps for each method.

4 sources cited AI video

Faster Local Video with SageAttention & TeaCache

Generating video locally on a consumer GPU still takes minutes per clip. Five techniques — SageAttention, TeaCache, Triton, quantisation, and step-distilled models — each attack a different bottleneck. This guide summarises what each method does, the measured speedups, the quality trade-offs, and the exact install steps that work on Windows and Linux.

TL;DR


How Much Faster Is SageAttention Compared to FlashAttention?

The SageAttention paper reports 2.1× higher throughput than FlashAttention-2 and 2.7× over xformers on attention kernels. End-to-end on CogVideoX-1.5-5B (H20 GPU): FlashAttention-2 takes 25 min 34 s, FlashAttention-3-FP8 takes 12 min 14 s, and SageAttention finishes in 12 min 7 s. On an RTX 5090, SageAttention 3 hits 1,038 TOPS — a 5× kernel speedup over the fastest FlashAttention build. The library provides four versions; V2.2.0 bundles V2++ and is the recommended starting point. For VRAM implications of quantized attention on consumer GPUs, see VRAM Requirements for Image and Video Models.

Source: SageAttention repo, ICLR 2025 paper (arXiv:2410.02367), NeurIPS 2025 Spotlight paper (arXiv:2505.11594).

What Threshold Should I Use for TeaCache?

TeaCache skips denoising steps whose timestep embeddings resemble a previously computed step. The teacache_thresh parameter controls sensitivity:

Model / TaskBaselineThreshold 0.05Threshold 0.13–0.26Threshold 0.30Source
Wan2.1 T2V 1.3B~175 s~117 s~88 sTeaCache README
Wan2.1 I2V 480P~385 s~241 s (0.13)~156 s (0.26)TeaCache README
Wan2.1 I2V 720P~903 s~476 s (0.20)~363 s (0.30)TeaCache README

Lower thresholds preserve quality but give less speedup. The use_ref_steps flag adds a second speed boost with slightly better fidelity (except on T2V 1.3B). All figures are from the official TeaCache-for-Wan2.1 README on A800.

Source: https://github.com/ali-vilab/TeaCache/blob/main/TeaCache4Wan2.1/README.md

Does SageAttention Work with Wan2.1?

Yes. The SageAttention README demonstrates CogVideoX and the authors note it works across language, image, and video models. For video DiTs, the maintainers recommend replacing attention only inside the DiT block, not globally overriding F.scaled_dot_product_attention. A ComfyUI workflow combining SageAttention and TeaCache for Wan2.1 I2V 720P circulates on Civitai, but the combined speedup (54 % faster, 542 s → 248 s on RTX 4090, 33 frames, 20 steps) comes from a single community benchmark — no official combined numbers exist. For the newer Wan 2.2 MoE architecture, see Wan 2.2 High Noise vs Low Noise LoRA Workflow.

Source: SageAttention repo usage notes; Civitai article #12250 (community benchmark).

How Do I Install Triton and SageAttention on Windows?

SageAttention 2.2.0 no longer requires Triton at runtime, but V1 and the build process do. The Civitai community distributes a two-batch-file installer for ComfyUI Portable (Python 3.12) that pulls CUDA 12.8 toolkit and builds Triton. Official requirements are more permissive:

GPU archMinimum CUDA
Ampere (RTX 30-series)12.0
Ada (RTX 40-series) FP812.4
Hopper (H100) FP812.3
Blackwell (RTX 50-series) / V2++12.8

Install command (Linux or Windows with toolkit present):

pip install sageattention==2.2.0 --no-build-isolation

If ComfyUI shows an error when you pass --use-sage-attention, the build failed — re-run the batch files or check the compiler output. For ComfyUI environment setup issues, see ComfyUI Import Errors: Fix Python Env & CUDA Mismatches.

Source: SageAttention repo install guide; Civitai article #12851 (community Windows installer).

What Is the Quality Trade-off with Step-Distilled Video Models?

LTXVideo 0.9.6 distilled (2 B parameters) drops CFG and STG entirely, runs in 8 steps (config: guidance_scale: 1, stg_scale: 0, num_inference_steps: 8, stochastic_sampling: true), and is described as 15× faster than the non-distilled model (GPU unspecified in the release notes). The LTXVideo release notes state the distilled model is "Still real time on H100"; the 13 B v0.9.7 variant generates HD in ~10 s on H100 with a 3 s low-res preview. No FVD/FID numbers or consumer-GPU comparisons are published. The official repo notes stochastic sampling can improve visual quality on the distilled model.

Source: LTXVideo repo release notes and ltxv-2b-0.9.6-distilled.yaml config.

FP8 vs INT8 Quantisation: Which Should I Use?

FormatWhere it appliesHardware supportTypical use in video
FP8 (E4M3/E5M2)Model weights, PV in SageAttentionAda, Hopper, BlackwellLTXVideo FP8 checkpoints; SageAttention V2
INT8QK^T in SageAttention V2/V2++Ampere, Ada, HopperSageAttention kernels only

SageAttention V2 quantises QK^T to INT8 with per-thread smoothing and PV to FP8 with two-level accumulation. LTXVideo ships FP8-safetensors for both base and distilled models (ltxv-13b-0.9.7-dev-fp8, ltxv-13b-0.9.7-distilled-fp8). Quantised models use less VRAM; speed gains depend on whether the attention kernel or the linear layers are the bottleneck.

Source: SageAttention repo kernel table; LTXVideo repo release notes.

Common Errors and Fixes

SymptomLikely causeFix
pip install sageattention fails on WindowsMissing CUDA toolkit or Triton wheelInstall CUDA ≥ 12.0 (≥ 12.8 for RTX 50-series), then re-run pip install sageattention==2.2.0 --no-build-isolation
--use-sage-attention crashes ComfyUISageAttention not built or wrong versionRun the two-step batch installer from Civitai #12851 or rebuild from source
TeaCache loses detail at high thresholdsteacache_thresh set too highDrop threshold (e.g., 0.30 → 0.20 for I2V 720P)
SageAttention V1 slower than FlashAttention-2Triton backend is slower than CUDA kernelsUpgrade to SageAttention 2.2.0+

FAQ

How much faster is SageAttention compared to FlashAttention? Kernel throughput is 2.1–2.7× higher than FlashAttention-2/xformers; end-to-end CogVideoX-1.5-5B on H20: 12 min 7 s vs 12 min 14 s (FA3-FP8) and 25 min 34 s (FA2). On RTX 5090, SageAttention 3 reaches 5× kernel speedup.

What threshold should I use for TeaCache? Start at 0.20–0.26 for I2V 480P/720P; lower if quality suffers. Use use_ref_steps for extra speed with equal or better fidelity (except T2V 1.3B).

Does SageAttention work with Wan2.1? Yes. Replace attention only in the DiT block, not globally. A community ComfyUI workflow combines it with TeaCache for Wan2.1 I2V 720P.

How do I install Triton and SageAttention on Windows? Use the two-batch installer for ComfyUI Portable (Python 3.12, CUDA 12.8) or pip install sageattention==2.2.0 --no-build-isolation after installing CUDA ≥ 12.0 and Triton ≥ 3.0.

What is the quality trade-off with step-distilled video models? LTXVideo distilled drops CFG/STG, runs in 8 steps, 15× faster than non-distilled (GPU unspecified in release notes); on H100 generation is real-time. No public FVD/FID or consumer-GPU quality comparisons exist; stochastic sampling may recover some detail.

Is LTXVideo 0.9.6 distilled better than the base model? Faster and lighter, but quality on consumer GPUs is undocumented. The base model still supports higher resolutions and guidance for maximum fidelity.

Can I combine SageAttention and TeaCache? A community workflow does this for Wan2.1 I2V 720P, reporting 54 % total speedup (542 s → 248 s on RTX 4090). Official benchmarks only test each technique separately.

Does SageAttention work on AMD GPUs? No public support or benchmarks; all kernels target NVIDIA Ampere/Ada/Hopper/Blackwell.



Sources

  1. SageAttention repository and papers (ICLR 2025, ICML 2025, NeurIPS 2025 Spotlight) — https://github.com/thu-ml/SageAttention
  2. TeaCache for Wan2.1 official benchmarks — https://github.com/ali-vilab/TeaCache/blob/main/TeaCache4Wan2.1/README.md
  3. LTXVideo repository release notes and configs — https://github.com/Lightricks/LTX-Video
  4. Civitai community articles #12250, #12851, #13699 (single-source claims noted inline)