Skip to content
,

How to Install Triton on Windows for ComfyUI (2026): triton-windows Version Table and Fixes

7–11 minutes
Woman in a brick-walled loft holding a tablet with a TRITON card, hook Triton on Windows

Sooner or later every ComfyUI user on Windows hits it: a speed-up node or SageAttention fails with No module named 'triton'. OpenAI’s Triton compiler officially ships for Linux only, so for a long time Windows users were stuck.

Today the community fork triton-windows fixes that, and it installs with one pip command, as long as you pick the version that matches your PyTorch.

This guide shows exactly how to install Triton on Windows for ComfyUI (portable, desktop or a venv), which version to choose for your PyTorch, how to test it, how to use it with the TorchCompileModel node and SageAttention, and how to fix the common errors.

TL;DR

  • Package: triton-windows on PyPI (latest 3.9.0.post30, released 28 Oct 2026). Repo: triton-lang/triton-windows.
  • Match PyTorch: torch 2.15 → Triton 3.9, 2.14 → 3.8, 2.12/2.13 → 3.7, 2.10/2.11 → 3.6, 2.9 → 3.5. Check yours with python -c "import torch; print(torch.__version__)".
  • ComfyUI portable: .\python_embeded\python.exe -m pip install -U "triton-windows<3.10" (use the cap that matches your torch), then add the include and libs folders to python_embeded.
  • No CUDA toolkit or Visual Studio needed for normal use: current wheels bundle a CUDA toolchain and the TinyCC compiler. You do need the latest Visual C++ Redistributable.
  • GPUs: RTX 30/40/50 and AMD RX 6000/7000/9000 work. GTX 10 series does not. RTX 20 / GTX 16 only work with old Triton 3.2.

Part of my ComfyUI series. Start with the ComfyUI guide if you are new.

What Triton Is and Why ComfyUI Needs It

Triton is a compiler that turns small Python GPU kernels into fast machine code on your own PC. You don’t use it directly. Other tools use it:

  • torch.compile (the TorchCompileModel node in ComfyUI) uses Triton to fuse model operations into faster kernels.
  • SageAttention uses Triton kernels for its quantized attention, one of the biggest speed-ups for Wan, Flux and Qwen-Image.
  • Many custom nodes for video models and caching rely on one of the two.

The official Triton project doesn’t publish Windows builds. triton-windows is a fork that adds Windows support. According to its README, triton.jit and torch.compile “just work”, all unit tests pass, and it’s “as fast as on Linux on the same GPU”.

Development has moved from woct0rdho’s personal repo to triton-lang/triton-windows; you still install it the same way from PyPI.

Step 1: Check Your GPU, Python and PyTorch

GPU support

GPU Supported?
RTX 50 series (Blackwell, sm120) Yes (needs Triton 3.3+, PyTorch 2.7+, CUDA 12.8+)
RTX 40 series (Ada) Yes
RTX 30 series (Ampere) Yes
RTX 20 / GTX 16 (Turing) Only Triton 3.2
GTX 10 series (Pascal) No
AMD RX 9000 / 7000 / 6000, Strix Halo Yes

Update your GPU driver first. Also note SageAttention needs int8 support, which RTX 20 and newer have.

Find which Python ComfyUI uses

This is where most installs go wrong. Triton must go into the same Python that runs ComfyUI:

  • ComfyUI portable: the python_embeded folder inside the ComfyUI folder. Never type plain python or pip; always use .\python_embeded\python.exe -m pip. The current Nvidia portable build ships Python 3.13 and PyTorch with CUDA 13.0.
  • Comfy Desktop: each build has its own environment. Open the build’s page and use its Terminal tab: the build’s Python environment is active there, so plain pip acts on that build.
  • Manual install: activate your venv or conda env first.

Check your PyTorch version

From the ComfyUI folder (portable):

.\python_embeded\python.exe -c "import torch; print(torch.__version__, torch.version.cuda)"

You’ll see something like 2.15.0+cu130 13.0. Note the first two numbers (2.15). ComfyUI also prints the PyTorch version in the console when it starts.

Step 2: Pick the Right Triton Version

Each PyTorch minor version only works reliably with one Triton minor version. From the triton-windows README:

PyTorch Triton pip version cap
2.15 3.9 "triton-windows<3.10"
2.14 3.8 "triton-windows<3.9"
2.12, 2.13 3.7 "triton-windows<3.8"
2.10, 2.11 3.6 "triton-windows<3.7"
2.9 3.5 "triton-windows<3.6"
2.8 3.4 "triton-windows<3.5"
2.7 3.3 "triton-windows<3.4"
2.6 3.2 "triton-windows<3.3"

The version cap matters: without it, a future Triton release could install automatically and break your current PyTorch. PyTorch 2.3 and older aren’t supported.

Step 3: Install triton-windows

1. Install the Visual C++ Redistributable

Triton’s core library is compiled with MSVC, so it needs the latest “Visual C++ Redistributable 2015-2022” (x64) from Microsoft: https://aka.ms/vs/17/release/vc_redist.x64.exe. If you already have it, install it again to update it.

2. Remove any old “triton” package

.\python_embeded\python.exe -m pip uninstall triton

It’s fine if it says it isn’t installed.

3. Install the matching version

For ComfyUI portable with PyTorch 2.15 (open a terminal in the ComfyUI_windows_portable folder):

.\python_embeded\python.exe -m pip install -U "triton-windows<3.10"

For a venv or conda env (activated first), the same thing with plain pip:

pip install -U "triton-windows<3.10"

Change the cap if your PyTorch is different (see the table).

There’s nothing else to download: since post11 the wheels on PyPI include a minimal CUDA toolchain (ptxas 12.9 for Triton 3.8-3.9), and since post13 they include the TinyCC C compiler, so you don’t need the CUDA Toolkit or Visual Studio Build Tools for SageAttention or normal Triton use.

One exception: if you use torch.compile targeting the CPU, PyTorch still needs a real C++ compiler (MSVC). That’s rare in ComfyUI.

Step 4: Extra Step for ComfyUI Portable

Embedded Python is a stripped-down Python. It may lack the C headers Triton needs to build its small helper modules. First look inside python_embeded: if include and libs folders are already there, skip this step. If not, add them by hand:

  1. Check your embedded Python version: .\python_embeded\python.exe --version (for example 3.13.x).
  2. Download the matching include/libs zip from the triton-windows releases page. For ComfyUI portable with Python 3.13 the README links python_3.13.2_include_libs.zip. The minor version (3.13) must match; the patch version (3.13.2 vs 3.13.9) doesn’t matter.
  3. Extract it and copy the two folders include and libs into ComfyUI_windows_portable\python_embeded\.

Careful: it’s libs, not lib. Don’t touch the existing Lib folder that holds site-packages.

A normal Python install (python.org, venv, conda, uv) already has these folders, so skip this step there.

Step 5: Test That Triton Works

Test Triton on its own before blaming ComfyUI. Save this as test_triton.py in the ComfyUI_windows_portable folder (not named triton.py):

import torch
import triton
import triton.language as tl

@triton.jit
def add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr):
    pid = tl.program_id(axis=0)
    block_start = pid * BLOCK_SIZE
    offsets = block_start + tl.arange(0, BLOCK_SIZE)
    mask = offsets < n_elements
    x = tl.load(x_ptr + offsets, mask=mask)
    y = tl.load(y_ptr + offsets, mask=mask)
    tl.store(output_ptr + offsets, x + y, mask=mask)

def add(x, y):
    output = torch.empty_like(x)
    n = output.numel()
    grid = lambda meta: (triton.cdiv(n, meta["BLOCK_SIZE"]),)
    add_kernel[grid](x, y, output, n, BLOCK_SIZE=1024)
    return output

a = torch.rand(3, device="cuda")
print(add(a, a) - (a + a))
print("If you see tensor([0., 0., 0.], device='cuda:0'), then it works")

Run it with the same Python:

.\python_embeded\python.exe test_triton.py

If you see tensor([0., 0., 0.], device='cuda:0'), Triton works. (This is a shortened version of the official test script from the triton-windows README.) The first run takes a few seconds because it compiles the kernel; later runs use the cache in C:\Users\<you>\.triton\cache.

Using Triton in ComfyUI

SageAttention

With Triton working, install SageAttention and start ComfyUI with --use-sage-attention. My step-by-step SageAttention install guide for Windows covers the wheels and the “No module named sageattention” fix.

TorchCompileModel node

ComfyUI has a built-in TorchCompileModel node (category experimental). Place it between your model loader and the KSampler. Its only advanced option is backend: inductor (default, uses Triton) or cudagraphs.

  • The first run is slow, sometimes a minute or more, while it compiles. Later runs at the same resolution are faster.
  • Changing resolution, batch size or LoRAs can trigger a recompile.
  • Gains vary by model and GPU. Test with and without it on your own workflow.

The --fast flag

The --fast launch flag turns on experimental optimizations (fp16 accumulation, fp8 matrix multiply on supported GPUs and others). It isn’t Triton-specific, but it pairs well. See ComfyUI command line arguments and how to speed up ComfyUI.

Common Errors and Fixes

Error Cause Fix
No module named 'triton' Installed into the wrong Python Use .\python_embeded\python.exe -m pip, not plain pip
'triton' is not a package Your script is named triton.py, or a folder called triton sits in the current directory Rename the script or folder
DLL load failed while importing libtriton Old Visual C++ runtime DLLs Install the latest vc_redist; for portable, copy msvcp140.dll, vcruntime140.dll, vcruntime140_1.dll from C:\Windows\System32 into python_embeded
DLL load failed while importing cuda_utils Stale cache or wrong include/libs Delete %USERPROFILE%\.triton\cache and %TEMP%\torchinductor_<you>; re-copy the include/libs for your exact Python minor version
Python.h not found / compile errors include/libs missing in python_embeded Do Step 4
PermissionError ... .triton User folder permissions Make sure your Windows account can write to C:\Users\<you>\.triton (check the folder’s Security tab)
pkgutil has no attribute ImpImporter Old setuptools python -m pip install -U pip setuptools
PY_SSIZE_T_CLEAN macro must be defined Stale cache Delete both cache folders above
Errors right after a ComfyUI update PyTorch was upgraded, Triton wasn’t Check torch version again and reinstall the matching Triton cap

Whenever you change Python, PyTorch or Triton versions, clear the two cache folders. Old compiled kernels are the cause of many confusing errors.

FAQ

Does Triton work on Windows?

Not officially, but the triton-windows fork does. It’s on PyPI as triton-windows, supports Windows 10 and 11, and runs as fast as Triton on Linux according to its maintainers.

Which Triton version do I need for ComfyUI?

The one that matches your PyTorch: 2.15 needs 3.9, 2.14 needs 3.8, 2.12-2.13 need 3.7, 2.10-2.11 need 3.6. Install with a cap like "triton-windows<3.10".

Do I need the CUDA Toolkit or Visual Studio?

No, for normal use. Current wheels bundle a CUDA toolchain and the TinyCC compiler. You only need the Visual C++ Redistributable. A full compiler is only needed for torch.compile on the CPU.

Why do I need include and libs folders for ComfyUI portable?

Embedded Python ships without the C headers and import libraries. Triton compiles small helper modules at runtime and needs them, so you copy them into python_embeded.

Does Triton work on GTX 1080 or RTX 2060?

GTX 10 series (Pascal) isn’t supported. RTX 20 and GTX 16 (Turing) only work with Triton 3.2, which officially pairs with PyTorch 2.6.

Does Triton work with AMD GPUs on Windows?

Yes. triton-windows supports RX 6000, 7000, 9000 and Strix Halo. You need a ROCm build of PyTorch for Windows (for example from AMD’s TheRock releases).

Will Triton make ComfyUI faster by itself?

No. Installing it does nothing until something uses it: SageAttention, the TorchCompileModel node or a custom node that needs it.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a brick-walled loft holding a tablet with a TRITON card, hook Triton on Windows