GPU-ready ComfyUI Docker image with PyTorch, CUDA 12.8, cuDNN 9, and RTX 5080 / Blackwell support.
10K+
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.
7860| Tag | Description |
|---|---|
latest | Current recommended CUDA 12.8 / PyTorch 2.9 ComfyUI image. |
v0.20.1 | ComfyUI 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.
pytorch/pytorch:2.9.0-cuda12.8-cudnn9-runtime
This provides:
| Component | Version / Source |
|---|---|
| ComfyUI | Official upstream: comfyanonymous/ComfyUI |
| PyTorch | 2.9.0 |
| CUDA | 12.8 |
| cuDNN | 9 |
| Python packages | Installed from ComfyUI requirements.txt |
7860
Access ComfyUI at:
http://localhost:7860
| Variable | Default | Description |
|---|---|---|
NVIDIA_VISIBLE_DEVICES | all | Makes all assigned NVIDIA GPUs visible inside the container. |
NVIDIA_DRIVER_CAPABILITIES | compute,utility | Enables required NVIDIA compute/runtime capabilities. |
PYTORCH_CUDA_ALLOC_CONF | expandable_segments:True | Helps reduce CUDA memory fragmentation in PyTorch. |
CLI_ARGS | empty | Extra arguments passed to ComfyUI. |
COMFYUI_UPDATE_ON_START | true | Pull latest selected ComfyUI ref on container startup. Set to false for pinned/stable behavior. |
COMFYUI_INSTALL_CUSTOM_NODE_REQUIREMENTS | false | Installs requirements.txt files found in custom nodes at startup. Enable only when needed. |
Recommended persistent mounts:
| Host Path | Container Path | Purpose |
|---|---|---|
/path/to/models | /opt/ComfyUI/models | Checkpoints, LoRAs, VAE, ControlNet, CLIP, upscale models, etc. |
/path/to/input | /opt/ComfyUI/input | Input images/files. |
/path/to/output | /opt/ComfyUI/output | Generated outputs. |
/path/to/user | /opt/ComfyUI/user | ComfyUI user/workflow state. |
/path/to/custom_nodes | /opt/ComfyUI/custom_nodes | Custom nodes. |
/path/to/cache | /root/.cache | Python/model cache. |
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
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
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
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:
madtomy/comfy-ui:v0.20.1latestservices:
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]
For Swarm deployments, GPU scheduling depends on your node configuration. This image is GPU-ready, but the Swarm node must have:
Example service image reference:
image: madtomy/comfy-ui:v0.20.1
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
This image includes ComfyUIโ , which is licensed under the MIT License.
Please refer to the upstream ComfyUI repository for full license details.
Maintained by: madtomyโ
Source: ComfyUI on GitHubโ
Content type
Image
Digest
sha256:a34aba554โฆ
Size
4.9 GB
Last updated
5 months ago
docker pull madtomy/comfy-ui