From a959c69d32b3ff36cf9de4d19b00a1dec0d0525e Mon Sep 17 00:00:00 2001 From: JeLuF Date: Wed, 26 Oct 2022 13:26:19 +0200 Subject: [PATCH 1/2] Retry downloads for flaky internet connections See issue #392 --- scripts/on_sd_start.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index ca492df5..4d3768e2 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -209,7 +209,7 @@ echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" @if not exist "sd-v1-4.ckpt" ( @echo. & echo "Downloading data files (weights) for Stable Diffusion.." & echo. - @call curl -L -k https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt > sd-v1-4.ckpt + @call curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt > sd-v1-4.ckpt @if exist "sd-v1-4.ckpt" ( for %%I in ("sd-v1-4.ckpt") do if "%%~zI" NEQ "4265380512" ( @@ -239,7 +239,7 @@ echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" @if not exist "GFPGANv1.3.pth" ( @echo. & echo "Downloading data files (weights) for GFPGAN (Face Correction).." & echo. - @call curl -L -k https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth > GFPGANv1.3.pth + @call curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth > GFPGANv1.3.pth @if exist "GFPGANv1.3.pth" ( for %%I in ("GFPGANv1.3.pth") do if "%%~zI" NEQ "348632874" ( @@ -269,7 +269,7 @@ echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" @if not exist "RealESRGAN_x4plus.pth" ( @echo. & echo "Downloading data files (weights) for ESRGAN (Resolution Upscaling) x4plus.." & echo. - @call curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth > RealESRGAN_x4plus.pth + @call curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth > RealESRGAN_x4plus.pth @if exist "RealESRGAN_x4plus.pth" ( for %%I in ("RealESRGAN_x4plus.pth") do if "%%~zI" NEQ "67040989" ( @@ -299,7 +299,7 @@ echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" @if not exist "RealESRGAN_x4plus_anime_6B.pth" ( @echo. & echo "Downloading data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime.." & echo. - @call curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth > RealESRGAN_x4plus_anime_6B.pth + @call curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth > RealESRGAN_x4plus_anime_6B.pth @if exist "RealESRGAN_x4plus_anime_6B.pth" ( for %%I in ("RealESRGAN_x4plus_anime_6B.pth") do if "%%~zI" NEQ "17938799" ( From 4994a7ac851ca4dedb8e2602211110e076a56620 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Wed, 26 Oct 2022 13:27:49 +0200 Subject: [PATCH 2/2] Update on_sd_start.sh --- scripts/on_sd_start.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index e949dfcb..deab7708 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -181,7 +181,7 @@ fi if [ ! -f "sd-v1-4.ckpt" ]; then echo "Downloading data files (weights) for Stable Diffusion.." - curl -L -k https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt > sd-v1-4.ckpt + curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt > sd-v1-4.ckpt if [ -f "sd-v1-4.ckpt" ]; then model_size=`find "sd-v1-4.ckpt" -printf "%s"` @@ -213,7 +213,7 @@ fi if [ ! -f "GFPGANv1.3.pth" ]; then echo "Downloading data files (weights) for GFPGAN (Face Correction).." - curl -L -k https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth > GFPGANv1.3.pth + curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth > GFPGANv1.3.pth if [ -f "GFPGANv1.3.pth" ]; then model_size=`find "GFPGANv1.3.pth" -printf "%s"` @@ -245,7 +245,7 @@ fi if [ ! -f "RealESRGAN_x4plus.pth" ]; then echo "Downloading data files (weights) for ESRGAN (Resolution Upscaling) x4plus.." - curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth > RealESRGAN_x4plus.pth + curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth > RealESRGAN_x4plus.pth if [ -f "RealESRGAN_x4plus.pth" ]; then model_size=`find "RealESRGAN_x4plus.pth" -printf "%s"` @@ -277,7 +277,7 @@ fi if [ ! -f "RealESRGAN_x4plus_anime_6B.pth" ]; then echo "Downloading data files (weights) for ESRGAN (Resolution Upscaling) x4plus_anime.." - curl -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth > RealESRGAN_x4plus_anime_6B.pth + curl -C - --retry 20 --retry-all-errors --retry-delay 5 -L -k https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth > RealESRGAN_x4plus_anime_6B.pth if [ -f "RealESRGAN_x4plus_anime_6B.pth" ]; then model_size=`find "RealESRGAN_x4plus_anime_6B.pth" -printf "%s"`