This repo is for Docker images that runs ComfyUI - a Stable Diffusion GUI powering node-based workflow.
-
At first start, a script will download latest ComfyUI, some custom nodes and models.
-
The whole ComfyUI will be stored in a local folder (
./storage/ComfyUI
). -
If you already have a ComfyUI bundle, put it there and make an empty file (
./storage/ComfyUI/.download-complete
) so the start script will skip downloading. -
At every restart of the container, a script will update ComfyUI & its custom nodes.
-
NVIDIA GPU with ≥6GB VRAM
-
Latest NVIDIA GPU Drivers, Both Game and Studio version will work.
-
Docker Installed
-
Windows user could use Docker Desktop with WSL2 enabled.
-
docker compose
git clone https://github.com/YanWenKun/ComfyUI-Docker.git
cd ComfyUI-Docker
docker compose up --detach
# Update image (only when Python components is outdated)
git pull
docker compose pull
docker compose up --detach --remove-orphans
docker image prune
docker run
mkdir -p storage
docker run -it \
--name comfyui \
--gpus all \
-p 8188:8188 \
-v "$(pwd)"/storage:/home/runner \
--env CLI_ARGS="" \
yanwk/comfyui-boot:latest
# Update image (only when Python components is outdated)
docker rm comfyui
docker pull yanwk/comfyui-boot:latest
# Then re-run 'docker run' above again
Once the app is loaded, visit http://localhost:8188/
docker compose
git clone https://github.com/YanWenKun/ComfyUI-Docker.git
cd ComfyUI-Docker
docker compose -f docker-compose-rocm.yml up --detach
# Update image (only when Python components is outdated)
git pull
docker compose -f docker-compose-rocm.yml pull
docker compose -f docker-compose-rocm.yml up --detach --remove-orphans
docker image prune
docker run
mkdir -p storage
docker run -it \
--name comfyui \
--gpus all \
-p 8188:8188 \
-v "$(pwd)"/storage:/home/runner \
--env CLI_ARGS="--use-pytorch-cross-attention" \
--device=/dev/kfd --device=/dev/dri \
--group-add=video --ipc=host --cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
yanwk/comfyui-boot:rocm
# Update image (only when Python components is outdated)
docker rm comfyui
docker pull yanwk/comfyui-boot:rocm
# Then re-run 'docker run' above again
Once the app is loaded, visit http://localhost:8188/
Q: My GPU has only 4GB VRAM
A: Add --lowvram
to CLI_ARGS
.
Q: Adding --lowvram
still out-of-memory
A: Use --novram
instead. It will use CPU RAM.
Q: How to run on CPU?
A: Add --cpu
to CLI_ARGS
. It’s pretty slow.
More CLI_ARGS
available at
ComfyUI.
You may want to check Gencode List.
docker build . --build-arg TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.2;7.5;8.0;8.6" -f Dockerfile-xformers -t yanwk/comfyui-boot:xformers
docker build . --progress=plain -f Dockerfile -t yanwk/comfyui-boot:latest
docker run -it --rm --gpus all -p 8188:8188 \
-v "$(pwd)"/storage:/home/runner \
--env CLI_ARGS="" \
yanwk/comfyui-boot:latest
docker run -it --rm --gpus all \
-v "$(pwd)"/storage:/home/runner \
-p 8188:8188 \
-e CLI_ARGS="" \
--user root \
yanwk/comfyui-boot:latest /bin/bash
This open source license is written and valid both in Chinese and English, how good is that!