stable-diffusion-webui-docker/services/comfy/entrypoint.sh
Brian Gebel 85645ae66c working
2025-04-28 13:05:02 -07:00

32 lines
741 B
Bash
Executable file

#!/bin/bash
set -Eeuo pipefail
mkdir -vp /data/config/comfy/custom_nodes
declare -A MOUNTS
# MOUNTS["/root/.cache"]="/data/.cache" # Determine why the original author decided to do this.
MOUNTS["${APPLICATION_ROOT}/input"]="/data/config/comfy/input"
MOUNTS["${APPLICATION_ROOT}/output"]="/output/comfy"
for to_path in "${!MOUNTS[@]}"; do
set -Eeuo pipefail
from_path="${MOUNTS[${to_path}]}"
rm -rf "${to_path}"
if [ ! -f "$from_path" ]; then
mkdir -vp "$from_path"
fi
mkdir -vp "$(dirname "${to_path}")"
ln -sT "${from_path}" "${to_path}"
echo Mounted $(basename "${from_path}")
done
if [ -f "/data/config/comfy/startup.sh" ]; then
pushd ${APPLICATION_ROOT}
. /data/config/comfy/startup.sh
popd
fi
exec "$@"