Production-ready Docker setup for ComfyUI
A complete containerized deployment of ComfyUI with GPU acceleration, flexible deployment profiles, and persistent data management. Built with Docker Buildx Bake for efficient multi-stage builds.
- Key Features
- Quick Start
- Deployment Profiles
- Data & Storage
- Configuration
- Documentation
- Related Resources
- Contributing
- FAQ
- License
- 🚀 Current Accelerators: NVIDIA CUDA 13.0, AMD ROCm 7.2, Intel XPU, and CPU
- 🎯 Versioned ComfyUI: Stable release tags by default, explicit nightly builds when wanted
- 📁 Persistent Storage: Individual volume mounts for models, outputs, custom nodes, etc.
- 🐳 Production Ready: Multi-stage builds, layer caching, and pre-built GHCR images
- ⚡ Performance Optimized: Dynamic VRAM, async offload, CUDA graphs, Comfy Kitchen, and architecture-specific SageAttention images
- 🔧 Extensible: Custom node support via volume mounts
- 🔄 CI/CD Ready: Automated builds, weekly dependency updates
- 🔒 Security: Runs as non-root by default, supports Docker Compose PUID/PGID and Kubernetes securityContext
- Docker 20.10+ and Docker Compose 2.x
- NVIDIA GPU + drivers (for GPU modes) - Install Guide
- 8GB+ VRAM recommended for complete mode
- 20GB+ disk space for models and images
git clone https://github.com/pixeloven/ComfyUI-Docker.git
cd ComfyUI-DockerChoose an example directory and start the service:
Core GPU (recommended for most users):
cd examples/core-gpu
docker compose up -dComplete GPU (extra custom-node dependencies):
cd examples/complete-gpu
docker compose up -dCore CPU (no GPU required):
cd examples/core-cpu
docker compose up -dOpen your browser to: http://localhost:8188
Place your Stable Diffusion checkpoints in ./data/models/checkpoints/ or download them through the ComfyUI interface.
ComfyUI Docker offers five deployment examples to match your hardware and use case:
| Example | Container | Image | Best For | Features |
|---|---|---|---|---|
core-gpu |
comfyui-core-gpu |
ghcr.io/pixeloven/comfyui/core:cuda-latest |
Most users | Essential ComfyUI + GPU acceleration |
complete-gpu |
comfyui-complete-gpu |
ghcr.io/pixeloven/comfyui/complete:cuda-latest |
Power users | Pre-installed common custom-node dependencies |
core-amd |
comfyui-core-amd |
ghcr.io/pixeloven/comfyui/core:rocm-latest |
AMD Linux | PyTorch ROCm 7.2 |
core-intel |
comfyui-core-intel |
ghcr.io/pixeloven/comfyui/core:xpu-latest |
Intel Arc Linux | PyTorch XPU |
core-cpu |
comfyui-core-cpu |
ghcr.io/pixeloven/comfyui/core:cpu-latest |
Testing/Compatibility | No GPU required |
Fast, lightweight ComfyUI with GPU support.
cd examples/core-gpu
docker compose up -d- ✅ Essential ComfyUI functionality
- ✅ GPU acceleration (CUDA 13.0 / PyTorch cu130)
- ✅ Fast startup
- ✅ Smaller image size
CUDA deployment with pre-installed Python dependencies used by common custom nodes.
cd examples/complete-gpu
docker compose up -d- ✅ Everything core has
- ✅ Pre-installed Python dependencies for common custom node setups
- ✅ Current Comfy Kitchen attention backend available with
CLI_ARGS=--use-ck-attention - ✅ SageAttention 2.2.0 variants for Ampere through Blackwell GPUs
⚠️ Larger image size
For SageAttention, select the tag matching the GPU compute capability and add
--use-sage-attention to CLI_ARGS. For example, RTX 50-series (Blackwell)
uses ghcr.io/pixeloven/comfyui/complete:cuda-sm120-latest. See the
Performance Tuning Guide for
the full architecture table and verification steps.
No GPU required, universal compatibility.
cd examples/core-cpu
docker compose up -d- ✅ Works without NVIDIA GPU
⚠️ Slower generation times- ✅ Lower resource requirements
ComfyUI Docker uses individual volume mounts for each data directory, providing granular control:
./data/
├── models/ → /app/models (AI models, checkpoints, LoRAs)
├── custom_nodes/ → /app/custom_nodes (Extensions and plugins)
├── datasets/ → /app/datasets (LoRA training datasets)
├── input/ → /app/input (Input images/workflows)
├── output/ → /app/output (Generated outputs)
├── temp/ → /app/temp (Temporary files)
└── user/ → /app/user (User configurations)
Customize paths via environment variables:
COMFY_MODEL_PATH=/path/to/models \
COMFY_OUTPUT_PATH=/path/to/outputs \
docker compose up -d # from within an examples/ directorySee Data Management Guide for details.
Common configuration options:
# Server Configuration
COMFY_PORT=8188 # Web interface port
PUID=1000 # User ID for file ownership (default: 1000)
PGID=1000 # Group ID for file ownership (default: 1000)
# Performance Tuning
CLI_ARGS="--lowvram" # ComfyUI launch arguments
# Custom Paths
COMFY_MODEL_PATH=./data/models # Override model directory
COMFY_OUTPUT_PATH=./data/output # Override output directoryMatch your host user's UID/GID to avoid permission issues with mounted volumes:
PUID=$(id -u) PGID=$(id -g) docker compose up -d # from within an examples/ directoryThe images support Kubernetes natively via securityContext.runAsUser. When the entrypoint detects a non-root UID, it skips the gosu/PUID/PGID logic and executes directly:
securityContext:
runAsUser: 3000
runAsGroup: 3000
fsGroup: 3000The Python virtual environment's package and entry-point directories are world-writable at build time, so ComfyUI Manager can install custom node dependencies regardless of the runtime UID.
For complete configuration options, see:
- Running Containers Guide - Environment variables, Docker Compose, and Kubernetes
- Performance Tuning Guide - CLI arguments and optimization
Getting Started:
- Quick Start - Get running in 5 minutes
Core Guides:
- Building Images - Build locally or use pre-built GHCR images
- Running Containers - Docker Compose operations and
.envconfiguration - Data Management - Models, workflows, and persistent storage
- Performance Tuning - CLI arguments and resource optimization
Advanced:
- Custom Nodes Snapshot Spec - How the Complete image manages bundled dependencies
For developers and contributors, see the Building Images Guide for local development and the Contributing section below.
📖 View Full Documentation Index
- ComfyUI GitHub - Official ComfyUI repository
- ComfyUI Examples - Official workflow examples
- ComfyUI Wiki - Documentation and guides
- ComfyUI Manager - Custom node manager
- Civitai - Model sharing platform
- NVIDIA Container Toolkit - GPU support for Docker
- Docker Buildx - Build system documentation
- Docker Compose - Compose reference
We welcome contributions! Whether it's bug reports, feature requests, documentation improvements, or code contributions.
- Report Issues: Use GitHub Issues with our templates
- Suggest Features: Open a Feature Request
- Submit PRs: See Building Images Guide for development setup
- Improve Docs: Documentation PRs are always appreciated!
# Clone the repository
git clone https://github.com/pixeloven/ComfyUI-Docker.git
cd ComfyUI-Docker
# Build images locally
docker buildx bake all --load
# Test a specific example
cd examples/core-gpu
docker compose up -d
# View logs
docker compose logs -fFor detailed build instructions, see Building Images Guide.
- Follow existing code style and structure
- Test your changes with all five examples
- Update documentation for new features
- Add meaningful commit messages
- Ensure CI/CD checks pass
ComfyUI Docker is a production-ready containerization of ComfyUI, a node-based engine for image, video, audio, 3D, and language workflows. This project provides:
- Multiple deployment profiles (core, complete, CPU-only)
- Multi-stage Docker builds using Docker Buildx Bake
- GPU acceleration for NVIDIA CUDA, AMD ROCm, and Intel XPU on Linux
- Persistent data management with granular volume mounting
- Pre-built images available on GitHub Container Registry
- Flexible configuration via environment variables
Perfect for local development, production deployments, or CI/CD pipelines.
- Core Mode: Best for most users - fast startup, essential features, GPU acceleration
- Complete Mode: Best for NVIDIA power users who want common custom-node dependencies pre-installed
- AMD/Intel Modes: Core images using the official PyTorch ROCm or XPU wheel channels
- CPU Mode: Best for testing or when no GPU is available
The CUDA and Complete examples require NVIDIA, the AMD example requires a ROCm-supported GPU, and the Intel example requires a supported Intel GPU. CPU mode needs no GPU but is significantly slower.
Everything is stored in the ./data/ directory with subdirectories for models, outputs, custom nodes, etc. You can customize these paths using environment variables. See the Data Management Guide for details.
Install custom nodes through the ComfyUI interface or mount them to ./data/custom_nodes/. See the Data Management Guide for details.
Yes! Place your checkpoints, LoRAs, and other models in the appropriate subdirectories under ./data/models/. ComfyUI will automatically detect them.
Pull the latest image from within your example directory:
docker compose pull
docker compose up -dFor local builds, rebuild the images:
docker buildx bake all --no-cacheComplete mode has a larger image due to pre-installed Python dependencies. Use Core mode when custom nodes can manage their own dependencies.
This project is licensed under the MIT License.
ComfyUI itself is licensed under GPL-3.0 - see the ComfyUI repository for details.
Questions? Check out GitHub Discussions or open an issue.