From 144c9047b69b1dc37256b338dd6992b3468ad819 Mon Sep 17 00:00:00 2001 From: "B. Bergeron" Date: Wed, 13 Aug 2025 11:14:54 -0400 Subject: [PATCH] Persist models installed by model managers --- Dockerfile | 3 ++- entrypoint.sh | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99d7cc70b..bbde988ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,9 +62,10 @@ EXPOSE 8188 # node managers, # - /comfyui/custom_nodes: stores custom nodes installed at runtime by custom # node managers, +# - /comfyui/models: Stores models installed by model managers, # - /home/comfyui: stores data from Python packages that may write outside the # virtual environment and into the user’s home directory. -VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/home/comfyui" ] +VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/comfyui/models", "/home/comfyui" ] # Switch back to root to run the entrypoint and ensure it is executable. USER root diff --git a/entrypoint.sh b/entrypoint.sh index 9b844eb1d..cbaec72f9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,7 +24,12 @@ fi echo "[entrypoint] Changing directory ownership..." -chown -R "$user:$user_group" /data /comfyui/custom_nodes /comfyui/.venv /home/comfyui +chown -R "$user:$user_group" \ + /data \ + /comfyui/custom_nodes \ + /comfyui/models \ + /comfyui/.venv \ + /home/comfyui # Add the user to the groups owning /dev/nvidia* devices to ensure CUDA access. # Typically, these devices belong to a single "video" group, but to be safe, we