Sign inSign up

madtomy/comfy-ui

By madtomy

โ€ขUpdated 5 months ago

GPU-ready ComfyUI Docker image with PyTorch, CUDA 12.8, cuDNN 9, and RTX 5080 / Blackwell support.

Image
Machine learning & AI
Web servers
0

10K+

madtomy/comfy-ui repository overview

โ ๐Ÿง  ComfyUI โ€” GPU Docker Image for CUDA / RTX 5080

A clean, GPU-ready Docker image for ComfyUIโ , built for AI image-generation workflows with PyTorch, CUDA, and cuDNN support.

This image is designed for NVIDIA GPU deployments, including newer RTX 50xx / Blackwell cards, and is suitable for Docker, Docker Compose, and Docker Swarm stacks.


โ ๐Ÿš€ Features
  • โœ… Official ComfyUI cloned directly from upstream
  • โœ… GPU-ready with NVIDIA CUDA support
  • โœ… Built on PyTorch 2.9.0 + CUDA 12.8 + cuDNN 9
  • โœ… Suitable for RTX 5080 / Blackwell-class GPUs
  • โœ… Exposes ComfyUI on port 7860
  • โœ… Persistent volume support for models, input, output, user data, and custom nodes
  • โœ… Optional ComfyUI update on container startup
  • โœ… Optional custom-node requirements installation
  • โœ… Rollback-friendly version tags

โ ๐Ÿท๏ธ Available Tags
TagDescription
latestCurrent recommended CUDA 12.8 / PyTorch 2.9 ComfyUI image.
v0.20.1ComfyUI release v0.20.1, built on CUDA 12.8 / PyTorch 2.9.

Recommended production usage: pin a version tag such as v0.20.1 instead of relying only on latest.


โ ๐Ÿ› ๏ธ Base Image
pytorch/pytorch:2.9.0-cuda12.8-cudnn9-runtime

This provides:

  • PyTorch 2.9.0
  • CUDA 12.8 runtime
  • cuDNN 9
  • NVIDIA GPU acceleration support

โ ๐Ÿ“ฆ Components
ComponentVersion / Source
ComfyUIOfficial upstream: comfyanonymous/ComfyUI
PyTorch2.9.0
CUDA12.8
cuDNN9
Python packagesInstalled from ComfyUI requirements.txt

โ ๐ŸŒ Exposed Port
7860

Access ComfyUI at:

http://localhost:7860

โ โš™๏ธ Environment Variables
VariableDefaultDescription
NVIDIA_VISIBLE_DEVICESallMakes all assigned NVIDIA GPUs visible inside the container.
NVIDIA_DRIVER_CAPABILITIEScompute,utilityEnables required NVIDIA compute/runtime capabilities.
PYTORCH_CUDA_ALLOC_CONFexpandable_segments:TrueHelps reduce CUDA memory fragmentation in PyTorch.
CLI_ARGSemptyExtra arguments passed to ComfyUI.
COMFYUI_UPDATE_ON_STARTtruePull latest selected ComfyUI ref on container startup. Set to false for pinned/stable behavior.
COMFYUI_INSTALL_CUSTOM_NODE_REQUIREMENTSfalseInstalls requirements.txt files found in custom nodes at startup. Enable only when needed.

โ ๐Ÿงฉ Volume Layout

Recommended persistent mounts:

Host PathContainer PathPurpose
/path/to/models/opt/ComfyUI/modelsCheckpoints, LoRAs, VAE, ControlNet, CLIP, upscale models, etc.
/path/to/input/opt/ComfyUI/inputInput images/files.
/path/to/output/opt/ComfyUI/outputGenerated outputs.
/path/to/user/opt/ComfyUI/userComfyUI user/workflow state.
/path/to/custom_nodes/opt/ComfyUI/custom_nodesCustom nodes.
/path/to/cache/root/.cachePython/model cache.

โ ๐Ÿงช Run with Docker
docker run --gpus all --rm -it \
  -p 7860:7860 \
  -e NVIDIA_VISIBLE_DEVICES=all \
  -e NVIDIA_DRIVER_CAPABILITIES=compute,utility \
  -e PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
  -v /path/to/models:/opt/ComfyUI/models \
  -v /path/to/input:/opt/ComfyUI/input \
  -v /path/to/output:/opt/ComfyUI/output \
  -v /path/to/user:/opt/ComfyUI/user \
  -v /path/to/custom_nodes:/opt/ComfyUI/custom_nodes \
  madtomy/comfy-ui:v0.20.1

โ ๐Ÿงช Run Latest Tag
docker run --gpus all --rm -it \
  -p 7860:7860 \
  -v /path/to/models:/opt/ComfyUI/models \
  -v /path/to/input:/opt/ComfyUI/input \
  -v /path/to/output:/opt/ComfyUI/output \
  -v /path/to/custom_nodes:/opt/ComfyUI/custom_nodes \
  madtomy/comfy-ui:latest

โ ๐Ÿงฐ Custom CLI Arguments

Example: enable extra ComfyUI arguments:

docker run --gpus all --rm -it \
  -p 7860:7860 \
  -e CLI_ARGS="--preview-method auto" \
  madtomy/comfy-ui:v0.20.1

โ ๐Ÿ”„ Startup Updates

By default, the container can update ComfyUI on startup:

-e COMFYUI_UPDATE_ON_START=true

For stable pinned deployments, disable runtime updates:

-e COMFYUI_UPDATE_ON_START=false

Recommended production pattern:

  • Use pinned image tags for rollback safety, e.g. madtomy/comfy-ui:v0.20.1
  • Test new tags before promoting them to latest
  • Keep the previous known-good tag available for quick rollback

โ ๐Ÿงฑ Docker Compose Example
services:
  comfyui:
    image: madtomy/comfy-ui:v0.20.1
    ports:
      - "7860:7860"
    environment:
      NVIDIA_VISIBLE_DEVICES: all
      NVIDIA_DRIVER_CAPABILITIES: compute,utility
      PYTORCH_CUDA_ALLOC_CONF: expandable_segments:True
      COMFYUI_UPDATE_ON_START: "false"
      COMFYUI_INSTALL_CUSTOM_NODE_REQUIREMENTS: "false"
      CLI_ARGS: ""
    volumes:
      - /path/to/models:/opt/ComfyUI/models
      - /path/to/input:/opt/ComfyUI/input
      - /path/to/output:/opt/ComfyUI/output
      - /path/to/user:/opt/ComfyUI/user
      - /path/to/custom_nodes:/opt/ComfyUI/custom_nodes
      - /path/to/cache:/root/.cache
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

โ ๐Ÿณ Docker Swarm Notes

For Swarm deployments, GPU scheduling depends on your node configuration. This image is GPU-ready, but the Swarm node must have:

  • NVIDIA driver installed
  • NVIDIA Container Toolkit configured
  • GPU resource reservation or node placement configured correctly

Example service image reference:

image: madtomy/comfy-ui:v0.20.1

โ ๐Ÿ”™ Rollback

If a new image or ComfyUI update causes issues, redeploy the previous known-good tag:

docker pull madtomy/comfy-ui:v0.20.1

Then update your Compose/Swarm stack back to that tag.

For safer production behavior, set:

COMFYUI_UPDATE_ON_START=false

โ ๐Ÿงพ License

This image includes ComfyUIโ , which is licensed under the MIT License.

Please refer to the upstream ComfyUI repository for full license details.


โ ๐Ÿ’ก Maintainer

Maintained by: madtomyโ 
Source: ComfyUI on GitHubโ 

Tag summary

Content type

Image

Digest

sha256:a34aba554โ€ฆ

Size

4.9 GB

Last updated

5 months ago

docker pull madtomy/comfy-ui