-
On the first start, a script will download latest ComfyUI, ComfyUI-Manager and some 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. -
Use ComfyUI-Manager (in ComfyUI web page) to update ComfyUI, manage custom nodes, and download models.
-
NVIDIA GPU with ≥6GB VRAM
-
For 4GB see CLI_ARGS.
-
-
Latest NVIDIA GPU driver
-
Either Game or Studio edition will work.
-
You don’t need to install drivers inside containers. Just make sure it’s working on your host OS.
-
-
Docker Installed
-
Linux user may need to install NVIDIA Container Toolkit (only on host OS). It will enable containers' GPU access.
-
Windows user could use Docker Desktop with WSL2 enabled.
-
docker run
mkdir -p storage
docker run -it \
--name comfyui \
--gpus all \
-p 8188:8188 \
-v "$(pwd)"/storage:/home/runner \
-e CLI_ARGS="" \
yanwk/comfyui-boot:cu121
# Update image (only when Python components are outdated)
docker rm comfyui
docker pull yanwk/comfyui-boot:cu121
# Then re-run above 'docker run' again
docker compose
git clone https://github.com/YanWenKun/ComfyUI-Docker.git
cd ComfyUI-Docker/cu121
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
Once the app is loaded, visit http://localhost:8188/
args | description |
---|---|
--lowvram |
If your GPU only has 4GB VRAM. |
--novram |
If adding --lowvram still out-of-memory. |
--cpu |
Run on CPU. It’s pretty slow. |
--use-pytorch-cross-attention |
If you don’t want to use xFormers. This may perform well on WSL2, but significantly slower on Linux hosts. |
--preview-method taesd |
Enable higher-quality previews with TAESD. ComfyUI-Manager would override this (settings available in Manager UI). |
--front-end-version Comfy-Org/ComfyUI_frontend@latest |
Use the most up-to-date frontend version. |
--fast |
Enable experimental optimizations. Currently the only optimization is float8_e4m3fn matrix multiplication on 4000/ADA series Nvidia cards or later. Might break things/lower quality. See the commit. |
More CLI_ARGS
available at
ComfyUI.
(Click to expand) Install a bunch of custom nodes that may save your time
Note that most dependencies are bundled in the image, you don’t need to manually install them.
cd ComfyUI/custom_nodes/
gcs='git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules'
# Workspace
$gcs https://github.com/11cafe/comfyui-workspace-manager.git
$gcs https://github.com/AIGODLIKE/AIGODLIKE-ComfyUI-Translation.git
$gcs https://github.com/crystian/ComfyUI-Crystools-save.git
$gcs https://github.com/crystian/ComfyUI-Crystools.git
# General
$gcs https://github.com/bash-j/mikey_nodes.git
$gcs https://github.com/chrisgoringe/cg-use-everywhere.git
$gcs https://github.com/cubiq/ComfyUI_essentials.git
$gcs https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes.git
$gcs https://github.com/jags111/efficiency-nodes-comfyui.git
$gcs https://github.com/kijai/ComfyUI-KJNodes.git
$gcs https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git
$gcs https://github.com/rgthree/rgthree-comfy.git
$gcs https://github.com/shiimizu/ComfyUI_smZNodes.git
$gcs https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git
# Control
$gcs https://github.com/cubiq/ComfyUI_InstantID.git
$gcs https://github.com/cubiq/ComfyUI_IPAdapter_plus.git
$gcs https://github.com/Fannovel16/comfyui_controlnet_aux.git
$gcs https://github.com/florestefano1975/comfyui-portrait-master.git
$gcs https://github.com/Gourieff/comfyui-reactor-node.git
$gcs https://github.com/huchenlei/ComfyUI-layerdiffuse.git
$gcs https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git
$gcs https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
$gcs https://github.com/ltdrdata/ComfyUI-Inspire-Pack.git
$gcs https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git
$gcs https://github.com/storyicon/comfyui_segment_anything.git
$gcs https://github.com/twri/sdxl_prompt_styler.git
# Video
$gcs https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git
$gcs https://github.com/FizzleDorf/ComfyUI_FizzNodes.git
$gcs https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git
$gcs https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git
$gcs https://github.com/melMass/comfy_mtb.git
$gcs https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved.git
# More
$gcs https://github.com/cubiq/ComfyUI_FaceAnalysis.git
$gcs https://github.com/pythongosssss/ComfyUI-WD14-Tagger.git
$gcs https://github.com/SLAPaper/ComfyUI-Image-Selector.git
$gcs https://github.com/ssitu/ComfyUI_UltimateSDUpscale.git
If anything conflicts, just delete unwanted custom nodes and .local
(or local
) folder, and update/try-fix/reinstall custom nodes in ComfyUI-Manager.
You can create your own pre-start script at
./storage/scripts/pre-start.sh
It will run before ComfyUI starts, handy for debugging.
Also, if you need to setup proxy, this script will start before pre-start
and download
:
./storage/scripts/set-proxy.sh
docker build . --progress=plain -f Dockerfile -t yanwk/comfyui-boot:cu121
docker run -it --rm \
--gpus all -p 8188:8188 \
--volume "$(pwd)"/storage:/home/runner \
--env CLI_ARGS="" \
yanwk/comfyui-boot:cu121
docker run -it --rm \
--gpus all -p 8188:8188 \
--volume "$(pwd)"/storage:/home/runner \
--env CLI_ARGS="" \
--user root \
yanwk/comfyui-boot:cu121 /bin/bash
Usually this is not needed.
Some custom nodes will use huggingface_hub
to download models and store them in .cache
.
You may need to download them again after cleaning cache.
But if having issues when updating, it may worth a try:
docker exec -it --workdir /home/runner comfyui \
rm -rf .cache/ .config/ .local/ .nv/ bin/ include/ lib/ lib64 pyvenv.cfg
docker restart comfyui