What Sage Attention does and why you might want it
Sage Attention is a memory optimization tool that reduces how much RAM your graphics card needs when running image generation models in ComfyUI. Instead of storing all the attention calculations at once, it processes them in smaller chunks. This matters because many people hit out-of-memory errors when trying to run larger models or generate bigger images — Sage Attention often lets you do both without upgrading hardware.
The trade-off is speed. Sage Attention uses less VRAM but takes longer to generate images, sometimes 10 to 30 percent slower depending on your setup. Whether that trade-off makes sense depends on whether you're hitting memory limits now. If your current setup works fine, installing Sage Attention won't help you. If you're getting "CUDA out of memory" errors or "RuntimeError: CUDA out of memory", it's worth trying.
Key Takeaways
- Sage Attention is a custom node for ComfyUI that you install by cloning a GitHub repository into your ComfyUI custom_nodes folder.
- You need Git installed on your computer before you can clone the repository — Windows users should install Git for Windows, and Mac or Linux users usually have it already.
- After cloning, you restart ComfyUI and the node appears in the menu under "loaders" or "sampling" depending on your ComfyUI version.
- Sage Attention works best paired with other memory-saving techniques like lower precision (fp16) or smaller batch sizes, not as a standalone fix.
Before you install: check what you have
Sage Attention works on Windows, Mac, and Linux, but it only helps if you're using a GPU (graphics card) that supports CUDA or similar acceleration. If you're running ComfyUI on CPU only, Sage Attention won't make a difference. You can check what ComfyUI is using by looking at the startup messages in your terminal — it will say something like "Using CUDA device" or "Using CPU".
You also need to know whether you're running ComfyUI as a standalone installation (where you downloaded a folder and run a batch file or shell script) or as a Python environment you manage yourself. The installation steps are the same, but the folder paths differ. If you're not sure, look for a folder called custom_nodes inside your ComfyUI directory — that's where you'll put Sage Attention.
Install Git if you don't have it
Sage Attention lives in a GitHub repository, and the easiest way to get it is using Git, a version control tool. On Windows, read and install Git for Windows from git-scm.com. Choose the default options during installation. On Mac, open Terminal and run git --version — if it's not installed, your system will prompt you to install Xcode Command Line Tools, which includes Git. On Linux, use your package manager: sudo apt install git on Ubuntu or Debian, or the equivalent for your distribution.
After installation, open a terminal or command prompt and type git --version to confirm it worked. You should see a version number like "git version 2.40.0" or similar.
Clone the Sage Attention repository
Open a terminal or command prompt and navigate to your ComfyUI custom_nodes folder. On Windows, that's usually C:\Users\YourUsername\ComfyUI\custom_nodes or wherever you installed ComfyUI. On Mac or Linux, it's typically ~/ComfyUI/custom_nodes. Use the cd command to get there — for example, cd C:\Users\YourUsername\ComfyUI\custom_nodes on Windows.
Once you're in the custom_nodes folder, run this command:
git clone https://github.com/comfyanonymous/ComfyUI_experiments.git
Git will create a new folder called ComfyUI_experiments and read the files. This takes a minute or two depending on your internet speed. When it finishes, you'll see a message like "Receiving objects: 100%".
Restart ComfyUI and enable the node
Close ComfyUI completely if it's running. Then start it again using your normal method — the batch file on Windows, or the shell script on Mac or Linux. When ComfyUI loads, it scans the custom_nodes folder and registers any new nodes it finds. You should see a message in the terminal saying something like "Loaded custom node class SageAttention".
In the ComfyUI web interface, right-click on the canvas and search for "Sage" or "attention". You should see a node called Sage Attention or similar. If you don't see it, check that the ComfyUI_experiments folder actually exists in your custom_nodes directory, and try restarting ComfyUI again. Sometimes it takes two restarts to register new nodes.
How to use Sage Attention in your workflow
Sage Attention is not a standalone node — you add it to an existing image generation workflow. In most setups, you place it between your model loader and your sampler (the node that actually generates the image). The exact position depends on your workflow, but the principle is the same: Sage Attention intercepts the attention calculations and processes them more efficiently.
Start by generating an image with your normal workflow. If it works without errors, you probably don't need Sage Attention. If you get an out-of-memory error, add the Sage Attention node and try again. You may also need to lower your batch size (how many images you generate at once) or switch to fp16 precision to see real improvement. Sage Attention works best when combined with other memory-saving techniques, not used alone.
Troubleshooting common problems
If you see "git: command not found" when you try to clone, Git didn't install correctly. Restart your computer and try the installation again. If you're on Windows and still get the error, make sure Git for Windows is in your system PATH — you may need to uninstall and reinstall it, choosing the option to add Git to PATH during setup.
If ComfyUI doesn't recognize the Sage Attention node after restart, check that the ComfyUI_experiments folder is actually inside your custom_nodes directory, not nested deeper. Also verify that you cloned into the right place by looking at the folder structure — you should see ComfyUI/custom_nodes/ComfyUI_experiments/, not ComfyUI/custom_nodes/ComfyUI/custom_nodes/ComfyUI_experiments/. If the nesting is wrong, move the ComfyUI_experiments folder up one level and restart.
If Sage Attention loads but your images still run out of memory, the problem may be that your model is too large for your GPU even with Sage Attention. Try a smaller model, lower resolution, or smaller batch size. Sage Attention helps, but it's not a magic fix for hardware that's genuinely too small for the task.
Frequently Asked Questions
Do I need Sage Attention if I'm not getting memory errors?
No. Sage Attention slows down image generation to save memory. If your current setup works without errors, installing it will only make generation slower without any benefit. Only use it if you're hitting memory limits.
Will Sage Attention work with my AMD or Intel GPU?
Sage Attention is designed for NVIDIA GPUs using CUDA. AMD GPUs use different acceleration (ROCm), and Intel GPUs use their own tools. Check the ComfyUI documentation for your specific GPU type to find the right memory optimization for your hardware.
How much slower will my images be with Sage Attention?
Speed varies widely depending on your model size, image resolution, and GPU. Most users report 10 to 30 percent slower generation, but some see larger slowdowns with very large models. The only way to know is to test it with your own setup and compare generation times.
Can I uninstall Sage Attention if I don't like it?
Yes. straightforward delete the ComfyUI_experiments folder from your custom_nodes directory and restart ComfyUI. The node will disappear from your interface, and your workflows will use the standard attention method again.
What's the difference between Sage Attention and other memory-saving options?
Sage Attention is one approach among several. Other options include switching to fp16 precision, using smaller batch sizes, or enabling xFormers (another memory optimization). Different combinations work better for different hardware and models — you may need to experiment to find what works best for you.