ComfyUI ModuleNotFoundError: No module named 'sageattention'
Decide whether ComfyUI No module named 'sageattention' is a harmless startup warning or a workflow-blocking Wan/Hunyuan/LTX/Qwen error. Prefer SDPA/Comfy first, then check the exact Python, Triton, and SageAttention.
No module named 'sageattention' does not always mean you should install SageAttention.
For many ComfyUI users, it is only an optional acceleration warning. For video workflows such as WanVideoWrapper, HunyuanVideo, LTX, or Qwen Image, it can also be a real queue-time failure. This page helps you decide which case you are in before you change Python packages.
30-second triage
| What you see | What it usually means | Do this first |
|---|---|---|
| Startup warning, but ComfyUI opens and workflows run | Optional backend is unavailable | Ignore it or leave SageAttention disabled |
| Queue fails inside WanVideoWrapper, HunyuanVideo, LTX, or Qwen Image | The workflow requested SageAttention | Switch the node backend to sdpa, comfy, torch, or auto |
You added --use-sage-attention | ComfyUI is being forced to use SageAttention globally | Remove the flag and restart |
No module named 'triton' appears too | Triton layer is missing or wrong | Fix Triton before SageAttention |
DLL load failed while importing _fused | A wheel was installed but does not match Python/Torch/CUDA/GPU | Stop reinstalling; roll back or choose a matching build |
sageattention is not new enough version or could not determine cuda architecture, cannot apply ... memory efficient sage attention patch | The installed SageAttention cannot be verified or is too old for the workflow's patch | Update SageAttention for your Torch/CUDA, or disable the patch and use sdpa/comfy attention |
unsupported head_dim: 256, using pytorch attention instead | ComfyUI fell back to PyTorch attention | Usually not fatal unless the workflow stops |
Step 1: decide whether this is a warning or a workflow failure
If the log only says:
[WARNING] Warning: Could not load sageattention: No module named 'sageattention'
[WARNING] sageattention package is not installed, sageattention will not be availableand ComfyUI still reaches the browser UI, this is usually not an emergency.
SageAttention is an optional attention acceleration backend. ComfyUI and many workflows can run with sdpa, comfy, torch, or auto.
Stay on this page if the workflow actually stops, especially with a traceback around video or attention nodes.
sageattention is not new enough version ... cannot apply minimax h3 memory efficient sage attention patch
If that is the exact log, this page is the wrong owner. Confirm ComfyUI still queues, then use the MiniMax H3 setup guide. Stay here only for No module named 'sageattention'.
sageattention is not new enough version ... cannot apply ltx2 memory efficient sage attention patch
If that is the exact log, this page is the wrong owner. Confirm ComfyUI still queues, then use the LTX-2 setup guide. Stay here only for No module named 'sageattention'.
Step 2: disable SageAttention before installing anything
Most users should first remove the forced SageAttention path.
If you added a launch flag
Remove:
--use-sage-attentionRestart ComfyUI.
If the workflow node has an attention backend dropdown
Open the model loader, video wrapper, or attention-related node and change:
sageattn
sageattention
SageAttentionto one of:
sdpa
comfy
torch
autoThen queue the workflow again.
For WanVideoWrapper and video workflows
Many Wan/Hunyuan/LTX/Qwen video workflows expose an attention backend option. If switching to sdpa or comfy makes the workflow run, you do not need SageAttention to fix the current job.
Step 3: confirm the exact Python ComfyUI uses
Installing into the wrong Python is the most common reason this error keeps coming back.
Windows Portable
Open PowerShell in the ComfyUI_windows_portable folder:
.\python_embeded\python.exe -s -c "import sys; print(sys.executable)"
.\python_embeded\python.exe -s --versionThe path should point to the current portable folder:
ComfyUI_windows_portable\python_embeded\python.exeUse this same interpreter for every later pip show, install, uninstall, and verification command.
Manual venv
Activate the venv that starts ComfyUI, then run:
python -c "import sys; print(sys.executable)"
python --versionMake sure it is not system Python, Conda, or Windows Store Python.
Finding the path in Wonderful Launcher
If you manage ComfyUI with Wonderful Launcher, the current instance startup log often shows the launch command or Python path near the beginning. Search for python.exe, python_embeded, or the launch command. If the full path is not shown, run the commands above inside the actual ComfyUI folder.
Step 4: check Triton without mixing up package names
SageAttention on Windows often depends on Triton.
The Windows distribution package is usually:
triton-windowsbut the Python import is still:
import tritonWindows Portable
.\python_embeded\python.exe -s -m pip show triton-windows
.\python_embeded\python.exe -s -c "import triton; print(triton.__version__)"Manual venv
python -m pip show triton-windows
python -c "import triton; print(triton.__version__)"If import triton fails, do not continue reinstalling SageAttention. Fix the Triton layer first:
Triton missing or unavailable in ComfyUI
Step 5: decide whether installing SageAttention is worth it
Install SageAttention only if at least one of these is true:
- the workflow has no
sdpa,comfy,torch, orautoalternative; - the node or workflow author explicitly requires SageAttention;
- you are intentionally optimizing a video workflow and are ready to handle Python/Torch/CUDA/Triton compatibility.
Do not install it just because a startup warning exists.
Avoid installing when:
torch.cuda.is_available()is false;- you cannot identify the Python ComfyUI actually uses;
- you cannot find a build that matches Python, PyTorch, CUDA, and GPU architecture;
- the workflow runs correctly after switching to
sdpaorcomfy.
Step 6: if you must install it, record the environment and use the install guide
Windows does not have one universal SageAttention command for every ComfyUI environment.
Before installing, record:
nvidia-smiWindows Portable
.\python_embeded\python.exe -s --version
.\python_embeded\python.exe -s -m pip freeze > sageattention-before.txt
.\python_embeded\python.exe -s -c "import torch; print(torch.__version__); print(torch.version.cuda); print(torch.cuda.is_available())"Manual venv
python --version
python -m pip freeze > sageattention-before.txt
python -c "import torch; print(torch.__version__); print(torch.version.cuda); print(torch.cuda.is_available())"When selecting any wheel, use torch.version.cuda, not the top-level CUDA version shown by nvidia-smi.
Then continue here:
Install SageAttention in Windows ComfyUI
Return to this page for Step 7 after the install guide passes.
Step 7: after installation, verify it in the same Python
Do not rely only on Successfully installed.
Windows Portable
.\python_embeded\python.exe -s -m pip show sageattention
.\python_embeded\python.exe -s -c "from sageattention import sageattn; print('SageAttention OK')"Manual venv
python -m pip show sageattention
python -c "from sageattention import sageattn; print('SageAttention OK')"Then restart ComfyUI and queue the original workflow again.
If the log changes from No module named 'sageattention' to DLL load failed while importing _fused, this is not progress. It means the installed build does not match the runtime. Roll back or choose a compatible build.
If the repair still fails
| New symptom | Likely cause | Next step |
|---|---|---|
pip install succeeded but ComfyUI still says missing | Installed into the wrong Python | Repeat Step 3 and reinstall into the exact interpreter |
No module named 'triton' | Triton is missing or wrong | Fix Triton first |
DLL load failed while importing libtriton | Triton binary or runtime issue | Use the Triton guide |
DLL load failed while importing _fused | SageAttention wheel mismatch | Uninstall that build and return to SDPA/Comfy |
unsupported head_dim | Current model shape is not supported by the selected backend | Use PyTorch/SDPA/Comfy attention |
| black images or CUDA errors | Kernel/runtime mismatch | Disable SageAttention and roll back |
Safe rollback
First disable the workflow or launch setting:
--use-sage-attentionSwitch the node backend back to:
sdpa
comfy
torch
autoUninstall SageAttention from the same Python:
Windows Portable
.\python_embeded\python.exe -s -m pip uninstall sageattention -yManual venv
python -m pip uninstall sageattention -yDo not blindly uninstall triton-windows if it existed before this repair. Compare against sageattention-before.txt first.
Why reinstalling ComfyUI usually does not help
This error usually belongs to the runtime package layer, not the workflow JSON itself.
Reinstalling ComfyUI can still leave you with:
- the wrong Python environment;
- the same missing Triton layer;
- the same incompatible wheel;
- the same workflow forcing SageAttention;
- the same GPU/PyTorch/CUDA mismatch.
Fix the decision path first: warning or fatal, forced or optional, correct Python or wrong Python, Triton valid or broken, install required or unnecessary.
What SageAttention is
SageAttention is an optimized attention backend used by some large image and video workflows. In ComfyUI it is not a universal dependency.
If a workflow runs with SDPA, Comfy, or PyTorch attention, you can usually keep working without SageAttention. If a specific node forces SageAttention, treat it as a native acceleration stack that must match Python, PyTorch, CUDA, Triton, Windows, and GPU architecture.
FAQ
Can I ignore No module named 'sageattention'?
Yes, if ComfyUI starts and your workflow still runs. It is often only an optional acceleration warning.
Why did pip install sageattention not fix it?
Usually because it installed into the wrong Python, installed the wrong SageAttention version, or did not fix the Triton/CUDA layer.
Should I install triton or triton-windows?
On Windows ComfyUI, use the current Triton Windows guidance. The package name is often triton-windows, while the import remains import triton.
Does Wonderful Launcher fix this automatically?
Wonderful Launcher can help you preserve environment context, read startup logs, and avoid guessing the wrong Python path. It does not make every SageAttention/Triton wheel compatible with every Python, PyTorch, CUDA, and GPU combination.
Related guides
- Install SageAttention in Windows ComfyUI
- SageAttention is not new enough version — MiniMax H3
- SageAttention is not new enough version — LTX-2
- Triton missing or unavailable in ComfyUI
- ComfyUI plugin import failed
- ComfyUI dependency conflicts
- ComfyUI startup failed
Source references
- SageAttention official GitHub repository
- SageAttention PyPI page
- ComfyUI command-line arguments
- ComfyUI issue: SageAttention installed into the wrong Python
- WanVideoWrapper issue: model loading cannot find SageAttention
- ComfyUI issue: SageAttention DLL load failed
- triton-windows PyPI page
- Triton Windows current project
- Triton Windows historical repository
- NVIDIA CUDA Toolkit, Driver, and Architecture Matrix
Start free with Wonderful Launcher if this affects your real ComfyUI environment. It keeps launcher-native repair, task logs, and runtime checks in one place; credits are only for image generation and metered tools.
Download Wonderful LauncherSee credit packagesDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.