2023-04-21 21:34:17 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -Eeuo pipefail
|
|
|
|
|
|
2023-05-10 07:32:58 +02:00
|
|
|
mkdir -vp /data/config/comfy/custom_nodes
|
2023-04-21 21:34:17 +02:00
|
|
|
|
2023-05-07 11:11:30 +02:00
|
|
|
declare -A MOUNTS
|
2023-04-21 21:34:17 +02:00
|
|
|
|
2023-05-07 11:11:30 +02:00
|
|
|
MOUNTS["/root/.cache"]="/data/.cache"
|
|
|
|
|
MOUNTS["${ROOT}/input"]="/data/config/comfy/input"
|
2023-04-21 21:34:17 +02:00
|
|
|
MOUNTS["${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
|
|
|
|
|
|
2023-05-07 15:52:08 +02:00
|
|
|
if [ "$(ls -A /stable-diffusion/custom_nodes)" ]; then
|
|
|
|
|
chmod 777 -R "/stable-diffusion/custom_nodes/"
|
|
|
|
|
apt-get install build-essential -y
|
2023-05-07 18:50:33 +02:00
|
|
|
for dir in "/stable-diffusion/custom_nodes/*"; do
|
|
|
|
|
if [ -e "$dir/requirements.txt" ]; then
|
2023-05-07 15:52:08 +02:00
|
|
|
echo $dir
|
|
|
|
|
cd $dir
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
|
2023-04-21 21:34:17 +02:00
|
|
|
exec "$@"
|