The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
Go to file
Claude 234caeed32
Restore SageAttention, fix gpus syntax, and clean up entrypoint
SageAttention research confirms it remains useful (2-5x speedup over FA,
active development through SA3, broad community adoption for video/HR).
Restore it as an opt-in startup-compiled feature (FORCE_SAGE_ATTENTION=1).

Entrypoint is cleaned up vs the original: simplified GPU probe (drops
per-arch flag exports, keeps what's needed for strategy selection),
cleaner build logic with merged clone/update paths, removed dead code.

- Dockerfile: restore SAGE_ATTENTION_AVAILABLE=0 default env var
- entrypoint.sh: simplified but functionally equivalent SageAttention
  support; removes ~150 lines of redundant per-arch flag tracking
- README: fix docker-compose gpus syntax to 'gpus: all'; restore
  SageAttention docs with accurate description of behavior

https://claude.ai/code/session_01WQc56fWdK329K11kRGnb5g
2026-03-27 12:40:33 +00:00
.ci Add helpful message to portable. (#11671) 2026-01-06 14:43:24 -05:00
.github Fix Docker build failures and workflow publish bug; remove SageAttention 2026-03-27 12:31:01 +00:00
alembic_db feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
api_server Fix: filter hidden files from /internal/files endpoint (#11191) 2025-12-10 21:49:49 -05:00
app fix: atomic writes for userdata to prevent data loss on crash (#12987) 2026-03-16 21:56:35 -04:00
blueprints fix: set default values of Color Adjustment node to zero (#13084) 2026-03-24 14:22:30 -04:00
comfy FP8 bwd training (#13121) 2026-03-24 20:39:04 -04:00
comfy_api CURVE node (#12757) 2026-03-24 17:47:28 -04:00
comfy_api_nodes feat(api-nodes): update xAI Grok nodes (#13140) 2026-03-24 13:27:39 -07:00
comfy_config Add new fields to the config types (#8507) 2025-06-18 15:12:29 -04:00
comfy_execution Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
comfy_extras FP8 bwd training (#13121) 2026-03-24 20:39:04 -04:00
custom_nodes update example_node to use V3 schema (#9723) 2025-10-02 15:20:29 -07:00
input LoadLatent and SaveLatent should behave like the LoadImage and SaveImage. 2023-05-18 00:09:12 -04:00
middleware fix: use no-store cache headers to prevent stale frontend chunks (#12911) 2026-03-14 18:25:09 -04:00
models HunyuanVideo 1.5 (#10819) 2025-11-20 22:44:43 -05:00
output Initial commit. 2023-01-16 22:37:14 -05:00
script_examples Update comment in api example. (#9708) 2025-09-03 18:43:29 -04:00
tests feat: add text preview support to jobs API (#12169) 2026-02-28 21:38:19 -08:00
tests-unit Add Number Convert node (#13041) 2026-03-24 15:38:08 -07:00
utils refactor(assets): modular architecture + async two-phase scanner & background seeder (#12621) 2026-03-07 20:37:25 -05:00
.coderabbit.yaml chore: tune CodeRabbit config to limit review scope and disable for drafts (#12567) 2026-02-21 18:32:15 -08:00
.gitattributes Add Veo3 video generation node with audio support (#9110) 2025-08-05 01:52:25 -04:00
.gitignore add venv* to gitignore (#12431) 2026-02-16 22:16:19 -05:00
alembic.ini Add support for sqlite database (#8444) 2025-06-11 16:43:39 -04:00
CODEOWNERS Fix CODEOWNERS formatting to have all on the same line, otherwise only last line applies (#11053) 2025-12-02 11:46:29 -08:00
comfyui_version.py ComfyUI v0.18.1 2026-03-21 22:32:16 -04:00
CONTRIBUTING.md Add CONTRIBUTING.md (#3910) 2024-07-01 13:51:00 -04:00
cuda_malloc.py comfy-aimdo 0.2 - Improved pytorch allocator integration (#12557) 2026-02-21 10:52:57 -08:00
Dockerfile Restore SageAttention, fix gpus syntax, and clean up entrypoint 2026-03-27 12:40:33 +00:00
entrypoint.sh Restore SageAttention, fix gpus syntax, and clean up entrypoint 2026-03-27 12:40:33 +00:00
execution.py Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
extra_model_paths.yaml.example Update the extra_model_paths.yaml.example (#10319) 2025-10-12 23:54:41 -04:00
folder_paths.py feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00
hook_breaker_ac10a0.py Prevent custom nodes from hooking certain functions. (#7825) 2025-04-26 20:52:56 -04:00
latent_preview.py Support LTX2 tiny vae (taeltx_2) (#11929) 2026-01-21 23:03:51 -05:00
LICENSE Initial commit. 2023-01-16 22:37:14 -05:00
main.py Add warning for users who disable dynamic vram. (#13113) 2026-03-22 18:46:18 -04:00
manager_requirements.txt bump manager version to 4.1b8 (#13108) 2026-03-23 12:59:21 -04:00
new_updater.py Replace print with logging (#6138) 2024-12-20 16:24:55 -05:00
node_helpers.py feat: Support SCAIL WanVideo model (#12614) 2026-02-28 16:49:12 -05:00
nodes.py Add Number Convert node (#13041) 2026-03-24 15:38:08 -07:00
protocol.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
pyproject.toml ComfyUI v0.18.1 2026-03-21 22:32:16 -04:00
pytest.ini Execution Model Inversion (#2666) 2024-08-15 11:21:11 -04:00
QUANTIZATION.md Quantized Ops fixes (#10715) 2025-11-12 18:26:52 -05:00
README.md Restore SageAttention, fix gpus syntax, and clean up entrypoint 2026-03-27 12:40:33 +00:00
requirements.txt Update templates package version. (#13141) 2026-03-24 17:36:12 -04:00
server.py feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00

ComfyUI-Docker

An automated Repo for ComfyUI Docker image builds, optimized for NVIDIA GPUs.

AboutFeaturesGetting StartedUsageLicense


About

This image packages upstream ComfyUI with CUDA-enabled PyTorch and an entrypoint that handles volume permissions and custom node setup.

The base image is python:3.12-slim (Debian trixie) with CUDA 12.8 developer libraries installed via apt and PyTorch installed from the cu128 wheel index.

It syncs with the upstream ComfyUI repository, builds a Docker image on new releases, and pushes it to GitHub Container Registry (GHCR).

I created this repo for myself as a simple way to stay up to date with the latest ComfyUI versions while having an easy-to-use Docker image.


Features

  • Daily checks for upstream releases, auto-merges changes, and builds/pushes Docker images.
  • CUDA-enabled PyTorch + Triton on Debian trixie with CUDA 12.8 dev libs so custom CUDA builds work at runtime.
  • Non-root runtime with PUID/PGID mapping handled by entrypoint for volume permissions.
  • ComfyUI-Manager auto-sync on startup; entrypoint scans custom_nodes and installs requirements when COMFY_AUTO_INSTALL=1.
  • SageAttention build-on-start for compatible NVIDIA GPUs (Turing/SM 7.5+); enabling is opt-in via FORCE_SAGE_ATTENTION=1.

Getting Started

  • Install NVIDIA Container Toolkit on the host, then use docker run --gpus all or Compose GPU reservations to pass GPUs through.
  • Expose the ComfyUI server on port 8188 (default) and map volumes for models, inputs, outputs, and custom_nodes.

Pulling the Image

The latest image is available on GHCR:

docker pull ghcr.io/clsferguson/comfyui-docker:latest

For a specific version (synced with upstream tags, starting at v0.3.59):

docker pull ghcr.io/clsferguson/comfyui-docker:vX.Y.Z

Docker Compose

For easier management, use this docker-compose.yml:

services:
  comfyui:
    image: ghcr.io/clsferguson/comfyui-docker:latest
    container_name: ComfyUI
    runtime: nvidia
    restart: unless-stopped
    ports:
      - 8188:8188
    environment:
      - TZ=America/Edmonton
      - PUID=1000
      - PGID=1000
    gpus: all
    volumes:
      - comfyui_data:/app/ComfyUI/user/default
      - comfyui_nodes:/app/ComfyUI/custom_nodes
      - /mnt/comfyui/models:/app/ComfyUI/models
      - /mnt/comfyui/input:/app/ComfyUI/input
      - /mnt/comfyui/output:/app/ComfyUI/output

Run with docker compose up -d.


Usage

  • Open http://localhost:8188 after the container is up; change the external port via -p HOST:8188.
  • To target specific GPUs, use Docker's GPU device selections or Compose device_ids in reservations.

SageAttention

SageAttention is compiled at container startup when a compatible GPU (Turing SM 7.5+) is detected and cached to a volume-mapped directory for subsequent starts. It delivers 2-5x faster attention vs FlashAttention for video and high-res image workflows.

  • To enable: set FORCE_SAGE_ATTENTION=1. If the build or import fails, ComfyUI starts normally without it.
  • The first startup with SageAttention will be slower due to compilation; subsequent starts use the cached build.
  • Turing GPUs (RTX 20xx) use the v1.0 branch with Triton 3.2.0; Ampere and newer use the latest release.

Environment Variables

  • PUID/PGID: map container user to host UID/GID for volume write access.
  • COMFY_AUTO_INSTALL=1: auto-install Python requirements from custom_nodes on startup (default: 1).
  • COMFY_FORCE_INSTALL=1: force reinstall of custom_nodes requirements even after first run.
  • FORCE_SAGE_ATTENTION=0|1: compile and enable SageAttention on startup (requires compatible NVIDIA GPU).
  • SAGE_MAX_JOBS=N: override the number of parallel compile jobs for SageAttention (default: auto from RAM).
  • CM_*: seed ComfyUI-Manager config.ini keys on first start (e.g. CM_SKIP_UPDATE_CHECK=1).

License

Distributed under the MIT License (same as upstream ComfyUI). See LICENSE for more information.


Contact

Built with ❤️ for easy AI workflows.