Why Does SageAttention Fail to Install in ComfyUI?
SageAttention is an attention kernel — a piece of code that speeds up one of the slowest calculations ComfyUI runs during image and video generation. It does not change what your images look like; it only makes that one calculation faster, which is why the install itself is where almost all the problems happen.
Before jumping into the steps, it helps to know exactly what breaks the install. In order of how often each one shows up:
- A version mismatch — Python, CUDA, PyTorch, and Triton all need matching versions. The SageAttention wheel file (a pre-built Python package ending in
.whl) is compiled for one specific combination of these — not "any recent version." - Triton's include/libs files not copied into
python_embeded— ComfyUI's embedded Python is missing these development files by default, and Triton cannot compile without them. - The wrong wheel downloaded — the ABI tag (the
abi3part of the filename) and CUDA version in the filename must match what you have installed, or pip refuses the install outright. - An outdated PyTorch build — SageAttention needs a PyTorch build compiled against the correct CUDA version, not just any PyTorch you already had installed.
This guide walks through all four in the order that actually works, with the exact commands and version checks at each step.
What You Need Before Installing SageAttention
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.
It also helps to update ComfyUI to the latest version before starting. Older ComfyUI portable builds sometimes ship an outdated bundled PyTorch that conflicts with the CUDA 12.8 build SageAttention needs.
How to Install SageAttention in ComfyUI: Step-by-Step
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 "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/triton-lang/triton-windows#8-special-notes-for-embeded-python 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.13.2_include_libs.zip for Python 3.13.11. 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 — Download and Install the Correct SageAttention Wheel
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_embeded\python.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. These exact filenames are what you'll see on the releases page — match yours to one of these:
sageattention-2.2.0+cu128torch2.10.0andhigher.post4-cp39-abi3-win_amd64.whl
Use this if you have PyTorch ≥ 2.12.0 and CUDA 12.8 (cu128)
sageattention-2.2.0+cu130torch2.9.1andhigher.post4-cp39-abi3-win_amd64.whl
Use this if you have PyTorch <= 2.9.1 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.
SageAttention's speed boost is most noticeable in heavier workflows such as FLUX workflows — the larger the model, the more time the attention calculation takes, and the more time SageAttention saves.
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.If ComfyUI flags any missing nodes when you load the test workflow below, follow the installing missing custom nodes guide to resolve them before continuing.
Working Setup Example
For reference, here is a confirmed working configuration:
Does SageAttention Slow Down or Change Image Quality?
No. SageAttention only speeds up the attention calculation — it does not change the output. Once it's installed correctly using the steps above, you should see a real drop in generation time with no visible difference in the result.
In most cases, generation time drops by 30–50%, and sometimes more depending on the model and hardware. For example, an image that normally takes 115 seconds without SageAttention can take only 45 seconds with it enabled — close to 70% faster.
Why Isn't SageAttention Working After Installation?
⚠ 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.
⚠ Black or corrupted frames on RTX 50xx GPUs
This is a known issue on Blackwell (RTX 50xx) cards: SageAttention's fp8 kernel can overflow fp16 on models that run fp8 weights with fp16 math, producing NaN values that show up as black frames. It shows up most often at 2:1 resolutions like 1280×640. If you hit this, try a standard resolution first (1024×1024 or 1280×720) before assuming the install itself is broken.
⚠ 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).
If the problem you're seeing isn't listed above, it may not be specific to SageAttention. Check the general ComfyUI troubleshooting guide for node errors, dependency conflicts, and other setup issues unrelated to attention kernels.
Frequently Asked Questions
What to Do Next
Once SageAttention is confirmed working, put it to use in a real workflow — the ComfyUI roadmap lays out what to learn next, starting with the FLUX workflows where the speed gain matters most.
Join the discussion
Sign in to leave a comment or reply
No comments yet
Be the first to share your thoughts!
















