From b22479e177e4fb1a086ae81b26a0d8d683a63503 Mon Sep 17 00:00:00 2001 From: AbdBarho Date: Fri, 7 Oct 2022 09:18:31 +0200 Subject: [PATCH] lstein --- services/lstein/Dockerfile | 22 ++++++++++----------- services/lstein/info.py | 7 +++++-- services/lstein/mount.sh | 39 +++++++++++++++++++------------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/services/lstein/Dockerfile b/services/lstein/Dockerfile index 5944b13..7b8d65b 100644 --- a/services/lstein/Dockerfile +++ b/services/lstein/Dockerfile @@ -12,21 +12,20 @@ RUN conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorc RUN apt-get update && apt install fonts-dejavu-core rsync gcc -y && apt-get clean +ENV PIP_EXISTS_ACTION=w RUN <', """ - GitHub site, Deployed with stable-diffusion-webui-docker + .replace('
', """ +
+
+ Deployed with stable-diffusion-webui-docker +
""", 1) ) diff --git a/services/lstein/mount.sh b/services/lstein/mount.sh index 0b31bdf..808c468 100755 --- a/services/lstein/mount.sh +++ b/services/lstein/mount.sh @@ -1,28 +1,27 @@ #!/bin/bash -set -eu +set -Eeuo pipefail -ROOT=/stable-diffusion +declare -A MOUNTS -mkdir -p "${ROOT}/models/ldm/stable-diffusion-v1/" -ln -sf /cache/models/model.ckpt "${ROOT}/models/ldm/stable-diffusion-v1/model.ckpt" +# cache +MOUNTS["/root/.cache"]=/data/.cache +# ui specific +MOUNTS["${PWD}/models/ldm/stable-diffusion-v1/model.ckpt"]=/data/StableDiffusion/model.ckpt +MOUNTS["${PWD}/src/gfpgan/experiments/pretrained_models/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth +MOUNTS["${PWD}/ldm/dream/restoration/codeformer/weights"]=/data/CodeFormer +# hacks +MOUNTS["/opt/conda/lib/python3.9/site-packages/facexlib/weights"]=/data/.cache +MOUNTS["/opt/conda/lib/python3.9/site-packages/realesrgan/weights"]=/data/RealESRGAN -base="${ROOT}/src/gfpgan/experiments/pretrained_models/" -mkdir -p "${base}" -# TODO: "real" GFPGANv1.4.pth -ln -sf /cache/models/GFPGANv1.3.pth "${base}/GFPGANv1.4.pth" -echo "Mounted GFPGANv1.3.pth" - -# facexlib -FACEX_WEIGHTS=/opt/conda/lib/python3.9/site-packages/facexlib/weights - -rm -rf "${FACEX_WEIGHTS}" -mkdir -p /cache/weights -ln -sf -T /cache/weights "${FACEX_WEIGHTS}" - -REALESRGAN_WEIGHTS=/opt/conda/lib/python3.9/site-packages/realesrgan/weights -rm -rf "${REALESRGAN_WEIGHTS}" -ln -sf -T /cache/weights "${REALESRGAN_WEIGHTS}" +for to_path in "${!MOUNTS[@]}"; do + set -Eeuo pipefail + from_path="${MOUNTS[${to_path}]}" + rm -rf "${to_path}" + mkdir -p "$(dirname "${to_path}")" + ln -sT "${from_path}" "${to_path}" + echo Mounted $(basename "${from_path}") +done if "${PRELOAD}" == "true"; then python3 -u scripts/preload_models.py