A Customizable ComfyUI docker image with automatic environment setup.
- Ready-to-use Python environment with common ML packages:
nunchaku,sageattention2++,sageattn3,xformers,transformers,onnxruntime,opencv-python, etc.- See Dockerfile for complete details
- Automated management of custom nodes & models:
- Configuration-driven setup during startup
- Pre/Post initialization script hooks (supports
.py,.sh,.bat,.ps1) - Multiple config files support, with optional regex-based filter for flexible updates
- Built-in aria2 for accelerated large model files downloads
- Use cm-cli to install custom nodes.
- Support install custom nodes from Comfy Registry
- Optional optimizations for users in the Chinese Mainland (mirrors for pip/Hugging Face/Civitai)
| Image Tag | Compute Platform | PyTorch Version | Python Version | ComfyUI Version | Note |
|---|---|---|---|---|---|
latest / vX.Y.Z |
Recommend | ||||
nightly |
| Variable | Description | Default |
|---|---|---|
| INIT_NODE | Enable automatic installs/removes of custom nodes at startup | true |
| UPDATE_NODE | Enable automatic updates of custom nodes at startup | false |
| INIT_MODEL | Enable automatic downloads/removes of models at startup | true |
| BOOT_CONFIG_INCLUDE | Regex pattern for including boot config files. | |
| BOOT_CONFIG_EXCLUDE | Regex pattern for excluding boot config files. | |
| COMFYUI_EXTRA_ARGS | Additional ComfyUI launch arguments. | |
| HF_API_TOKEN | Hugging Face access token for downloading access restricted models. | |
| CIVITAI_API_TOKEN | Civitai API token for downloading access restricted models. | |
| CN_NETWORK | Enable network optimization for Chinese Mainland users. Changes default HF/Civitai endpoints. | false |
| HF_ENDPOINT | Override the Hugging Face download endpoint. | https://huggingface.co (or https://hf-mirror.com if CN_NETWORK=true) |
| CIVITAI_ENDPOINT | Override the Civitai download endpoint. | https://civitai.com (or https://civitai.work if CN_NETWORK=true) |
-
Clone this repository, mount
docker/as working directory:git clone https://github.com/jimlee2048/comfyui-docker cd comfyui-docker/docker -
Create and configure
docker/.envfile base on example:cp example.env .env
see docker/example.env for more details.
-
(Optional) Set up automatic node/model management:
- Set
INIT_NODE=trueor/andINIT_MODEL=trueindocker/.env - Create your boot config in
docker/config/see docker/config/example.toml for more details.
- Set
-
Create and configure
docker/compose.ymlfile base on example:cp compose.example.yml compose.yml
see docker/compose.example.yml for more details.
-
Launch ComfyUI:
- Run in foreground to see logs, recommended for first run.
docker compose up
- Or in background as services.
docker compose up -d
First run may take longer due to node installation and model downloads.
- Run in foreground to see logs, recommended for first run.
-
Access ComfyUI at
http://localhost:8188 -
To stop:
docker compose down
When modifying boot config or environment variables, do not use ComfyUI Manager's restart function on the web interface.
Instead, restart the container to apply changes:
docker compose down
docker compose up -d-
Option 1: Use ComfyUI Manager in the web interface
-
Option 2: Pull latest image:
docker compose pull docker compose down docker compose up -d
- ROCm version for AMD GPU
- XPU version for Intel GPU