SageAttention is not working for my ComfyUI Desktop
I greet you Ladies and Gentleman,
Today i came to the conclusion to fix my Sageattention which is not working.I had the Issue where i tried a custom Workflow Image to Video with Hunyuan. But the problem is that i can only use comfy and sdpa,flash attention and sageattention are not working for me.I tried to manually install Sageattention and dropped it onto my file and it did not work. I asked alot of Discord Groups and i didnt got any help and thats why im writing this Issue on Github.
Best Regards :)
bump
If you provide no information other than simply saying that it doesn't work, no one will be able to help you.
Your execution environment, ComfyUI version, CLI options, full logs, and workflow—
all of these are necessary.
ComfyUI version v0.3.14
Traceback (most recent call last):
File "C:\Users\santa\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 327, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\santa\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 202, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\santa\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 174, in _map_node_over_list
process_inputs(input_dict, i)
File "C:\Users\santa\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 163, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI\custom_nodes/ComfyUI-HunyuanVideoWrapper\nodes.py", line 297, in loadmodel
raise ValueError(f"Can't import SageAttention: {str(e)}")
ValueError: Can't import SageAttention: No module named 'triton.language'
WTF are CLI options?
and ANY sageattention node i try does not work
Update: I almost made it but the next step is
Put the wheel on the ComfyUI_windows_portable\update folder
ComfyUI Desktop Version is the type of app where i cant find the folder,i need help c:
Bump
Have you seen this reddit post @santaonholidays
Have you seen this reddit post @santaonholidays
That's where my problem is.Finding the update folder for the wheel
Bump
Bump
bump !!! jejje.. im here too ! i know im the noob here around , but trying to understand some of this POSTs, or you have the worst dude trying to explain something like if im working in GOOGLE as the CEO OF PROGRAMMERS, or you have the dude that explain it PERFECT , but leave some empty step or information, making the other perfection for garbage, like if it was for fun ....
hope i can fix this.. and come back to help guys !
yeah sageattention2 doesn't work on windows I guess.
same problem, pls help me, im just noob :(
Same error
Bump
bump
Same here :))
Same here, iv spent hours doing everything, and it even lists sage v1 and triton as installed but cannot manage to get sage 2 going and comfyui does not recognize sage 1 install.
Make sure you have Triton already installed (see https://github.com/comfyanonymous/ComfyUI/issues/7421#issuecomment-2763311543)
In the ComfyUI desktop open up the terminal and navigate to the .venv folder
run pip install SageAttention
the same here. Sageattention is installed .venv. It can see cuda, triton, sageattention 2.1 etc...
Name: sageattention
Version: 2.1.1
Summary: Accurate and efficient plug-and-play low-bit attention.
Home-page: https://github.com/thu-ml/SageAttention
Author: SageAttention team
Author-email:
License: Apache 2.0 License
Location: C:\ComfyUI.venv\Lib\site-packages
Requires:
Required-by:
But comfyui still don't see it.... I really don't understand
Leaving this here in case it helps anyone in the future:
- I'm using ComfyUI-Desktop (on Windows)
- I started with this tutorial
- Install Cuda 12.8.1 (make sure to update Windows environment path to point to bin and restart terminal)
- ComfyUI-Desktop already had python 3.12.9, so I didn't have to update that
- I didn't install Visual Studio build tools, but maybe I already had it installed
- I couldn't find the libs/include files mentioned there, so I got them from here (step 5), and added those folders inside the
.venvfolder (in my ComfyUI-Desktop folder)
- For triton-windows:
.venv\Scripts\activatepip install -U "triton-windows<3.4"(to match PyTorch 2.7 that came with ComfyUI-Desktop, more info here)- Use the test script from the repo to verify it installed correctly
- For SageAttention:
.venv\Scripts\activate(if you're not already in it)git clone https://github.com/thu-ml/SageAttention.gitcd ./SageAttentionpython.exe -s -m pip install . --no-build-isolation(pip install anything it says is missing, like torch - can take a while)
- Add to ComfyUI-Desktop startup:
- <ComfyUI-Desktop folder>/user/default/comfy.settings.json
- Find:
Comfy.Server.LaunchArgs - Add sage-attention:
"Comfy.Server.LaunchArgs": { "use-sage-attention": "" },and save file
If everything worked, then when you start ComfyUI-Desktop, the startup terminal will have a line like "using sage attention"
I spoke too soon. Unfortunately machinellama's guide doesn't work for sageattention. At least not anymore. Seems it now looks for a different python version than what is installed. Or something. Throws a terminal error anyway.
Add to ComfyUI-Desktop startup:
- <ComfyUI-Desktop folder>/user/default/comfy.settings.json
- Find:
Comfy.Server.LaunchArgs- Add sage-attention:
"Comfy.Server.LaunchArgs": { "use-sage-attention": "" },and save file
blessed for the final step, much comfyui desktop users suffered a lot to successfully installed sage but stuck at this final round, quite ironic thing is there isn't much info on the internet since the low popularity of the desktop app.