New: create a free account and get 14 days ad-free.Sign up free
EarnGeniX
Skip to main content

ComfyUI Tutorial · Windows

SageAttention Won't Install in ComfyUI? The Exact Windows Fix

Version mismatches, missing Triton files, a wrong wheel file, and forgetting to enable it are the four reasons SageAttention installs "fail" in ComfyUI. This guide fixes all four, in the exact order that works — Visual C++, Triton, PyTorch, the SageAttention wheel, then enabling it.

Free

Cost

Windows

Platform

Beginner

Skill level

RTX 4090

GPU tested

🗺️ Part of the Free ComfyUI RoadmapLevel 1: Beginner FoundationsBeginnerStep: Installing ComfyUI
View Full Roadmap

By Earngenix Team · · Tested on ComfyUI 0.30.0+, RTX 4090 · 14 min read

Why Does SageAttention Fail to Install in ComfyUI?

Quick answer: SageAttention installs "fail" in ComfyUI for one of four reasons: a version mismatch between Python, CUDA, PyTorch, and Triton; a missing Triton include/libs copy; the wrong wheel file for your setup; or — the one people miss most — installing the wheel but never telling ComfyUI to actually use it. Fix them in this order — Visual C++ → Triton → PyTorch → the SageAttention wheel → enable it — and it works.

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 (the copy of Python bundled inside your ComfyUI portable folder — this is the one you must always install into) — ComfyUI's embedded Python is missing these development files by default, and Triton cannot compile without them.
  • The wrong wheel downloaded — the ABI tag and CUDA version in the filename must match what you have installed, or pip refuses the install outright.
  • Never enabling it — installing the wheel only makes SageAttention available. ComfyUI still needs a startup flag to actually use it, which is easy to miss if you stop after Step 4.

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 40xx/50xx get the fastest kernels with Triton ≥ 3.3, PyTorch ≥ 2.7, CUDA ≥ 12.8. RTX 20xx needs an older PyTorch (2.6 or earlier) instead — see the FAQ below.

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.

  1. Download the Visual C++ installer directly from Microsoft: https://aka.ms/vs/17/release/vc_redist.x64.exe.
  2. Double-click the downloaded file and click Install or Repair when prompted.
  3. 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🔍 Click to zoom
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

  1. Navigate to your ComfyUI_windows_portable folder — this is the folder that contains the run_nvidia_gpu file, your portable installation root.
  2. Click the address bar in Windows Explorer, type cmd, and press Enter. A command prompt (terminal) opens with that folder as the working directory.
Windows Explorer address bar — typing cmd to open a terminal in the ComfyUI_windows_portable folder🔍 Click to zoom
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
💡 Tip: This command will ask Proceed (Y/n)? — type Y and press Enter to confirm. If Triton wasn't installed, pip just says so and moves on; that's fine.
Terminal running pip uninstall triton command in ComfyUI portable folder to remove old Triton installation🔍 Click to zoom
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 "triton-windows<3.7"
Terminal running pip install triton-windows command to install the Windows-compatible Triton package for SageAttention🔍 Click to zoom
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.

  1. Check your embedded Python version by running .\python_embeded\python.exe --version.
  2. Go to the Triton Windows releases page 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.
  3. Download the Python include/libs zip that matches your Python version exactly — for example python_3.13.2_include_libs.zip for Python 3.13.2.
  4. Unzip the download, then copy both the include folder and the libs folder into your python_embeded directory inside ComfyUI_windows_portable.
Triton Windows GitHub releases page — showing Python include/libs zip files to download for the matching Python version🔍 Click to zoom
Download the include/libs zip that matches your embedded Python version from the Triton releases.
ComfyUI python_embeded folder — showing the include and libs folders copied from the Triton include/libs zip🔍 Click to zoom
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 single 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 (the machine learning framework ComfyUI and SageAttention run on) that matches both your CUDA version (the software NVIDIA GPUs use to run heavy calculations like AI image generation) 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
💡 Tip: This will ask Proceed (Y/n)? up to three times (once per package) — type Y and press Enter each time.
Terminal running pip uninstall torch torchvision torchaudio command in ComfyUI folder before installing the updated CUDA-compatible build🔍 Click to zoom
Uninstall the existing torch packages before installing the CUDA 12.8 build.

Install the CUDA 12.8 PyTorch Build

Install the nightly PyTorch build (a version of PyTorch updated daily, ahead of the official stable release) 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🔍 Click to zoom
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, a stable (non-nightly) CUDA 12.8 build may also work — we use the nightly build here because it's what we've tested most, not because stable builds are known to fail.

Step 4 — Download and Install the Matching SageAttention Wheel

The wheel file has to match your CUDA version, PyTorch version, and Python version exactly, or pip will reject it. Checking those three versions and reading a wheel filename correctly is enough content for its own guide — we cover it in full detail, with the current filename table and the exact fixes for the three most common wheel-install errors, here:

SageAttention Wheel Won't Install in ComfyUI? Match It to Your CUDA and PyTorch First →

Covers: checking your Python/CUDA/PyTorch versions, reading a wheel filename part by part, the current wheel filename table, and fixes for "No matching distribution found," "not a supported wheel on this platform," and "No module named 'sageattention.'"

Once you know which wheel matches your setup, download it from the SageAttention GitHub releases page, move it into your ComfyUI_windows_portable folder, and install it:

.\python_embeded\python.exe -m pip install sageattention-2.2.0+cu130torch2.10.0andhigher.post6-cp310-abi3-win_amd64.whl
💡 Tip: Replace the filename above with whatever you actually downloaded — type .\python_embeded\python.exe -m pip install sageattention- and press Tab to auto-complete the rest.
Terminal running pip install sageattention wheel file command in ComfyUI_windows_portable folder, ending with a Successfully installed confirmation line🔍 Click to zoom
A successful install ends with a 'Successfully installed sageattention-...' line.
⚠️ Warning: If pip rejects the wheel, or it installs but ComfyUI still can't find SageAttention, that's almost always a version mismatch or a wrong-Python install — the wheel-matching guide has the exact fix for each specific error message.

Step 5 — Enable and Verify SageAttention Is Working

This is the step people miss most. Installing the wheel makes SageAttention available — ComfyUI still won't use it until you add a startup flag.

  1. Find run_nvidia_gpu.bat in your ComfyUI_windows_portable folder. Right-click it and choose Edit (or open it with Notepad) — or make a copy first and name it run_nvidia_gpu_sage.bat if you want to keep a version without SageAttention too.
  2. Find the line that starts ComfyUI (it ends in main.py plus some flags) and add --use-sage-attention to the end of it.
  3. Save the file, then double-click it to start ComfyUI.
  4. Watch the console window that opens. Near the top of the startup log you should see a line confirming SageAttention loaded — if you don't see any mention of it, the flag either wasn't saved correctly or SageAttention isn't installed in this Python environment.
  5. Load any workflow that uses SageAttention and click Queue Prompt. If it runs without errors, everything is working.
run_nvidia_gpu_sage.bat file open in a text editor with --use-sage-attention added to the ComfyUI launch line🔍 Click to zoom
Add --use-sage-attention to your launch file's ComfyUI startup line.
ComfyUI console window at startup showing SageAttention confirmed as active🔍 Click to zoom
The console confirms SageAttention is active — this is what you're checking for in Step 5.
💡 Tip: As of ComfyUI 0.32.0 (August 2026), there's also a built-in alternative called comfy kitchen, enabled with --use-ck-attention instead — it needs no wheel install at all and early benchmarks put it roughly on par with SageAttention. Worth trying if you're on a recent ComfyUI version and want to skip Steps 2–4 entirely next time.

If you see import errors or Triton errors in the console instead, check that the include and libs folders from Step 2 are correctly placed inside python_embeded, and that all version numbers match — see Troubleshooting below.

If ComfyUI flags any missing nodes when you load a test workflow, follow the installing missing custom nodes guide to resolve them before continuing.

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

Does SageAttention Slow Down or Change Image Quality?

No — in normal use SageAttention only speeds up the attention calculation, it does not change the output. Once it's installed and enabled correctly using the steps above, you should see a real drop in generation time with no visible difference in the result. The one documented exception is RTX 50xx GPUs, covered in the troubleshooting section below.

In our test below, generation time dropped from 115 seconds to 40 seconds — a 65% reduction. Actual savings vary by model, resolution, and hardware; expect roughly 30–50% in most cases, sometimes more.

ComfyUI generation with SageAttention off — 115 seconds🔍 Click to zoom
SageAttention OFF — 115 seconds
ComfyUI generation with SageAttention on — 40 seconds🔍 Click to zoom
SageAttention ON — 40 seconds (65% faster in this test)
💡 Tip: FLUX-based models typically see the biggest speed gains. Try a longer generation — more steps or a larger resolution — to see the difference more clearly.

Troubleshooting Common SageAttention Install Errors

Seeing a wheel-install error — No matching distribution found, not a supported wheel on this platform, or No module named 'sageattention' right after a successful pip install? Those are covered with exact fixes in the wheel-matching guide. The errors below are the other common ones.

"c10.dll" error, or ComfyUI won't start after installing SageAttention

What causes it: The Visual C++ Redistributable from Step 1 isn't installed, or a partial install got left behind.

How to fix it: Re-run the Visual C++ installer from Step 1 and choose Repair if it offers that option. Also make sure your NVIDIA drivers are up to date — an outdated driver can produce the same symptom.

Triton fails to import or load

What causes it: The include and libs folders weren't copied into python_embeded.

How to fix it: Go back to Step 2 and copy both folders from the Triton releases zip that matches your Python version.

SageAttention is installed but generation isn't any faster

What causes it: The --use-sage-attention flag from Step 5 was never added, or wasn't saved to the file you're actually launching.

How to fix it: Re-check Step 5 — confirm the flag is in the exact .bat file you double-click to start ComfyUI, and confirm the console shows SageAttention loading at startup.

Black or corrupted frames on RTX 50xx GPUs

What causes it: 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's been reported most often with video models like WAN.

How to fix it: Try a standard resolution first (1024×1024 or 1280×720) before assuming the install itself is broken. If it persists on a specific model, that model may not be compatible with SageAttention's fp8 path yet.

Nothing above fixes it

What to do: Reinstall the ComfyUI Windows portable version from scratch and follow all five steps again from the beginning. Make sure your GPU is supported (RTX 20xx or newer) and check the FAQ below for the RTX 20xx caveat.

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

SageAttention supports NVIDIA RTX 20xx, 30xx, 40xx, and 50xx series GPUs, but not all with the same setup. RTX 40xx and 50xx get the newest SageAttention2++ kernels with Triton 3.3+, PyTorch 2.7+, and CUDA 12.8+. RTX 20xx (Turing) support was dropped in newer builds, so those cards need an older PyTorch (2.6 or earlier) and a matching older SageAttention wheel instead of the steps in this guide.

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

Match the wheel to your CUDA version, PyTorch version, and Python version — the filename encodes all three. We have a dedicated guide that walks through checking your versions and reading a wheel filename step by step, with the current filename table.

Installing the wheel isn't the same as turning SageAttention on — ComfyUI needs the --use-sage-attention flag at startup, covered in Step 5 below. If it's still not working after that, the most common causes are a version mismatch between the wheel and your CUDA/PyTorch/Python, or forgetting to copy the Triton include and libs folders into python_embeded.

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.

In normal use there is no visible quality loss — SageAttention speeds up the attention calculation without changing what the model produces. The one documented exception is RTX 50xx (Blackwell) GPUs, where SageAttention’s fp8 kernel can overflow fp16 on some models, producing black frames — see the troubleshooting section below.

Not necessarily. ComfyUI versions from August 2026 onward (0.32.0+) include a built-in fast attention backend called comfy kitchen, enabled with --use-ck-attention instead of --use-sage-attention, with no separate wheel install required. Early community benchmarks put it roughly on par with SageAttention on several models.

What to Do Next

Wheel giving you a specific pip error?

The dedicated wheel-matching guide has the version-check commands, the full filename table, and the exact fix for each pip error — worth a look before you reinstall from scratch.

What to Read Next

If your wheel is the part still giving you trouble, the wheel-matching guide goes deeper than Step 4 above. Missing nodes after loading a test workflow? The missing nodes guide covers that. And once SageAttention is running, it's most worth using on heavier workflows like FLUX — the larger the model, the more time SageAttention saves.

— Written as a personal recommendation from the Earngenix team.

Published: 2025-04-01 · Last updated: 2026-09-29 · Workflow structure verified against the official ComfyUI SageAttention setup.

Discussion

Join the discussion

Sign in to leave a comment or reply

💬

No comments yet

Be the first to share your thoughts!