2022-09-05 17:51:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-10-01 10:57:53 +00:00
|
|
|
set -Eeuo pipefail
|
|
|
|
|
2022-10-14 20:42:34 +00:00
|
|
|
mkdir -p /data/config/auto/
|
|
|
|
cp -n /docker/config.json /data/config/auto/config.json
|
|
|
|
jq '. * input' /data/config/auto/config.json /docker/config.json | sponge /data/config/auto/config.json
|
|
|
|
|
2022-10-01 10:57:53 +00:00
|
|
|
declare -A MOUNTS
|
|
|
|
|
|
|
|
MOUNTS["/root/.cache"]="/data/.cache"
|
|
|
|
|
|
|
|
# main
|
|
|
|
MOUNTS["${ROOT}/models/Stable-diffusion"]="/data/StableDiffusion"
|
|
|
|
MOUNTS["${ROOT}/models/Codeformer"]="/data/Codeformer"
|
|
|
|
MOUNTS["${ROOT}/models/GFPGAN"]="/data/GFPGAN"
|
|
|
|
MOUNTS["${ROOT}/models/ESRGAN"]="/data/ESRGAN"
|
|
|
|
MOUNTS["${ROOT}/models/BSRGAN"]="/data/BSRGAN"
|
|
|
|
MOUNTS["${ROOT}/models/RealESRGAN"]="/data/RealESRGAN"
|
|
|
|
MOUNTS["${ROOT}/models/SwinIR"]="/data/SwinIR"
|
2022-10-04 17:56:38 +00:00
|
|
|
MOUNTS["${ROOT}/models/ScuNET"]="/data/ScuNET"
|
2022-10-01 10:57:53 +00:00
|
|
|
MOUNTS["${ROOT}/models/LDSR"]="/data/LDSR"
|
2022-10-11 18:00:58 +00:00
|
|
|
MOUNTS["${ROOT}/models/hypernetworks"]="/data/Hypernetworks"
|
2022-10-01 10:57:53 +00:00
|
|
|
|
|
|
|
MOUNTS["${ROOT}/embeddings"]="/data/embeddings"
|
2022-10-14 20:42:34 +00:00
|
|
|
MOUNTS["${ROOT}/config.json"]="/data/config/auto/config.json"
|
2022-10-01 10:57:53 +00:00
|
|
|
|
|
|
|
# extra hacks
|
|
|
|
MOUNTS["${ROOT}/repositories/CodeFormer/weights/facelib"]="/data/.cache"
|
|
|
|
|
|
|
|
for to_path in "${!MOUNTS[@]}"; do
|
|
|
|
set -Eeuo pipefail
|
|
|
|
from_path="${MOUNTS[${to_path}]}"
|
|
|
|
rm -rf "${to_path}"
|
2022-10-15 06:08:36 +00:00
|
|
|
if [ ! -f "$from_path" ]; then
|
2022-10-14 20:42:34 +00:00
|
|
|
mkdir -vp "$from_path"
|
|
|
|
fi
|
2022-10-04 17:56:38 +00:00
|
|
|
mkdir -vp "$(dirname "${to_path}")"
|
2022-10-01 10:57:53 +00:00
|
|
|
ln -sT "${from_path}" "${to_path}"
|
|
|
|
echo Mounted $(basename "${from_path}")
|
2022-09-05 17:51:22 +00:00
|
|
|
done
|
2022-10-11 16:18:52 +00:00
|
|
|
|
2022-10-14 20:42:34 +00:00
|
|
|
mkdir -p /output/saved /output/txt2img-images/ /output/img2img-images /output/extras-images/ /output/grids/ /output/txt2img-grids/ /output/img2img-grids/
|