diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 22e5d714..f4afb650 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -219,6 +219,12 @@ echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" echo. > "..\models\vae\Put your VAE files here.txt" echo. > "..\models\hypernetwork\Put your hypernetwork files here.txt" +@rem if downgrading from v2.5, migrate the models to the legacy path (if already downloaded) +if exist "..\models\stable-diffusion\sd-v1-4.ckpt" if not exist "sd-v1-4.ckpt" move ..\models\stable-diffusion\sd-v1-4.ckpt . +if exist "..\models\gfpgan\GFPGANv1.3.pth" if not exist "GFPGANv1.3.pth" move ..\models\gfpgan\GFPGANv1.3.pth . +if exist "..\models\realesrgan\RealESRGAN_x4plus.pth" if not exist "RealESRGAN_x4plus.pth" move ..\models\realesrgan\RealESRGAN_x4plus.pth . +if exist "..\models\realesrgan\RealESRGAN_x4plus_anime_6B.pth" if not exist "RealESRGAN_x4plus_anime_6B.pth" move ..\models\realesrgan\RealESRGAN_x4plus_anime_6B.pth . + @if exist "sd-v1-4.ckpt" ( for %%I in ("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 353a315e..44addb7e 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -175,6 +175,12 @@ echo "" > "../models/stable-diffusion/Put your custom ckpt files here.txt" echo "" > "../models/vae/Put your VAE files here.txt" echo "" > "../models/hypernetwork/Put your hypernetwork files here.txt" +# if downgrading from v2.5, migrate the models to the legacy path (if already downloaded) +if [ -e "../models/stable-diffusion/sd-v1-4.ckpt" ] && [ ! -e "sd-v1-4.ckpt" ]; then mv ../models/stable-diffusion/sd-v1-4.ckpt . ; fi +if [ -e "../models/gfpgan/GFPGANv1.3.pth" ] && [ ! -e "GFPGANv1.3.pth" ]; then mv ../models/gfpgan/GFPGANv1.3.pth . ; fi +if [ -e "../models/realesrgan/RealESRGAN_x4plus.pth" ] && [ ! -e "RealESRGAN_x4plus.pth" ]; then mv ../models/realesrgan/RealESRGAN_x4plus.pth . ; fi +if [ -e "../models/realesrgan/RealESRGAN_x4plus_anime_6B.pth" ] && [ ! -e "RealESRGAN_x4plus_anime_6B.pth" ]; then mv ../models/realesrgan/RealESRGAN_x4plus_anime_6B.pth . ; fi + if [ -f "sd-v1-4.ckpt" ]; then model_size=`find "sd-v1-4.ckpt" -printf "%s"`