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.
This commit is contained in:
clsferguson 2025-09-21 21:03:24 -06:00 committed by GitHub
parent fb64caf236
commit 051c46b6dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"]