Triton & SageAttention Installer for ComfyUI (PowerShell 7)

Install-SageAttention-Windows-Comfyui

Install-SageAttention.ps1 script requires PowerShell 7.0 or later (due to modern features like better module handling)

pwsh -ExecutionPolicy Bypass -File ".\Install-SageAttention.ps1" -CreateBatRunner

Download PowerShell 7.0 +:

Download the Installer:

  • Go to the official GitHub releases page: PowerShell Releases.
  • Scroll to the latest stable version (e.g., 7.5.x look for the top “Latest” tag).
  • Under “Assets,” download the .msi file for your architecture: PowerShell-7.5.x-win-x64.msi (for 64-bit) Windows.

PS D:\ComfyUI> pwsh -ExecutionPolicy Bypass -File ".\Install-SageAttention.ps1" -CreateBatRunner

▶ Preflight
  ✓ Python: 3.13.9  (cp313)
  ✓ Torch: 2.9.0+cu130 (CUDA 13.0, available=True)
  ! CUDA Toolkit (nvcc) (optional): not found
  • GPU/Driver: NVIDIA GeForce RTX 4070, 581.57

▶ Triton prerequisites
  ✓ Triton prerequisite: Python headers & libs already present.

▶ Install plan

▶ Triton
  • Constraint: triton-windows<3.4
  • Removing previous Triton (if any) …
  • Installing Triton …
  ✓ Triton ready.

▶ SageAttention
  • Removing existing SageAttention …

▶ SageAttention
  • Selecting a compatible wheel (Torch 2.9.0, CUDA cu130, Python 3.13) …

▶ Fetch wheels.json
  • URL: https://raw.githubusercontent.com/wildminder/AI-windows-whl/refs/heads/main/wheels.json
  ✓ Saved wheels.json → .\aiwheels_index.json
  ✓ Wheel selected: sageattention-2.2.0.post3+cu130torch2.9.0-cp313-cp313-win_amd64.whl
  • Installing SageAttention …
  ✓ SageAttention installed.

▶ Run shortcuts
  ✓ Created: .\run_nvidia_gpu_sageattention.bat

▶ Verify
  ✓ torch import OK (2.9.0+cu130)
  ✓ sageattention import OK ()
  • CUDA runtime: 13.0, available: True

▶ Done
  ✓ Installation finished.
  • Start ComfyUI with SageAttention:
    .\run_nvidia_gpu_sageattention.bat
    or: python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --use-sage-attention
PS D:\ComfyUI>

Sage Attention Installed Successfully on ComfyUI Setup

Launch & Test It Out

  1. Fire It Up:
  • Double-click .\run_nvidia_gpu_sageattention.bat in D:\ComfyUI (runs with --use-sage-attention baked in).
  • Or manual: python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --use-sage-attention