Guide to Installing Triton and Sage Attention in comfyui windows portable
anon
465
2025-02-26 11:15

GPU requirement


You will need RTX 30xx or newer Nvidia GPU series


Install CUDA 12.6 toolkit from with below link


https://developer.nvidia.com/cuda-toolkit-archive


If you open a new terminal, type ptxas --version, and it shows your CUDA version like Cuda compilation tools, release 12.6, V12.6.85, then you're doing right



MSVisualSTUDIO


Head to this site and download Visual Studio 2022 BuildTools


run the installer and select desktop development with C++


  • make sure to select the these



SYSTEM ENVIRONMENTS


you need to add the path containing cl.exe to the Windows PATH


  • Search for "Edit system environment variables" or "Environment Variables"


  • Click on "Environment Variables" button in the System Properties window


  • Find the "Path" variables in System variables (bottom section)


  • To add a new variable, click "New", paste C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64


Change the version numbers according to your installation, and make sure this folder accually exists on your computer


If you open a new terminal, type cl, and it shows Microsoft (R) C/C++ Optimizing Compiler ..., then you're doing right


VCRunTime


Donwload https://aka.ms/vs/17/release/vc_redist.x64.exe  and run the installer


Search vcruntime140.dll and vcruntime140_1.dll with file explorer


There should be a folder python_embeded in your ComfyUI installation path


open the python_embeded folder and manually copy vcruntime140.dll and vcruntime140_1.dll and paste into the Scripts folder


TRITON


https://github.com/woct0rdho/triton-windows/releases/download/v3.0.0-windows.post1/python_3.12.7_include_libs.zip


Download zip files and put two folders include and libs into folder python_embeded to make Triton work


(Be careful: It is 'libs', not 'lib'. The folder Lib should already exist in python_embeded)


Finally open your terminal inside python_embeded folder and type


.\python.exe -m pip install https://github.com/woct0rdho/triton-windows/releases/download/v3.2.0-windows.post10/triton-3.2.0-cp312-cp312-win_amd64.whl
.\python.exe -m install sageattention


SAGE attention


open run_nvidia_gpu.bat file with notepad and add --use-sage-attention in command line arguments like this


.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --use-sage-attention


Enjoy!

1
#💬
#🖼️
😭
4️⃣0️⃣4️⃣ ¯\_(ツ)_/¯
🤔 ❌📄
🤔 🛠️🖥