Earngenix Logo
Skip to main content

ComfyUI Tutorial · Performance · Windows · 2026

How to Install SageAttention and Triton in ComfyUI on Windows

Boost your ComfyUI image generation speed by 30–70% with SageAttention and Triton. Full step-by-step setup guide for Windows — no experience required.

By Earngenix Team15 min read
SageAttention installed in ComfyUI showing dramatically faster generation times

Why Use SageAttention and Triton in ComfyUI?

Speed boost: SageAttention can reduce generation times by 30–70% without any change to image quality. The same prompt, same model, same quality — just significantly faster.

When you enable SageAttention, your image generation becomes dramatically faster. In most cases the time drops by 30–50%, and sometimes even more depending on the model and hardware.

For example, an image that normally takes 115 seconds without SageAttention may take only 45 seconds with it — almost 70% faster. Less time waiting, more time creating.

ComfyUI generation SageAttention OFF — 115 seconds
SageAttention OFF115 seconds
ComfyUI generation SageAttention ON — 40 seconds
SageAttention ON40 seconds

Introduction

Speeding up image generation in ComfyUI is easy with SageAttention and Triton. These tools can help you cut generation times by over 50%. This guide walks you through every step to set up SageAttention and Triton in ComfyUI on Windows — no prior experience needed.

By the end, you will be generating images significantly faster and your whole workflow will feel noticeably more efficient. Just follow along and you will have everything up and running without any hassle.

⚠️ Important: All terminal commands in this guide must be run from the ComfyUI_windows_portable root folder. If you are in a different directory, the commands will not work as expected. Open Command Prompt from that folder every time.

Step 1: Install Visual C++ Redistributable

Before installing Triton, make sure the Visual C++ Redistributable for Visual Studio 2015–2022 is installed on your system. Triton depends on it and will fail without it.

Download Visual C++ Redistributable
Visual C++ Redistributable installer window showing installation options
Download and run the Visual C++ Redistributable installer
💡 Tip: Restart your computer after installing Visual C++ Redistributable before continuing to the next step.

Step 2: Remove Old Triton Packages

Open your ComfyUI_windows_portable folder. In the address bar at the top of the window, type cmd and press Enter to open Command Prompt already pointing at that folder.

Windows Explorer address bar with cmd typed to open Command Prompt in the ComfyUI_windows_portable folder
Type cmd in the address bar and press Enter — this opens a terminal in the right folder

Uninstall any existing Triton packages to avoid conflicts:

.python_embededpython.exe -m pip uninstall triton
Command Prompt showing pip uninstall triton command running successfully
Uninstall any existing Triton version before installing the Windows-compatible one

Step 3: Install the Latest Triton for ComfyUI

In the same Command Prompt, install the Windows-compatible Triton package:

.python_embededpython.exe -m pip install -U "triton-windows<3.6"
Command Prompt showing triton-windows installation completing successfully

Next, check your Python version — you need it to download the correct Triton zip file:

.python_embededpython.exe --version
Command Prompt showing Python version output — Python 3.11.x
Note your Python version (3.10 or 3.11) — you need it in the next step

Download the matching Triton zip file for your Python version from the GitHub releases page:

Triton Windows Releases (GitHub)
GitHub releases page for triton-windows showing zip files for Python 3.10 and 3.11
Download the zip matching your Python version

Which zip file to download:

  • Python 3.11: python_3.11.9_include_libs.zip
  • Python 3.10: python_3.10.11_include_libs.zip

Unzip the downloaded file. You will find two folders: include and libs. Copy both into your python_embeded folder inside ComfyUI_windows_portable.

Windows Explorer showing include and libs folders being copied into the python_embeded directory
Copy the include and libs folders into your python_embeded folder

Step 4: Update the Torch Package

First, check your current Torch version to see if it needs updating:

.python_embededpython.exe -m pip freeze

Look for torch in the output list.

Command Prompt showing pip freeze output with torch version listed
Find the torch version in the pip freeze output

If Torch is outdated, uninstall it first:

.python_embededpython.exe -m pip uninstall torch torchvision torchaudio

Then install the latest version of Torch with CUDA 12.8 support:

.python_embededpython.exe -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128
Command Prompt showing the latest Torch CUDA 12.8 installation completing
Installing the latest Torch nightly build with CUDA 12.8 support

Step 5: Install SageAttention for ComfyUI

Visit the SageAttention GitHub releases page and download the .whl file that matches your Torch version and Python version.

SageAttention Releases (GitHub)
SageAttention GitHub releases page showing available .whl files for different Torch and Python versions
Find the .whl file matching your Torch version and Python version

Which .whl file to download:

  • Torch 2.9: sageattention-2.2.0+cu128torch2.9.0andhigher.post4-cp39-…-win_amd64.whl
  • Torch 2.8: sageattention-2.2.0+cu128torch2.8.0.post3-cp39-abi3-win_amd64.whl

Place the downloaded .whl file in your ComfyUI_windows_portable folder.

.whl file placed in the ComfyUI_windows_portable root folder
Place the .whl file in the ComfyUI_windows_portable root folder

Install SageAttention using the command below. Replace your_sageattention_filename.whl with the actual file name you downloaded:

.python_embededpython.exe -m pip install ./your_sageattention_filename.whl
Command Prompt showing SageAttention .whl installation completing successfully
SageAttention installing from the local .whl file

Step 6: Start ComfyUI and Test SageAttention

Start your ComfyUI server as usual. Download the example workflow below, drag it into ComfyUI, and run a test generation to verify SageAttention is active.

⚠️ Important: If any nodes are missing after loading the workflow, ComfyUI will flag them. Go to Manager → Install Missing Custom Nodes, install them, then reload your workflow.
ComfyUI interface with the SageAttention test workflow loaded and ready to run
Load the example workflow and click Queue Prompt to verify SageAttention is working

Generate a test image and compare the time shown in your terminal. You should see a significant reduction compared to your previous generation times.

ComfyUI generation SageAttention OFF — 52 seconds
SageAttention OFF52 seconds
ComfyUI generation SageAttention ON — 43 seconds
SageAttention ON43 seconds
💡 Tip: The speed improvement varies by model and hardware. FLUX-based models typically see the biggest gains. Try a longer generation (more steps or larger resolution) to see a bigger difference.

Frequently Asked Questions

SageAttention is an optimised attention kernel that speeds up image generation in ComfyUI by 30–70%. It works alongside Triton to accelerate GPU computations during sampling, reducing wait times significantly without affecting output quality at all.

Install Visual C++ Redistributable, remove old Triton packages, install triton-windows (below version 3.6), copy the Python include/libs zip contents into python_embeded, update Torch to the latest CUDA 12.8 build, then download and install the matching SageAttention .whl from the GitHub releases page.

Install triton-windows version below 3.6 using pip. Then download the matching Python include/lib zip file from the woct0rdho/triton-windows GitHub releases — choose the zip matching your Python version (3.10 or 3.11) and copy both the include and libs folders into your python_embeded directory.

No. SageAttention speeds up the attention computation during image generation without changing the output quality. The generated images look identical whether SageAttention is enabled or not — you get the same result in significantly less time.

It depends on your installed Torch version. For Torch 2.9 use the cu128torch2.9.0 wheel. For Torch 2.8 use the cu128torch2.8.0 wheel. Always match the CUDA version (cu128) in the filename to your CUDA installation.

Conclusion

Setting up SageAttention and Triton for ComfyUI on Windows takes a bit of care with matching versions, but the speed payoff is well worth the effort. These steps give you a 30–70% reduction in generation times without any compromise on output quality.

Always pick package versions that match your Python and CUDA setup, and remember to run all commands from the ComfyUI_windows_portable folder. Once it is running, you will notice the difference immediately.

Having issues? Check the ComfyUI Troubleshooting Guide for common node errors, dependency conflicts, and GPU memory issues.
Discussion

Join the discussion

Sign in to leave a comment or reply

💬

No comments yet

Be the first to share your thoughts!