- + +
diff --git a/scripts/on_env_start.bat b/scripts/on_env_start.bat index 2919cb89..b18b4f4e 100644 --- a/scripts/on_env_start.bat +++ b/scripts/on_env_start.bat @@ -50,7 +50,7 @@ if "%update_branch%"=="" ( ) ) -@xcopy sd-ui-files\ui ui /s /i /Y +@xcopy sd-ui-files\ui ui /s /i /Y /q @copy sd-ui-files\scripts\on_sd_start.bat scripts\ /Y @copy sd-ui-files\scripts\bootstrap.bat scripts\ /Y @copy "sd-ui-files\scripts\Start Stable Diffusion UI.cmd" . /Y diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 48894771..51a51549 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -199,7 +199,9 @@ call WHERE uvicorn > .tmp if not exist "..\models\stable-diffusion" mkdir "..\models\stable-diffusion" +if not exist "..\models\vae" mkdir "..\models\vae" echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" +echo. > "..\models\vae\Put your VAE files here.txt" @if exist "sd-v1-4.ckpt" ( for %%I in ("sd-v1-4.ckpt") do if "%%~zI" EQU "4265380512" ( @@ -329,6 +331,36 @@ echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" +@if exist "..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt" ( + for %%I in ("..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt") do if "%%~zI" EQU "334695179" ( + echo "Data files (weights) necessary for the default VAE (sd-vae-ft-mse-original) were already downloaded" + ) else ( + echo. & echo "The default VAE (sd-vae-ft-mse-original) file present at models\vae\vae-ft-mse-840000-ema-pruned.ckpt is invalid. It is only %%~zI bytes in size. Re-downloading.." & echo. + del "..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt" + ) +) + +@if not exist "..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt" ( + @echo. & echo "Downloading data files (weights) for the default VAE (sd-vae-ft-mse-original).." & echo. + + @call curl -L -k https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt > ..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt + + @if exist "..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt" ( + for %%I in ("..\models\vae\vae-ft-mse-840000-ema-pruned.ckpt") do if "%%~zI" NEQ "334695179" ( + echo. & echo "Error: The downloaded default VAE (sd-vae-ft-mse-original) file was invalid! Bytes downloaded: %%~zI" & echo. + echo. & echo "Error downloading the data files (weights) for the default VAE (sd-vae-ft-mse-original). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo. + pause + exit /b + ) + ) else ( + @echo. & echo "Error downloading the data files (weights) for the default VAE (sd-vae-ft-mse-original). Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo. + pause + exit /b + ) +) + + + @>nul findstr /m "sd_install_complete" ..\scripts\install_status.txt @if "%ERRORLEVEL%" NEQ "0" ( @echo sd_weights_downloaded >> ..\scripts\install_status.txt diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index ff18df13..d4bb1ad1 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -159,7 +159,9 @@ fi mkdir -p "../models/stable-diffusion" +mkdir -p "../models/vae" echo "" > "../models/stable-diffusion/Put your custom ckpt files here.txt" +echo "" > "../models/vae/Put your VAE files here.txt" if [ -f "sd-v1-4.ckpt" ]; then model_size=`find "sd-v1-4.ckpt" -printf "%s"` @@ -269,6 +271,38 @@ if [ ! -f "RealESRGAN_x4plus_anime_6B.pth" ]; then fi +if [ -f "../models/vae/vae-ft-mse-840000-ema-pruned.ckpt" ]; then + model_size=`find ../models/vae/vae-ft-mse-840000-ema-pruned.ckpt -printf "%s"` + + if [ "$model_size" -eq "334695179" ]; then + echo "Data files (weights) necessary for the default VAE (sd-vae-ft-mse-original) were already downloaded" + else + printf "\n\nThe model file present at models/vae/vae-ft-mse-840000-ema-pruned.ckpt is invalid. It is only $model_size bytes in size. Re-downloading.." + rm ../models/vae/vae-ft-mse-840000-ema-pruned.ckpt + fi +fi + +if [ ! -f "../models/vae/vae-ft-mse-840000-ema-pruned.ckpt" ]; then + echo "Downloading data files (weights) for the default VAE (sd-vae-ft-mse-original).." + + curl -L -k https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt > ../models/vae/vae-ft-mse-840000-ema-pruned.ckpt + + if [ -f "../models/vae/vae-ft-mse-840000-ema-pruned.ckpt" ]; then + model_size=`find ../models/vae/vae-ft-mse-840000-ema-pruned.ckpt -printf "%s"` + if [ ! "$model_size" -eq "334695179" ]; then + printf "\n\nError: The downloaded default VAE (sd-vae-ft-mse-original) file was invalid! Bytes downloaded: $model_size\n\n" + printf "\n\nError downloading the data files (weights) for the default VAE (sd-vae-ft-mse-original). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n" + read -p "Press any key to continue" + exit + fi + else + printf "\n\nError downloading the data files (weights) for the default VAE (sd-vae-ft-mse-original). Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n" + read -p "Press any key to continue" + exit + fi +fi + + if [ `grep -c sd_install_complete ../scripts/install_status.txt` -gt "0" ]; then echo sd_weights_downloaded >> ../scripts/install_status.txt echo sd_install_complete >> ../scripts/install_status.txt diff --git a/ui/index.html b/ui/index.html index fd6b7409..a32337f9 100644 --- a/ui/index.html +++ b/ui/index.html @@ -1,14 +1,15 @@
++ + Click to learn more about VAEs | |
+ Click to learn more about samplers | |
Select which settings should be remembered when restarting the browser
-