migrate hlky

This commit is contained in:
AbdBarho 2022-10-01 12:17:53 +02:00
parent 0f6fb2e67b
commit bb6b6386f0
4 changed files with 24 additions and 26 deletions

View file

@ -18,3 +18,6 @@ aria2c --input-file /docker/links.txt --dir /data --continue
echo "Checking SHAs..." echo "Checking SHAs..."
parallel --will-cite -a /docker/checksums.sha256 "echo -n {} | sha256sum -c" parallel --will-cite -a /docker/checksums.sha256 "echo -n {} | sha256sum -c"
# fix potential permissions
chmod -R 777 /data /output

View file

@ -42,9 +42,9 @@ COPY . /docker/
RUN python /docker/info.py /stable-diffusion/frontend/frontend.py && chmod +x /docker/mount.sh RUN python /docker/info.py /stable-diffusion/frontend/frontend.py && chmod +x /docker/mount.sh
WORKDIR /stable-diffusion WORKDIR /stable-diffusion
ENV TRANSFORMERS_CACHE=/cache/transformers TORCH_HOME=/cache/torch PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS="" ENV PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
EXPOSE 7860 EXPOSE 7860
# run, -u to not buffer stdout / stderr # run, -u to not buffer stdout / stderr
CMD /docker/mount.sh && \ CMD /docker/mount.sh && \
python3 -u scripts/webui.py --outdir /output --ckpt /cache/models/model.ckpt ${CLI_ARGS} python3 -u scripts/webui.py --outdir /output --ckpt /data/StableDiffusion/model.ckpt ${CLI_ARGS}
# sed -i -- 's/8501/7860/g' .streamlit/config.toml && STREAMLIT_SERVER_HEADLESS=true python -u -m streamlit run scripts/webui_streamlit.py --theme.base dark --server.port 7860 # sed -i -- 's/8501/7860/g' .streamlit/config.toml && STREAMLIT_SERVER_HEADLESS=true python -u -m streamlit run scripts/webui_streamlit.py --theme.base dark

View file

@ -1,33 +1,28 @@
#!/bin/bash #!/bin/bash
set -e set -Eeuo pipefail
declare -A MODELS declare -A MOUNTS
ROOT=/stable-diffusion/src ROOT=/stable-diffusion/src
MODELS["${ROOT}/gfpgan/experiments/pretrained_models/GFPGANv1.3.pth"]=GFPGANv1.3.pth # cache
MODELS["${ROOT}/realesrgan/experiments/pretrained_models/RealESRGAN_x4plus.pth"]=RealESRGAN_x4plus.pth MOUNTS["/root/.cache"]=/data/.cache
MODELS["${ROOT}/realesrgan/experiments/pretrained_models/RealESRGAN_x4plus_anime_6B.pth"]=RealESRGAN_x4plus_anime_6B.pth # ui specific
MODELS["${ROOT}/latent-diffusion/experiments/pretrained_models/model.ckpt"]=LDSR.ckpt MOUNTS["${ROOT}/gfpgan/experiments/pretrained_models/GFPGANv1.3.pth"]=/data/GFPGAN/GFPGANv1.4.pth
MODELS["${ROOT}/latent-diffusion/experiments/pretrained_models/project.yaml"]=LDSR.yaml MOUNTS["${ROOT}/realesrgan/experiments/pretrained_models"]=/data/RealESRGAN
MOUNTS["${ROOT}/latent-diffusion/experiments/pretrained_models"]=/data/LDSR
# hacks
MOUNTS["/stable-diffusion/gfpgan/weights"]=/data/.cache
MODELS_DIR=/cache/models for to_path in "${!MOUNTS[@]}"; do
set -Eeuo pipefail
for path in "${!MODELS[@]}"; do from_path="${MOUNTS[${to_path}]}"
name=${MODELS[$path]} rm -rf "${to_path}"
base=$(dirname "${path}") mkdir -p "$(dirname "${to_path}")"
from_path="${MODELS_DIR}/${name}" ln -sT "${from_path}" "${to_path}"
if test -f "${from_path}"; then echo Mounted $(basename "${from_path}")
mkdir -p "${base}" && ln -sf "${from_path}" "${path}" && echo "Mounted ${name}"
else
echo "Skipping ${name}"
fi
done done
# force facexlib cache
mkdir -p /cache/weights/ /stable-diffusion/gfpgan/
ln -sf /cache/weights/ /stable-diffusion/gfpgan/
# streamlit config # streamlit config
ln -sf /docker/userconfig_streamlit.yaml /stable-diffusion/configs/webui/userconfig_streamlit.yaml ln -sf /docker/userconfig_streamlit.yaml /stable-diffusion/configs/webui/userconfig_streamlit.yaml

View file

@ -1,7 +1,7 @@
general: general:
outdir: /outputs outdir: /outputs
default_model: "Stable Diffusion v1.4" default_model: "Stable Diffusion v1.4"
default_model_path: /cache/models/model.ckpt default_model_path: /data/StableDiffusion/model.ckpt
outdir_txt2img: /outputs/txt2img-samples outdir_txt2img: /outputs/txt2img-samples
outdir_img2img: /outputs/img2img-samples outdir_img2img: /outputs/img2img-samples
optimized: True optimized: True