From 5af84b8e90166811b01ec65d2e720d942cccaa9a Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 22 Nov 2022 22:21:54 +0530 Subject: [PATCH] Fix whitespace during git apply --- scripts/on_sd_start.bat | 4 ++-- scripts/on_sd_start.sh | 4 ++-- ui/sd_internal/ddim_callback.patch | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 799ea9bd..cd6ae984 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -39,7 +39,7 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @call git pull @call git -c advice.detachedHead=false checkout 7f32368ed1030a6e710537047bacd908adea183a - @call git apply --whitespace=nowarn ..\ui\sd_internal\ddim_callback.patch + @call git apply --whitespace=fix ..\ui\sd_internal\ddim_callback.patch @cd .. ) else ( @@ -56,7 +56,7 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @cd stable-diffusion @call git -c advice.detachedHead=false checkout 7f32368ed1030a6e710537047bacd908adea183a - @call git apply --whitespace=nowarn ..\ui\sd_internal\ddim_callback.patch + @call git apply --whitespace=fix ..\ui\sd_internal\ddim_callback.patch @cd .. ) diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index 9e55f5d8..514262ab 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -32,7 +32,7 @@ if [ -e "scripts/install_status.txt" ] && [ `grep -c sd_git_cloned scripts/insta git pull git -c advice.detachedHead=false checkout 7f32368ed1030a6e710537047bacd908adea183a - git apply --whitespace=nowarn ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" + git apply --whitespace=fix ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" cd .. else @@ -47,7 +47,7 @@ else cd stable-diffusion git -c advice.detachedHead=false checkout 7f32368ed1030a6e710537047bacd908adea183a - git apply --whitespace=nowarn ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" + git apply --whitespace=fix ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" cd .. fi diff --git a/ui/sd_internal/ddim_callback.patch b/ui/sd_internal/ddim_callback.patch index e4dd69e0..f40695c2 100644 --- a/ui/sd_internal/ddim_callback.patch +++ b/ui/sd_internal/ddim_callback.patch @@ -39,7 +39,7 @@ index 79058bc..a473411 100644 - if img_callback: img_callback(x_dec, i) + if callback: yield from callback(i) + if img_callback: yield from img_callback(x_dec, i) - + if mask is not None: - return x0 * mask + (1. - mask) * x_dec + x_dec = x0 * mask + (1. - mask) * x_dec @@ -111,7 +111,7 @@ index 79058bc..a473411 100644 - if img_callback: img_callback(x, i) + if callback: yield from callback(i) + if img_callback: yield from img_callback(x, i) - + d = to_d(x, sigma_hat, denoised) # Midpoint method, where the midpoint is chosen according to a rho=3 Karras schedule @@ -966,7 +966,7 @@ class UNet(DDPM):