From 051c46b6dced57d95b86936e949e9f8b81cc8333 Mon Sep 17 00:00:00 2001 From: clsferguson <48876201+clsferguson@users.noreply.github.com> Date: Sun, 21 Sep 2025 21:03:24 -0600 Subject: [PATCH] feat(build,docker): bake SageAttention 2.2 from source and enable in ComfyUI with --use-sage-attention Adds a multi-stage Docker build that compiles SageAttention 2.2/2++ from the upstream repository head into a wheel using nvcc, then installs it into the slim runtime to keep images small. Ensures the builder installs the same Torch CUDA 12.9 stack as the runtime so the compiled extension ABI matches at load time. Shallow clones the SageAttention repo during build to always pull the latest version on each new image build. Updates the container launch to pass --use-sage-attention so ComfyUI enables SageAttention at startup when the package is present. This change keeps the runtime minimal while delivering up-to-date, high-performance attention kernels for modern NVIDIA GPUs in ComfyUI. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6b8e36da7..e8739d1da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,4 +50,4 @@ EXPOSE 8188 # Start as root so entrypoint can adjust ownership and drop privileges USER root ENTRYPOINT ["/entrypoint.sh"] -CMD ["python", "main.py", "--listen", "0.0.0.0"] +CMD ["python", "main.py", "--listen", "0.0.0.0", "--use-sage-attention"]