No module named 'sageattention' (starting with --use-sage-attention fails)
ComfyUI is supposed to start with SageAttention, but the package sageattention is not installed in its Python environment, so startup fails.
The message
To use the `--use-sage-attention` feature, the `sageattention` package must be installed first. / Can't import SageAttention: No module named 'sageattention'
Affects: ComfyUI
Why is this happening?
The startup option --use-sage-attention enables a faster compute path that needs an extra package. If it’s missing, ComfyUI shows the message and exits. On Windows, SageAttention also needs triton-windows, and the package must be installed as a matching wheel for your PyTorch version. Often the option was copied from a guide without installing the package.
How to fix it
- Fastest fix: remove
--use-sage-attentionfrom the startup line. Portable: openrun_nvidia_gpu.batin an editor. Desktop app: Manage → Startup Args. ComfyUI will then start with the normal compute path. - In current ComfyUI versions, you can use
--use-ck-attention(Comfy-Kitchen-Attention) instead. According to the Windows fork of SageAttention, you don’t need a separate SageAttention wheel for that. - If you still want SageAttention: first install
triton-windows(see the entry “No module named 'triton' on Windows”). - On the release page of woct0rdho/SageAttention, download the wheel that matches your PyTorch version (for example,
torch2.10.0andhigherin the filename). The Python version doesn’t matter withcp310-abi3; the main CUDA version (12 or 13) must match. - Install it with the Python that ComfyUI shows in the error message. Portable: run
.\python_embeded\python.exe -m pip install <path-to-file>.whlin theComfyUI_windows_portablefolder. With a venv (for example, Stability Matrix), use thepython.exein thevenv\Scriptsfolder. - Test it first with
test_sageattn.pyfrom the repository. If Wan or Qwen-Image then produce black or noisy images, use thePatchSageAttentionKJnode from KJNodes withsageattn_qk_int8_pv_fp16_cuda.
Better not: Don’t install SageAttention with a simple pip install in just any window — otherwise it ends up in the wrong Python and ComfyUI won’t find it.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- No module named 'triton' on Windows (triton-windows missing)
- Torch not compiled with CUDA enabled
- A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x – a package does not match the installed NumPy version
- ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied – pip cannot modify a file
- Failed building wheel for insightface (insightface for ReActor/IPAdapter FaceID won’t install)
Sources
- https://github.com/woct0rdho/SageAttention
- https://github.com/Comfy-Org/ComfyUI/blob/master/comfy/ldm/modules/attention.py
- https://github.com/Comfy-Org/ComfyUI/issues/9826
- https://github.com/triton-lang/triton-windows
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.