Earngenix Logo
Skip to main content

ComfyUI Tutorial · Windows · 2026

How to Install SageAttention in ComfyUI on Windows

Step-by-step guide to installing SageAttention in ComfyUI on Windows — covering Visual C++, Triton, PyTorch, and the correct SageAttention wheel file. Screenshots included for every step.

By Earngenix Team12 min read
SageAttention installed and working in ComfyUI on Windows — terminal showing successful installation

Install SageAttention in ComfyUI on Windows

Quick answer: Installing SageAttention in ComfyUI on Windows requires four components in order: Visual C++ Redistributable, the Triton Windows package (plus include/libs files), PyTorch with the correct CUDA build, and the matching SageAttention wheel file. All four must have matching version numbers or installation will fail.

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.

Visual C++ Redistributable installer — showing the install screen for the Microsoft Visual C++ runtime required for SageAttention
Run the Visual C++ Redistributable installer. If it shows Repair, you already have it.

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.

Windows Explorer address bar — typing cmd to open a terminal in the ComfyUI_windows_portable folder
Type cmd in the address bar of the ComfyUI_windows_portable folder to open a terminal.

Remove Any Old Triton Installation

Run this command first to remove any previously installed version of Triton:

.\python_embeded\python.exe -m pip uninstall triton
Terminal running pip uninstall triton command in ComfyUI portable folder to remove old Triton installation
Uninstall any previously installed Triton package before installing the Windows version.

Install 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"
Terminal running pip install triton-windows command to install the Windows-compatible Triton package for SageAttention
Install triton-windows — the Windows-compatible Triton build required by SageAttention.

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 --version
Terminal showing the embedded Python version in ComfyUI portable — used to select the correct Triton include/libs zip file
Note the exact Python version number — you need it to download the right include/libs zip.

Go 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.

Triton Windows GitHub releases page — showing Python include/libs zip files to download for the matching Python version
Download the include/libs zip that matches your embedded Python version from the Triton releases.

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.

ComfyUI python_embeded folder — showing the include and libs folders copied from the Triton include/libs zip
Copy the include and libs folders into python_embeded. This step is required for Triton to load.
⚠️ Warning: Skipping the include and libs copy is the most common reason Triton fails to load. If you see Triton import errors after installation, come back and verify both folders are inside 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 torchaudio
Terminal running pip uninstall torch torchvision torchaudio command in ComfyUI folder before installing the updated CUDA-compatible build
Uninstall the existing torch packages before installing the CUDA 12.8 build.

Install 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/cu128
Terminal running pip install torch torchvision torchaudio with CUDA 12.8 nightly build for SageAttention compatibility
Install the PyTorch nightly build with CUDA 12.8 support.
💡 Tip: If you have an RTX 50xx GPU, this CUDA 12.8 build is required. For older GPUs like RTX 30xx or 40xx, this build still works well and is the recommended version for SageAttention compatibility.

Step 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)"
Terminal showing the CUDA version reported by PyTorch in ComfyUI embedded Python — used to select the correct SageAttention wheel
Note the CUDA version number — you need it to select the correct wheel file.

Check PyTorch version:

.\python_embeded\python.exe -m pip show torch
Terminal showing pip show torch output with PyTorch version number in ComfyUI — used to match the SageAttention wheel file
Note the PyTorch version from the pip show output.

If the above command does not show version info, use this alternative:

.\python_embeded\python.exe -m pip freeze

Download 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)

SageAttention GitHub releases page — showing available wheel files to download for different CUDA and PyTorch version combinations
Download the wheel that matches your CUDA and PyTorch versions from the SageAttention releases page.

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>.whl

Alternatively, type .\python_embeded\python.exe -m pip install ./sageattention and press Tab to auto-complete the filename.

Terminal running pip install sageattention wheel file command in ComfyUI_windows_portable folder
Install the SageAttention wheel using pip. The filename must match exactly.
⚠️ Warning: If pip fails with an error, the most common cause is a version mismatch — your CUDA, PyTorch, or Python version does not match what the wheel requires. Double-check your versions from Steps 3 and 4 and download the wheel that matches.

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.

💡 Tip: If you see import errors or Triton errors in the console, check that the include and libs folders from Step 2 are correctly placed inside 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:

OS:Windows 11
GPU:RTX 4090
Python:Python 3.13.11 (embedded)
Triton:triton-windows 3.5.1.post24
PyTorch:torch 2.12.0.dev20260219+cu128
SageAttention wheel:sageattention-2.2.0+cu128torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl

Frequently Asked Questions

SageAttention in ComfyUI supports NVIDIA RTX 20xx, 30xx, 40xx, and 50xx series GPUs. If you have an RTX 50xx GPU, you need Triton 3.3 or higher, PyTorch 2.7 or higher, and CUDA 12.8 or higher.

To install SageAttention in ComfyUI on Windows you need: Visual C++ Redistributable, the Triton package for Windows (triton-windows), PyTorch (torch, torchvision, torchaudio) with the matching CUDA version, and the ComfyUI Windows portable version already installed.

Download the wheel from the SageAttention GitHub releases page. Match the wheel to your CUDA version (e.g. cu128 for CUDA 12.8) and your PyTorch version. For example, if you have PyTorch 2.9 or higher with CUDA 12.8, choose the wheel named sageattention-X.X.X+cu128torch2.9.0andhigher-cp39-abi3-win_amd64.whl.

The most common causes are: a version mismatch between Python, PyTorch, Triton, and the wheel file; forgetting to copy the Triton include and libs folders into python_embeded; using the wrong torch build for your CUDA version; or selecting a wheel with an ABI tag incompatible with your embedded Python version.

Yes. After installing the triton-windows package, you must download the Python include/libs zip from the Triton Windows releases page that matches your embedded Python version, then copy the include and libs folders into your python_embeded folder. Skipping this step is one of the most common reasons Triton fails to load.

Discussion

Join the discussion

Sign in to leave a comment or reply

💬

No comments yet

Be the first to share your thoughts!