ComfyUI 修复 SageAttention 报错指南:解决 MiniMax H3 Memory Efficient Sage Attention Patch 安装失败问题
Windows Portable 环境安装 Triton + SageAttention 2.2.0 完整教程
问题描述
在使用 ComfyUI 运行 MiniMax H3 工作流时,如果添加:
MiniMax H3 Memory Efficient Sage Attention Patch
节点,可能会出现以下错误:
[ERROR] !!! Exception during processing !!!
sageattention is not new enough version or could not determine CUDA architecture,
cannot apply MiniMax H3 Memory Efficient Sage Attention Patch.
错误原因通常包括:
- 当前环境没有安装 SageAttention
- SageAttention 版本过低
- Triton 版本不兼容
- CUDA 架构无法识别
MiniMax H3 的 Memory Efficient Sage Attention Patch 依赖较新的 SageAttention 版本,因此需要手动安装。
解决方案
1. 确认 ComfyUI Python 环境
如果使用的是:
ComfyUI_windows_portable
需要使用 ComfyUI 自带 Python 环境。
目录结构通常类似:
ComfyUI_windows_portable
│
├── ComfyUI
├── python_embeded
├── models
└── run_nvidia_gpu.bat
后续所有 pip 命令都使用:
python_embeded\python.exe
不要直接使用系统 Python。
2. 安装 Triton Windows 版本
首先安装兼容版本的 Triton:
python_embeded\python.exe -m pip install -U "triton-windows<3.8"
说明:
- SageAttention 依赖 Triton 进行 GPU kernel 优化
- Windows 环境需要使用
triton-windows - 限制版本低于 3.8,避免版本兼容问题
3. 安装 SageAttention 2.2.0
执行:
python_embeded\python.exe -m pip install "https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post6/sageattention-2.2.0%2Bcu130torch2.10.0andhigher.post6-cp310-abi3-win_amd64.whl"
安装完成后,可以检查版本:
python_embeded\python.exe -m pip show sageattention
正常应该显示:
Name: sageattention
Version: 2.2.0
4. 重启 ComfyUI
关闭当前 ComfyUI:
Ctrl + C
重新启动:
run_nvidia_gpu.bat
再次运行 MiniMax H3 工作流。
如果安装成功:
MiniMax H3 Memory Efficient Sage Attention Patch
节点即可正常执行。
常见问题
Q:我的 ComfyUI 没有 python_embeded 怎么办?
Portable 版本一般包含:
ComfyUI_windows_portable
├── ComfyUI
├── python_embeded
├── models
└── run_nvidia_gpu.bat
如果只有:
python
可能是新版目录结构变化。
可以检查启动脚本:
run_nvidia_gpu.bat
里面实际调用的 Python 路径。
也可以执行:
where python
查看当前 Python 来源。
Q:为什么不用普通 pip install?
因为 ComfyUI Portable 使用独立 Python 环境。
例如:
错误方式:
pip install sageattention
可能安装到了:
C:\Python310\
而不是:
ComfyUI_windows_portable\python_embeded\
导致 ComfyUI 仍然无法找到 SageAttention。
正确方式:
python_embeded\python.exe -m pip install ...
确保安装到 ComfyUI 自己的 Python 环境。
验证安装
可以进入 ComfyUI Python 环境测试:
python_embeded\python.exe
执行:
import importlib.metadata
print(importlib.metadata.version("sageattention"))
如果输出:
2.2.0+cu130torch2.10.0andhigher.post6
说明安装成功。
总结
解决 ComfyUI SageAttention 报错,只需要三步:
第一步:安装 Triton
python_embeded\python.exe -m pip install -U "triton-windows<3.8"
第二步:安装 SageAttention 2.2.0
python_embeded\python.exe -m pip install "https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post6/sageattention-2.2.0%2Bcu130torch2.10.0andhigher.post6-cp310-abi3-win_amd64.whl"
第三步:重启 ComfyUI
完成后即可启用:
✅ SageAttention 2.2.0
✅ MiniMax H3 Memory Efficient Attention
✅ 更低显存占用
✅ 更快推理速度