triton-sageattention

Featured

Install Triton + SageAttention to accelerate ComfyUI (the sageattn attention_mode and inductor torch.compile used by WanVideoWrapper / many video graphs) — Windows-first (triton-windows + woct0rdho prebuilt SageAttention wheels matched to torch/CUDA/python into the RIGHT python), plus Linux (official triton + build) and Mac (N/A → sdpa/MPS). Critically also covers the SAFE sdpa / no-compile fallback so an example that assumes sageattn + torch.compile still runs when these aren't installed (video-extend TRAP 5). Use when a loader crashes with "No module named 'sageattention'" or reports triton unavailable, when asked to speed up Wan/video workflows, or when deciding whether to install acceleration vs. fall back.

AI & Automation 636 stars 98 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
93
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Triton + SageAttention (ComfyUI acceleration) > See also [`comfyui-launch-flags`](../comfyui-launch-flags/SKILL.md) for the full > attention / VRAM / cache flag matrix. Note the **Z-Image exception**: Z-Image is > broken under `--use-sage-attention` → launch it with > `--use-pytorch-cross-attention` instead. ## Overview Two **optional accelerators** that many modern video graphs (especially kijai's **ComfyUI-WanVideoWrapper**) reference by default: - **SageAttention** (`import sageattention`) — a quantized attention kernel. Selected via a node's `attention_mode = sageattn` (WanVideoWrapper) or ComfyUI's `--use-sage-attention` startup flag. ~20–40% faster sampling on supported NVIDIA GPUs. - **Triton** — the GPU kernel compiler that **inductor `torch.compile`** needs. WanVideoWrapper's `WanVideoTorchCompileSettings` (and any `torch.compile`/ inductor node) compiles the model through Triton for another speedup. > ⚠️ **The risk.** Both are **version-locked to your exact torch + CUDA + python**. > A wrong wheel doesn't just fail to install — it can **break the torch install** > (mismatched CUDA DLLs, `ImportError`, or silent NaNs). And the *failure mode of > not having them* is a **hard crash before any sampling**: > `ValueError: Can't import SageAttention: No module named 'sageattention'`, or > compile errors / `triton: unavailable` in the startup log. This is exactly the > [`video-extend`](../video-extend/SKILL.md) **TRAP 5**. > ✅ **Therefore the default is: g...

Details

Author
artokun
Repository
artokun/comfyui-mcp
Created
6 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

comfyui-launch-flags

Pick the right ComfyUI startup flags for VRAM, attention, caching, and speed — the full decision matrix for OOM (--novram / --cache-none / --disable-smart-memory), shared-VRAM creep on Windows (--reserve-vram N), model-switching with big text encoders (--cache-none), high-VRAM throughput (--gpu-only / --highvram), and attention-backend selection (--use-sage-attention for speed, --use-pytorch-cross-attention as the highest-quality / Z-Image-safe fallback). Also the acceleration-stack + Blackwell/RTX 5000 (sm_120) notes. Use when a graph OOMs (especially long video like LTX 2 / WAN), when the GPU spills into shared VRAM and slows to a crawl, when switching between models eats all RAM, when Z-Image produces black/garbled output under Sage, or when deciding which attention backend to launch with. Flag names verified against upstream comfy/cli_args.py — see Sources.

636 Updated today
artokun
AI & Automation Featured

optimizing-attention-flash

Optimizes transformer attention with Flash Attention for 2-4x speedup and 10-20x memory reduction. Use when training/running transformers with long sequences (>512 tokens), encountering GPU memory issues with attention, or need faster inference. Supports PyTorch native SDPA, flash-attn library, H100 FP8, and sliding window attention.

233,682 Updated today
NousResearch
AI & Automation Listed

optimizing-attention-flash

Optimizes transformer attention with Flash Attention for 2-4x speedup and 10-20x memory reduction. Use when training/running transformers with long sequences (>512 tokens), encountering GPU memory issues with attention, or need faster inference. Supports PyTorch native SDPA, flash-attn library, H100 FP8, and sliding window attention.

1 Updated 1 weeks ago
dsivov