diff --git a/models/.gitignore b/models/.gitignore deleted file mode 100644 index 8d8e32c..0000000 --- a/models/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/model.ckpt -/GFPGANv1.3.pth -/RealESRGAN_x2plus.pth -/RealESRGAN_x4plus.pth -/RealESRGAN_x4plus_anime_6B.pth -/LDSR.ckpt -/LDSR.yaml diff --git a/services/AUTOMATIC1111/mount.sh b/services/AUTOMATIC1111/mount.sh index aabfd63..a8fad9b 100755 --- a/services/AUTOMATIC1111/mount.sh +++ b/services/AUTOMATIC1111/mount.sh @@ -7,10 +7,12 @@ declare -A MODELS MODELS["${WORKDIR}/models/ldm/stable-diffusion-v1/model.ckpt"]=model.ckpt MODELS["${ROOT}/GFPGANv1.3.pth"]=GFPGANv1.3.pth +MODELS_DIR=/cache/models + for path in "${!MODELS[@]}"; do name=${MODELS[$path]} base=$(dirname "${path}") - from_path="/models/${name}" + from_path="${MODELS_DIR}/${name}" if test -f "${from_path}"; then mkdir -p "${base}" && ln -sf "${from_path}" "${path}" && echo "Mounted ${name}" else @@ -20,7 +22,7 @@ done # force realesrgan cache rm -rf /opt/conda/lib/python3.8/site-packages/realesrgan/weights -ln -s -T /models /opt/conda/lib/python3.8/site-packages/realesrgan/weights +ln -s -T "${MODELS_DIR}" /opt/conda/lib/python3.8/site-packages/realesrgan/weights # force facexlib cache mkdir -p /cache/weights/ ${WORKDIR}/gfpgan/ diff --git a/services/hlky/Dockerfile b/services/hlky/Dockerfile index 79c5f03..85ef16b 100644 --- a/services/hlky/Dockerfile +++ b/services/hlky/Dockerfile @@ -56,4 +56,4 @@ WORKDIR /stable-diffusion ENV TRANSFORMERS_CACHE=/cache/transformers TORCH_HOME=/cache/torch CLI_ARGS="" EXPOSE 7860 # run, -u to not buffer stdout / stderr -CMD /docker/mount.sh && python3 -u scripts/webui.py --outdir /output --ckpt /models/model.ckpt --ldsr-dir /latent-diffusion ${CLI_ARGS} +CMD /docker/mount.sh && python3 -u scripts/webui.py --outdir /output --ckpt /cache/models/model.ckpt --ldsr-dir /latent-diffusion ${CLI_ARGS} diff --git a/services/hlky/mount.sh b/services/hlky/mount.sh index d3b769d..7296cf6 100755 --- a/services/hlky/mount.sh +++ b/services/hlky/mount.sh @@ -12,10 +12,12 @@ MODELS["${ROOT}/realesrgan/experiments/pretrained_models/RealESRGAN_x4plus_anime MODELS["/latent-diffusion/experiments/pretrained_models/model.ckpt"]=LDSR.ckpt # MODELS["/latent-diffusion/experiments/pretrained_models/project.yaml"]=LDSR.yaml +MODELS_DIR=/cache/models + for path in "${!MODELS[@]}"; do name=${MODELS[$path]} base=$(dirname "${path}") - from_path="/models/${name}" + from_path="${MODELS_DIR}/${name}" if test -f "${from_path}"; then mkdir -p "${base}" && ln -sf "${from_path}" "${path}" && echo "Mounted ${name}" else @@ -24,8 +26,8 @@ for path in "${!MODELS[@]}"; do done # hack for latent-diffusion -if test -f /models/LDSR.yaml; then - sed 's/ldm\./ldm_latent\./g' /models/LDSR.yaml >/latent-diffusion/experiments/pretrained_models/project.yaml +if test -f "${MODELS_DIR}/LDSR.yaml"; then + sed 's/ldm\./ldm_latent\./g' "${MODELS_DIR}/LDSR.yaml" >/latent-diffusion/experiments/pretrained_models/project.yaml fi # force facexlib cache diff --git a/services/lstein/Dockerfile b/services/lstein/Dockerfile index 966fd6c..8733407 100644 --- a/services/lstein/Dockerfile +++ b/services/lstein/Dockerfile @@ -27,5 +27,5 @@ WORKDIR /stable-diffusion EXPOSE 7860 # run, -u to not buffer stdout / stderr CMD mkdir -p /stable-diffusion/models/ldm/stable-diffusion-v1/ && \ - ln -sf /models/model.ckpt /stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt && \ + ln -sf /cache/models/model.ckpt /stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt && \ python3 -u scripts/dream.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}