diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 368a4ce1..dc7e1a65 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -49,6 +49,11 @@ if exist "env" ( if exist src rename src src-old if exist ldm rename ldm ldm-old +if not exist "..\models\stable-diffusion" mkdir "..\models\stable-diffusion" +if not exist "..\models\gfpgan" mkdir "..\models\gfpgan" +if not exist "..\models\realesrgan" mkdir "..\models\realesrgan" +if not exist "..\models\vae" mkdir "..\models\vae" + @rem migrate the legacy models to the correct path (if already downloaded) if exist "sd-v1-4.ckpt" move sd-v1-4.ckpt ..\models\stable-diffusion\ if exist "custom-model.ckpt" move custom-model.ckpt ..\models\stable-diffusion\ @@ -159,12 +164,6 @@ call WHERE uvicorn > .tmp @echo conda_sd_ui_deps_installed >> ..\scripts\install_status.txt ) - -if not exist "..\models\stable-diffusion" mkdir "..\models\stable-diffusion" -if not exist "..\models\gfpgan" mkdir "..\models\gfpgan" -if not exist "..\models\realesrgan" mkdir "..\models\realesrgan" -if not exist "..\models\vae" mkdir "..\models\vae" - @if exist "..\models\stable-diffusion\sd-v1-4.ckpt" ( for %%I in ("..\models\stable-diffusion\sd-v1-4.ckpt") do if "%%~zI" EQU "4265380512" ( echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the HuggingFace 4 GB Model." diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index c582b07f..46375a0c 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -43,6 +43,11 @@ fi if [ -e "src" ]; then mv src src-old; fi if [ -e "ldm" ]; then mv ldm ldm-old; fi +mkdir -p "../models/stable-diffusion" +mkdir -p "../models/gfpgan" +mkdir -p "../models/realesrgan" +mkdir -p "../models/vae" + # migrate the legacy models to the correct path (if already downloaded) if [ -e "sd-v1-4.ckpt" ]; then mv sd-v1-4.ckpt ../models/stable-diffusion/; fi if [ -e "custom-model.ckpt" ]; then mv custom-model.ckpt ../models/stable-diffusion/; fi @@ -131,11 +136,6 @@ else fi fi -mkdir -p "../models/stable-diffusion" -mkdir -p "../models/gfpgan" -mkdir -p "../models/realesrgan" -mkdir -p "../models/vae" - if [ -f "../models/stable-diffusion/sd-v1-4.ckpt" ]; then model_size=`find "../models/stable-diffusion/sd-v1-4.ckpt" -printf "%s"`