Type | Workflows |
Stats | 172 0 |
Reviews | (17) |
Published | Mar 7, 2025 |
Base Model | |
Hash | AutoV2 9C6E70C0A2 |
Hey everyone! I’ve successfully set up Triton and Sage Attention on my RTX 5070Ti with Windows 11 to speed up Wan2.1 generation. This guide is for anyone who doesn’t want to mess with WSL or install Linux. Here are the steps, with references for more details:
https://github.com/woct0rdho/triton-windows/?tab=readme-ov-file
https://www.reddit.com/r/comfyui/comments/1j298vc/comfyui_not_recognizing_sageattention/
https://github.com/thu-ml/SageAttention/issues/107
1. Download the special ComfyUI version for 50XX series GPUs, extract it, and run the run_nvidia_gpu.bat batch file. Wait until all dependencies are installed.https://github.com/comfyanonymous/ComfyUI/releases/download/latest/ComfyUI_cu128_50XX.7z
2. Install MSVC and Windows SDK
Steps:
Install Visual Studio 2022 from Visual Studio Downloads. Select “Desktop development with C++”.
Add to PATH:
Locate cl.exe (e.g., C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64).
Add to PATH:
cmd
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64
Or set permanently via System > Advanced > Environment Variables > Edit “Path”.
Test:
OpenPowerShell and enter
cl
Expected: Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34808 for x64....
3. Install vcredist
Steps:
Download Visual C++ Redistributable (2015-2022) from Microsoft.
Run vc_redist.x64.exe and install.
4. Install Triton
Steps:
Install a pre-release wheel for Windows:
cmd
cd ComfyUI_cu128_50XX\python_embeded python.exe -m pip install https://github.com/woct0rdho/triton-windows/releases/download/v3.2.0%2Bgit8f9b005b-windows.post11/triton-3.2.0+git8f9b005b-cp312-cp312-win_amd64.whl
5. Install Python 3.12.8 and Configure ComfyUI Embedded Python
Why: ComfyUI’s embedded Python needs headers and libs for Triton/Sage Attention.
Steps:
Download Python 3.12.8 from Python.org (Windows installer).
Install to a temporary path (e.g., C:\Python312).
Copy include and libs to ComfyUI’s embedded Python:
cmd
xcopy C:\Python312\include C:\Data\ComfyUI_cu128_50XX\python_embeded\include
xcopy C:\Python312\libs C:\Data\ComfyUI_cu128_50XX\python_embeded\libs
6. Install Sage Attention 1.0.6
Steps:
Download Sage Attention 1.0.6 https://github.com/thu-ml/SageAttention/tree/sageattention-1
Extract it to the Comfy UI folder and replace setup.py with the attached file
Install using embedded Python:
cmd
cd C:\Temp\sageattention-1.0.6 \ComfyUI_cu128_50XX\python_embeded\python.exe setup.py install
Before and After Results
Test Setup: 512x512 i2v video with 30 steps, 41 frames, 20 block swaps and UniPC sampler using I2V 720p 8fp model from master Kijai https://huggingface.co/Kijai/WanVideo_comfy/tree/main.
SDPA Attention: ~27s/it.
Sage Attention: ~14s/it.
Sage Attention+TeaCache: ~8s/it