ModuleNotFoundError: No module named 'sageattention' in ComfyUI
Fix or ignore ModuleNotFoundError: No module named 'sageattention' in ComfyUI, including WanVideoWrapper warnings, wrong Python, Triton, and CUDA wheel mismatches.
Start with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.
Download Wonderful LauncherIf you searched for ModuleNotFoundError: No module named 'sageattention', comfyui no module named sageattention, or ComfyUI prints No module named 'sageattention', do not reinstall ComfyUI immediately.
In many setups this is only a performance warning: ComfyUI can keep running with PyTorch attention. Fix it only when a workflow, custom node, or launch flag actually requires SageAttention.
30-second decision
If ComfyUI opens and your workflow runs, ignore the missing SageAttention warning. If WanVideoWrapper, a video workflow, or a launch command with --use-sage-attention fails, repair SageAttention in the exact Python environment that starts ComfyUI.
Quick Answer
| What You See | Meaning | Best Action |
|---|---|---|
| ComfyUI starts and opens normally | SageAttention is optional in this environment | Ignore it |
| ComfyUI starts but a video or acceleration node complains | A custom node tried to use SageAttention | Check that node's requirements |
You launched with --use-sage-attention | You explicitly told ComfyUI to use it | Install it or remove the flag |
pip install succeeds but the warning remains | Installed into the wrong Python | Use ComfyUI's bundled Python |
| Wheel install fails with CUDA or Torch mismatch | The wheel does not match your stack | Pick a matching wheel or skip it |
What the Error Looks Like
You may see one of these messages in the terminal:
ModuleNotFoundError: No module named 'sageattention'Warning: Could not load sageattention: No module named 'sageattention'The first serious question is not "how do I install it?" The first question is whether ComfyUI still starts.
If the web UI opens and generations run, this message is not the root problem you need to solve.
What SageAttention Is
SageAttention is an attention acceleration project. Its authors describe it as a plug-and-play implementation for SageAttention, SageAttention2, and SageAttention2++.
ComfyUI also has a launch option named --use-sage-attention. That option asks ComfyUI to use SageAttention as the attention backend. If the Python package is not installed, the import fails.
Most ComfyUI users do not need to force this backend. PyTorch attention is the safer default when you are trying to get a stable environment.
How Triton Fits Into SageAttention Errors
SageAttention is the feature users usually want. Triton is often the dependency that makes the Windows repair path confusing.
If the log only says No module named 'sageattention', stay on this page first. Decide whether SageAttention is optional, whether you added --use-sage-attention, and whether you installed into the correct Python.
If the log says No module named 'triton', triton_key, tcc.exe, or a Triton compiler error after installing SageAttention, switch to ComfyUI No Module Named 'triton'. On Windows, that path should use triton-windows and ComfyUI's exact Python environment.
The practical order is:
- Get ComfyUI starting normally without optional acceleration flags.
- Confirm CUDA-enabled PyTorch works in the same Python.
- Fix Triton only if the SageAttention workflow still needs it.
- Verify SageAttention import after Triton is working.
Step 1: Check Whether ComfyUI Still Runs
If the terminal reaches a line like this, the missing SageAttention package is probably not fatal:
To see the GUI go to: http://127.0.0.1:8188Open:
http://127.0.0.1:8188Then run a small default workflow. If it works, leave SageAttention alone for now.
Recovery rule
Do not install acceleration libraries while debugging a broken ComfyUI environment unless the missing package is the first fatal error.
Step 2: Remove the Flag If You Added It
Check your launch command or .bat file. If you see this flag:
--use-sage-attentionremove it and restart ComfyUI.
That is the lowest-risk fix. The flag is useful only when your Python, PyTorch, CUDA, GPU, and SageAttention build all match.
Step 3: Make Sure You Are Using the Right Python
The most common failed fix is installing SageAttention into system Python while ComfyUI uses a different embedded Python.
For a Windows portable package, run package checks with the bundled Python:
.\python_embeded\python.exe -s -m pip show sageattention
.\python_embeded\python.exe -s -m pip show torchFor a manual install, activate the same virtual environment you use to start ComfyUI:
python -m pip show sageattention
python -m pip show torchThen check the runtime:
python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"If this prints False for CUDA availability, fix PyTorch first. SageAttention will not solve a CPU-only PyTorch install.
Step 4: Decide Whether Installation Is Worth It
Install SageAttention only when at least one of these is true:
- a workflow or custom node explicitly requires it
- you intentionally enabled
--use-sage-attention - you are tuning a heavy video or large-model workflow after the environment is already stable
- you know your GPU, CUDA, PyTorch, and Python versions
Skip it when:
- ComfyUI works and this is only a warning
- you are still fixing startup, custom node, or dependency errors
- you are on an old GPU or CPU-only setup
- you cannot identify which Python environment ComfyUI is using
Step 5: Install Only a Matching Build
SageAttention includes CUDA kernels. On Windows, a plain install may try to compile native code or fail because the build does not match your stack.
Before installing anything, record:
| Check | Command |
|---|---|
| GPU and driver | nvidia-smi |
| PyTorch and CUDA | python -c "import torch; print(torch.__version__, torch.version.cuda)" |
| Python version | python --version |
| ComfyUI launch Python | Inspect the .bat file or activated venv |
Then use a package or wheel that explicitly matches those versions. Do not mix a CUDA 12.8 wheel into a CUDA 12.6 PyTorch environment and expect it to behave.
Step 6: Verify Before Restarting ComfyUI
After installation, verify in the same Python environment:
python -c "from sageattention import sageattn; print('SageAttention OK')"If that command fails, ComfyUI will fail too. Fix the import before restarting the server.
Common Failure Cases
| Error | Likely Cause | Fix |
|---|---|---|
No module named 'sageattention' after install | Installed into the wrong Python | Use ComfyUI's Python or venv |
No module named 'triton' | A dependency path is missing | On Windows, use triton-windows with ComfyUI's Python |
| C++ build tools error | The package is compiling native code | Use a compatible prebuilt wheel or skip SageAttention |
| CUDA version mismatch | Wheel and PyTorch CUDA differ | Match the wheel to your PyTorch build |
| ComfyUI worked before installing it | Acceleration package destabilized the environment | Remove it and return to PyTorch attention |
If the blocking error is actually No module named 'triton', fix that first with ComfyUI No Module Named 'triton'. On Windows, the normal triton package is not the safe repair path; use the triton-windows package and the same Python that launches ComfyUI.
When Reinstalling ComfyUI Is the Wrong Move
This error often appears next to other warnings. Reinstalling ComfyUI can make the environment messier if the real issue is:
- a custom node dependency conflict
- a package installed into the wrong Python
- CPU-only PyTorch
- mismatched CUDA and driver versions
- a launch flag copied from another machine
Use ComfyUI Dependency Conflicts or How to Fix ComfyUI Plugin Import Failed Errors if several packages are failing at once.
How Wonderful Launcher Helps
Wonderful Launcher is useful when the issue is no longer one clean package install:
- it keeps ComfyUI environments separated
- it makes startup logs easier to collect
- it helps preserve models and workflows before risky repairs
- it gives you a clearer recovery path than reinstalling everything
If your ComfyUI only shows a harmless SageAttention warning, you do not need a repair session. If the same environment also has custom node import errors, PyTorch/CUDA mismatch, or repeated startup failures, start from ComfyUI Common Issues.
FAQ
Why does WanVideoWrapper say No module named 'sageattention'?
WanVideoWrapper and other video workflows may try to use SageAttention as an acceleration backend. If the workflow fails because of that import, repair SageAttention or switch the workflow/settings back to a non-SageAttention path.
Should I install SageAttention for ComfyUI Desktop?
Only if the Desktop environment and the workflow actually require it. Use the app's managed environment or terminal tools; do not assume a portable python_embeded folder exists.
What if the error changes to No module named 'triton'?
That means the repair has moved lower in the acceleration stack. On Windows, follow the Triton missing guide and use the Python environment that launches ComfyUI.
Related Guides
- ComfyUI Dependency Conflicts
- ComfyUI No Module Named 'triton'
- How to Fix ComfyUI Plugin Import Failed Errors
- GPU Compatibility
- ComfyUI Startup Failed? How to Diagnose and Recover Faster
Source References
Start with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.
Download Wonderful LauncherStart with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.
Download Wonderful LauncherDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.
Triton Missing
Fix ModuleNotFoundError: No module named 'triton' in ComfyUI by separating harmless comfy_kitchen logs from blocking workflow or SageAttention failures.
InsightFace Missing
Fix No module named 'insightface' in ComfyUI for ReActor, IPAdapter FaceID, InstantID, PuLID, and other face-swap or face-analysis nodes on Windows.