Install SageAttention in ComfyUI on Windows
SageAttention speeds up attention operations in ComfyUI image and video generation workflows, especially on high-end NVIDIA GPUs. This guide covers the full installation process on Windows with the ComfyUI portable version — including every command, every version check, and every screenshot.
SageAttention Installation Requirements (Windows)
Supported GPUs
NVIDIA RTX 20xx, 30xx, 40xx, or 50xx series. RTX 50xx requires Triton ≥ 3.3, PyTorch ≥ 2.7, and CUDA ≥ 12.8.
Operating System
Windows 10 or Windows 11 with the ComfyUI Windows portable version already installed.
Required Packages
Visual C++ Redistributable, triton-windows, torch + torchvision + torchaudio, and the SageAttention .whl file.
Version Matching
All four components must have compatible versions — Python, CUDA, Triton, and PyTorch must all match the SageAttention wheel you download.
Step 1 — Install Visual C++ Redistributable
Visual C++ Redistributable provides the runtime libraries that Triton and SageAttention depend on. It must be installed before any other step.
Download the Visual C++ installer.
Download directly from Microsoft: https://aka.ms/vs/17/release/vc_redist.x64.exe
Run the installer.
Double-click the downloaded file and follow the installation steps. Click Install or Repair when prompted.
Restart Windows (fresh install only).
If this is the first time installing Visual C++ on this machine, restart Windows before continuing. If the installer shows "Repair", you already have it installed and no restart is needed.
Step 2 — Install Triton (triton-windows)
Triton is a GPU kernel compiler that SageAttention requires to run. The standard Triton package does not support Windows, so you need to install triton-windows — a Windows-compatible build.
Open the ComfyUI Folder Terminal
Navigate to your ComfyUI_windows_portable folder.
This is the folder that contains the run_nvidia_gpu file — your ComfyUI portable installation root.
Open a terminal in that folder.
Click the address bar in Windows Explorer, type "cmd", and press Enter. A command prompt will open with that folder as the working directory.
Remove Any Old Triton Installation
Run this command first to remove any previously installed version of Triton:
.\python_embeded\python.exe -m pip uninstall tritonInstall the Triton Windows Package
Install the Windows-compatible Triton build: .\python_embeded\python.exe -m pip install -U
.python_embededpython.exe -m pip install -U "triton-windows<3.7"Copy Include and Libs Files
This step is required for Triton to function correctly on Windows. You need to download additional include and libs files that match your embedded Python version and copy them into the python_embeded folder.
Check your embedded Python version.
Run the following command to find out which Python version is bundled with your ComfyUI installation:
.\python_embeded\python.exe --versionGo to the Triton Windows releases page.
Navigate to the Triton releases on GitHub: https://github.com/woct0rdho/triton-windows/releases and find the release version that matches your installed triton-windows version.
Download the matching Python include/libs zip.
Download the zip file that matches your Python version — for example python_3.12.7_include_libs.zip for Python 3.12.7. Make sure the zip matches your exact Python version from Step 1.
Extract and copy the include and libs folders.
Unzip the downloaded file, then copy both the include folder and the libs folder into your python_embeded directory inside ComfyUI_windows_portable.
python_embeded.Step 3 — Install or Update PyTorch
SageAttention requires a specific PyTorch build that matches both your CUDA version and the wheel file you will install. Use the commands below to remove the existing torch and install a fresh build with CUDA 12.8 support.
Remove Old Torch Packages
In the same ComfyUI terminal, run:
.\python_embeded\python.exe -m pip uninstall torch torchvision torchaudioInstall the CUDA 12.8 PyTorch Build
Install the nightly PyTorch build with CUDA 12.8 support:
.\python_embeded\python.exe -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128Step 4 — Install SageAttention
Check Your CUDA and Torch Versions
Before downloading the wheel, verify your installed CUDA and PyTorch versions. You need these version numbers to select the correct SageAttention wheel file.
Check CUDA version:
.python_embededpython.exe -c "import torch; print(torch.version.cuda)"Check PyTorch version:
.\python_embeded\python.exe -m pip show torchIf the above command does not show version info, use this alternative:
.\python_embeded\python.exe -m pip freezeDownload the Correct SageAttention Wheel
Go to the SageAttention releases page on GitHub: https://github.com/woct0rdho/SageAttention/releases
Find the wheel file that matches your CUDA version, PyTorch version, and Python ABI. Examples:
sageattention-2.2.0+cu128torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
Use this if you have PyTorch ≥ 2.9.0 and CUDA 12.8 (cu128)
sageattention-2.2.0+cu130torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
Use this if you have PyTorch ≥ 2.9.0 and CUDA 13.0 (cu130)
Install the Wheel File
Move the wheel file into your ComfyUI_windows_portable folder.
Copy or move the downloaded .whl file into the same folder where you have been running all the commands (the root ComfyUI_windows_portable folder).
Install the wheel using pip.
Run the install command with your exact wheel filename. Replace the filename below with the one you downloaded:
.\python_embeded\python.exe -m pip install ./sageattention-<your-file-name>.whlAlternatively, type .\python_embeded\python.exe -m pip install ./sageattention and press Tab to auto-complete the filename.
Step 5 — Verify SageAttention Is Working
After installation, start ComfyUI and verify that SageAttention and Triton are loading correctly.
Start the ComfyUI server.
Launch ComfyUI normally using the run_nvidia_gpu file.
Watch the console output.
Look for messages about SageAttention or Triton loading at startup. Successful installation will show confirmation messages in the console.
Load a workflow and run it.
Load a simple workflow that uses attention operations or the SageAttention node. If the workflow runs without errors, installation was successful.
python_embeded, and that all version numbers match.Troubleshooting & Common Issues
⚠ Triton fails to import or load
The include and libs folders were not copied into python_embeded. Go back to Step 2 and copy both folders from the Triton releases zip that matches your Python version.
⚠ pip fails when installing the SageAttention wheel
Version mismatch between the wheel and your installed CUDA / PyTorch / Python versions. Re-run the version checks from Step 4 and download the wheel that exactly matches your setup.
⚠ SageAttention installs but does not appear to speed anything up
Verify that the wheel ABI tag (cp39-abi3) is compatible with your embedded Python version. Also confirm that SageAttention is actually being called in your workflow nodes.
⚠ All steps fail — nothing works
Reinstall the ComfyUI Windows portable version from scratch and follow all steps again from the beginning. Make sure your GPU is supported (RTX 20xx or newer).
Working Setup Example
For reference, here is a confirmed working configuration:
Frequently Asked Questions
Join the discussion
Sign in to leave a comment or reply
No comments yet
Be the first to share your thoughts!














