diff --git a/services/comfy/Dockerfile b/services/comfy/Dockerfile index 9f3ded239..956b29415 100644 --- a/services/comfy/Dockerfile +++ b/services/comfy/Dockerfile @@ -5,7 +5,8 @@ FROM pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 -RUN apt-get update && apt-get install -y git libgoogle-perftools-dev && apt-get clean +# libgl1 and libglib2.0-0 are required for opencv-python +RUN apt-get update && apt-get install -y git libgoogle-perftools-dev libgl1 libglib2.0-0 && apt-get clean ARG PUID=0 ARG PGID=0 diff --git a/services/comfy/entrypoint.sh b/services/comfy/entrypoint.sh index e9b0fe41a..770156a3e 100755 --- a/services/comfy/entrypoint.sh +++ b/services/comfy/entrypoint.sh @@ -29,6 +29,28 @@ for to_path in "${!MOUNTS[@]}"; do echo "Mounted ${from_path} -> ${to_path}" done +if [ -d "${ROOT}/comfyui-manager" ]; then + manager_exists=false + shopt -s nullglob + for dir in "${ROOT}/custom_nodes"/*; do + dirname=$(basename "$dir") + if [[ "${dirname,,}" == "comfyui-manager" ]]; then + manager_exists=true + break + fi + done + shopt -u nullglob + + if [ "$manager_exists" = false ]; then + echo "Initializing ComfyUI-Manager..." + # Debug: List contents to see why it wasn't found (optional, can be removed later) + ls -la "${ROOT}/custom_nodes" || true + cp -r "${ROOT}/comfyui-manager" "${ROOT}/custom_nodes/comfyui-manager" + else + echo "ComfyUI-Manager detected in custom_nodes, skipping initialization." + fi +fi + if [ -f "/data/config/comfy/startup.sh" ]; then pushd ${ROOT} . /data/config/comfy/startup.sh