Installing and Enabling Sage Attention & Triton
This guide walks you through the complete process of both installing and enabling Sage Attention and Triton for ComfyUI. Following these steps will install the necessary components via a script and then configure your startup file to activate them for a significant performance boost.
Download
Sage Attention & Triton Installer Script
This script automates the installation of Sage Attention & Triton for your ComfyUI environment. Administrator rights are required.
How to Use
- Download and Place the Script:Download the installer script from the link above. Place the
.cmd
file directly inside your mainComfyUI_windows_portable
folder. This is the same folder that contains theComfyUI
,python_embeded
, andupdate
sub-folders. - Run the Installer:Right-click the downloaded script and select "Run as administrator". A command window will open and begin the installation process for Triton.
- Modify the Startup Script:Navigate to the
run_nvidia_gpu.bat
file. Right-click on it, select "Show more options" (on Windows 11), and then click "Edit". A notepad window will open. - Add Startup Arguments to Enable:At the end of the line that starts with
.\python_embeded\python.exe...
, add the arguments--fast --use-sage-attention
. The final two lines of your file should look exactly like this:.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast --use-sage-attention pause
- Ready to Go:Save and close the notepad file. You can now run
run_nvidia_gpu.bat
normally. ComfyUI will launch with Sage Attention and Triton enabled.