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/.download-complete
) so the start script will skip downloading. -
You can update ComfyUI & its custom nodes via ComfyUI-Manager (in ComfyUI web page).
-
NVIDIA GPU with ≥6GB VRAM
-
Latest NVIDIA GPU Drivers, Both Game and Studio version will work.
-
Only install drivers on your host OS. You don’t need to install drivers inside containers.
-
-
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 are 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 are 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/
Note
|
If you are using WSL2 with AMD/Intel GPU, consider Run ComfyUI on WSL2 with DirectML |
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 are 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 are 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.
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 -p 8188:8188 \
-v "$(pwd)"/storage:/home/runner \
-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!