Refactor invoke (#405)

Fixes a problem with cross attention class missing from diffusers


models are now taken from the huggingFace cache.


50eb02f68b
This commit is contained in:
AbdBarho
2023-04-16 10:56:27 +02:00
committed by GitHub
parent 555c26b7ce
commit 10c16e1971
4 changed files with 30 additions and 57 deletions

View File

@@ -4,25 +4,25 @@ set -Eeuo pipefail
declare -A MOUNTS
mkdir -p ${CONFIG_DIR}
# cache
MOUNTS["/root/.cache"]=/data/.cache/
# this is really just a hack to avoid migrations
rm -rf ${HF_HOME}/diffusers
# ui specific
MOUNTS["${ROOT}/models/codeformer"]=/data/Codeformer/
MOUNTS["${ROOT}/models/gfpgan/GFPGANv1.4.pth"]=/data/GFPGAN/GFPGANv1.4.pth
MOUNTS["${ROOT}/models/gfpgan/weights"]=/data/.cache/
MOUNTS["${ROOT}/models/gfpgan/weights"]=/data/GFPGAN/
MOUNTS["${ROOT}/models/realesrgan"]=/data/RealESRGAN/
MOUNTS["${ROOT}/models/bert-base-uncased"]=/data/.cache/huggingface/transformers/
MOUNTS["${ROOT}/models/openai/clip-vit-large-patch14"]=/data/.cache/huggingface/transformers/
MOUNTS["${ROOT}/models/CompVis/stable-diffusion-safety-checker"]=/data/.cache/huggingface/transformers/
MOUNTS["${ROOT}/models/ldm"]=/data/.cache/invoke/ldm/
MOUNTS["${ROOT}/embeddings"]=/data/embeddings/
# hacks
MOUNTS["${ROOT}/models/clipseg"]=/data/.cache/invoke/clipseg/
for to_path in "${!MOUNTS[@]}"; do
set -Eeuo pipefail
@@ -40,7 +40,8 @@ done
if "${PRELOAD}" == "true"; then
set -Eeuo pipefail
invokeai-configure --skip-sd-weights --root ${ROOT} --yes
invokeai-configure --root ${ROOT} --yes
cp ${ROOT}/configs/models.yaml ${CONFIG_DIR}/models.yaml
fi
exec "$@"