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 <noreply@anthropic.com>
This commit is contained in:
haylanandClaude Bot committed 2026-09-22 23:09:27 +02:00
1 parent 9903b66094
commit d09a99accd
1 file changed
+12 -8
+12 -8
View File
@@ -241,15 +241,19 @@ services:
# this command is required, not optional, or the container exits 0 # this command is required, not optional, or the container exits 0
# immediately and restart-loops. Runs as root (image's only user); # immediately and restart-loops. Runs as root (image's only user);
# group_add above is what actually grants /dev/kfd + /dev/dri access. # 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: command:
- python - >
- main.py mkdir -p /storage/custom_nodes /storage/input /storage/output /storage/user &&
- --listen [ -z "$(ls -A /storage/custom_nodes)" ] && cp -r /workspace/ComfyUI/custom_nodes/. /storage/custom_nodes/ || true;
- "0.0.0.0" exec python main.py --listen 0.0.0.0 --port 8188 --base-directory /storage
- --port
- "8188"
- --base-directory
- /storage
# #
# Published host port (unlike llama-server's ai-stack-only pattern): # 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 # ComfyUI's own UI is meant to be reachable directly too, for a planned