Skip to content

jimlee2048/comfyui-docker

Repository files navigation

ComfyUI Docker Image

GitHub Repo Docker Hub GitHub Workflow Status Docker Image Version (tag latest) Docker Pulls

A Customizable ComfyUI docker image with automatic environment setup.

⚠️ Note: This image is designed for personal use with GUI access, not for production server deployments.

Features

  • Ready-to-use Python environment with common ML packages: nunchaku, sageattention2++,sageattn3, xformers, transformers, onnxruntime, opencv-python, etc.
  • 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)

Available Image Tags

Image Tag Compute Platform PyTorch Version Python Version ComfyUI Version Note
latest / vX.Y.Z CUDA PyTorch Python ComfyUI Release Recommend
nightly CUDA PyTorch Python ComfyUI Nightly

Environment Variables

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)

Quick Start

  1. Clone this repository, mount docker/ as working directory:

    git clone https://github.com/jimlee2048/comfyui-docker
    cd comfyui-docker/docker
  2. Create and configure docker/.env file base on example:

    cp example.env .env

    see docker/example.env for more details.

  3. (Optional) Set up automatic node/model management:

    • Set INIT_NODE=true or/and INIT_MODEL=true in docker/.env
    • Create your boot config in docker/config/ see docker/config/example.toml for more details.
  4. Create and configure docker/compose.yml file base on example:

    cp compose.example.yml compose.yml

    see docker/compose.example.yml for more details.

  5. 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.

  6. Access ComfyUI at http://localhost:8188

  7. To stop:

    docker compose down

Updates & Maintenance

Configuration Changes

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

ComfyUI Updates

  • Option 1: Use ComfyUI Manager in the web interface

  • Option 2: Pull latest image:

    docker compose pull
    docker compose down
    docker compose up -d

TODO

  • ROCm version for AMD GPU
  • XPU version for Intel GPU

About

Customizable ComfyUI docker image with automatic environment setup

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages