From d09a99accd14a030eefba4232f347f30bb9ae787 Mon Sep 17 00:00:00 2001 From: Haylan Date: Tue, 22 Sep 2026 23:09:27 +0200 Subject: [PATCH] fix(comfyui): seed custom_nodes/input/output/user dirs under --base-directory main.py crashed on boot (FileNotFoundError on /storage/custom_nodes) - --base-directory fully relocates custom_nodes/input/output/user/temp under it, it doesn't create them or fall back to the image's own ComfyUI/custom_nodes (which has ComfyUI-Manager baked in). Seed /storage/custom_nodes from the image's copy on first boot only (skips once populated), so Manager survives the base-directory switch and persists across recreates. Co-Authored-By: Claude Sonnet 5 --- docker-compose.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4305e80..bf1ab00 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -241,15 +241,19 @@ services: # this command is required, not optional, or the container exits 0 # immediately and restart-loops. Runs as root (image's only user); # group_add above is what actually grants /dev/kfd + /dev/dri access. + # + # --base-directory fully replaces ComfyUI's custom_nodes/input/output/ + # user/temp dirs with ones under /storage (confirmed in folder_paths.py) + # rather than adding to the image's baked-in ones — so first boot must + # seed /storage/custom_nodes from the image's copy (ComfyUI-Manager + # lives there) or it's gone, and main.py hard-crashes if custom_nodes + # doesn't exist yet at all. + entrypoint: ["sh", "-c"] command: - - python - - main.py - - --listen - - "0.0.0.0" - - --port - - "8188" - - --base-directory - - /storage + - > + mkdir -p /storage/custom_nodes /storage/input /storage/output /storage/user && + [ -z "$(ls -A /storage/custom_nodes)" ] && cp -r /workspace/ComfyUI/custom_nodes/. /storage/custom_nodes/ || true; + exec python main.py --listen 0.0.0.0 --port 8188 --base-directory /storage # # Published host port (unlike llama-server's ai-stack-only pattern): # ComfyUI's own UI is meant to be reachable directly too, for a planned