Don't download 1.4 if other models are available

This commit is contained in:
JeLuF 2023-04-17 23:22:44 +02:00
parent 4192f87d6b
commit 44824fb5f9
2 changed files with 18 additions and 13 deletions

View File

@ -186,7 +186,8 @@ call WHERE uvicorn > .tmp
)
)
@if not exist "..\models\stable-diffusion\sd-v1-4.ckpt" (
@if not exist "..\models\stable-diffusion\*.ckpt" (
@if not exist "..\models\stable-diffusion\*.safetensors" (
@echo. & echo "Downloading data files (weights) for Stable Diffusion.." & echo.
@call curl -L -k https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt > ..\models\stable-diffusion\sd-v1-4.ckpt
@ -204,6 +205,7 @@ call WHERE uvicorn > .tmp
exit /b
)
)
)

View File

@ -170,8 +170,11 @@ if [ -f "../models/stable-diffusion/sd-v1-4.ckpt" ]; then
fi
fi
if [ ! -f "../models/stable-diffusion/sd-v1-4.ckpt" ]; then
echo "Downloading data files (weights) for Stable Diffusion.."
if find "../models/stable-diffusion/" -name "*.ckpt" -or -name "*.safetensors" > /dev/null; then
echo "Found existing model file(s)."
else
echo "Downloading data files (weights) for Stable Diffusion..."
curl -L -k https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt > ../models/stable-diffusion/sd-v1-4.ckpt