ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

SageAttention is not working for my ComfyUI Desktop

Open santaonholidays opened this issue 11 months ago • 21 comments

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 :)

santaonholidays avatar Feb 02 '25 20:02 santaonholidays

bump

santaonholidays avatar Feb 08 '25 18:02 santaonholidays

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.

ltdrdata avatar Feb 08 '25 22:02 ltdrdata

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

santaonholidays avatar Feb 09 '25 04:02 santaonholidays

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:

santaonholidays avatar Feb 10 '25 20:02 santaonholidays

Bump

santaonholidays avatar Feb 11 '25 18:02 santaonholidays

Have you seen this reddit post @santaonholidays

octaviodivy avatar Feb 11 '25 20:02 octaviodivy

Have you seen this reddit post @santaonholidays

That's where my problem is.Finding the update folder for the wheel

santaonholidays avatar Feb 12 '25 11:02 santaonholidays

Bump

santaonholidays avatar Feb 13 '25 13:02 santaonholidays

Bump

santaonholidays avatar Feb 15 '25 19:02 santaonholidays

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 !

Tapyon avatar Feb 15 '25 20:02 Tapyon

yeah sageattention2 doesn't work on windows I guess.

perobueno avatar Mar 28 '25 13:03 perobueno

same problem, pls help me, im just noob :(

zet556633 avatar Apr 02 '25 05:04 zet556633

Same error

Bump

ArtisteImprevisible avatar Apr 02 '25 22:04 ArtisteImprevisible

bump

serget2 avatar Apr 06 '25 18:04 serget2

Same here :))

efefek avatar Apr 17 '25 10:04 efefek

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.

Kdc1992 avatar May 04 '25 23:05 Kdc1992

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

angelofdev avatar May 28 '25 04:05 angelofdev

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

Djbone75 avatar Jun 12 '25 11:06 Djbone75

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 .venv folder (in my ComfyUI-Desktop folder)
  • For triton-windows:
    • .venv\Scripts\activate
    • pip 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.git
    • cd ./SageAttention
    • python.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"

machinellama avatar Aug 04 '25 02:08 machinellama

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.

StudioNirin avatar Sep 24 '25 17:09 StudioNirin

  • 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.

catshitz avatar Dec 26 '25 12:12 catshitz