From d425dac499c7386464b2806889dcbd316a7a3579 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 22 Nov 2022 21:56:07 +0530 Subject: [PATCH 1/4] Merge pull request #529 from madrang/dragNdrop Fixing file drag and drop. --- ui/media/js/dnd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 4c14333c..62144a9b 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -406,7 +406,7 @@ async function parseContent(text) { } async function readFile(file, i) { - console.log(`Event %o reading file[${i}]:${file.name}...`, e) + console.log(`Event %o reading file[${i}]:${file.name}...`) const fileContent = (await file.text()).trim() return await parseContent(fileContent) } From ab4e3715243a3177b701c3b250b8f158cc833e44 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 22 Nov 2022 22:25:36 +0530 Subject: [PATCH 2/4] Fix whitespace during git apply --- scripts/on_sd_start.bat | 8 ++++---- scripts/on_sd_start.sh | 8 ++++---- ui/sd_internal/ddim_callback.patch | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index f1b459cb..a0813ec1 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -37,8 +37,8 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @call git pull @call git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - @call git apply --whitespace=nowarn ..\ui\sd_internal\ddim_callback.patch - @call git apply --whitespace=nowarn ..\ui\sd_internal\env_yaml.patch + @call git apply --whitespace=fix ..\ui\sd_internal\ddim_callback.patch + @call git apply --whitespace=fix ..\ui\sd_internal\env_yaml.patch @cd .. ) else ( @@ -55,8 +55,8 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @cd stable-diffusion @call git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - @call git apply --whitespace=nowarn ..\ui\sd_internal\ddim_callback.patch - @call git apply --whitespace=nowarn ..\ui\sd_internal\env_yaml.patch + @call git apply --whitespace=fix ..\ui\sd_internal\ddim_callback.patch + @call git apply --whitespace=fix ..\ui\sd_internal\env_yaml.patch @cd .. ) diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index 7745855a..a4f92428 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -30,8 +30,8 @@ if [ -e "scripts/install_status.txt" ] && [ `grep -c sd_git_cloned scripts/insta git pull git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - git apply --whitespace=nowarn ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" - git apply --whitespace=nowarn ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" + git apply --whitespace=fix ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" + git apply --whitespace=fix ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" cd .. else @@ -46,8 +46,8 @@ else cd stable-diffusion git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - git apply --whitespace=nowarn ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" - git apply --whitespace=nowarn ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" + git apply --whitespace=fix ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" + git apply --whitespace=fix ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" cd .. fi diff --git a/ui/sd_internal/ddim_callback.patch b/ui/sd_internal/ddim_callback.patch index 36335abe..9d5bd9e7 100644 --- a/ui/sd_internal/ddim_callback.patch +++ b/ui/sd_internal/ddim_callback.patch @@ -17,7 +17,7 @@ index b967b55..35ef520 100644 # sampling + if sampler in ('ddim', 'dpm2', 'heun', 'dpm2_a', 'lms') and not hasattr(self, 'ddim_timesteps'): + self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=False) - + if sampler == "plms": self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=False) @@ -528,39 +530,46 @@ class UNet(DDPM): @@ -103,7 +103,7 @@ index b967b55..35ef520 100644 @@ -730,10 +740,13 @@ class UNet(DDPM): unconditional_guidance_scale=unconditional_guidance_scale, unconditional_conditioning=unconditional_conditioning) - + + if callback: yield from callback(i) + if img_callback: yield from img_callback(x_dec, i) + @@ -239,7 +239,7 @@ index b967b55..35ef520 100644 - + 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 @@ -945,11 +982,13 @@ class UNet(DDPM): From 5a9c8e1d87050edbc948fdcfb29e7809bbd6a1ac Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 22 Nov 2022 23:21:11 +0530 Subject: [PATCH 3/4] Warn but don't fix whitespaces in a patch --- scripts/on_sd_start.bat | 8 ++++---- scripts/on_sd_start.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index a0813ec1..b6d03c53 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -37,8 +37,8 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @call git pull @call git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - @call git apply --whitespace=fix ..\ui\sd_internal\ddim_callback.patch - @call git apply --whitespace=fix ..\ui\sd_internal\env_yaml.patch + @call git apply --whitespace=warn ..\ui\sd_internal\ddim_callback.patch + @call git apply --whitespace=warn ..\ui\sd_internal\env_yaml.patch @cd .. ) else ( @@ -55,8 +55,8 @@ if exist "Open Developer Console.cmd" del "Open Developer Console.cmd" @cd stable-diffusion @call git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - @call git apply --whitespace=fix ..\ui\sd_internal\ddim_callback.patch - @call git apply --whitespace=fix ..\ui\sd_internal\env_yaml.patch + @call git apply --whitespace=warn ..\ui\sd_internal\ddim_callback.patch + @call git apply --whitespace=warn ..\ui\sd_internal\env_yaml.patch @cd .. ) diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index a4f92428..c808d691 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -30,8 +30,8 @@ if [ -e "scripts/install_status.txt" ] && [ `grep -c sd_git_cloned scripts/insta git pull git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - git apply --whitespace=fix ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" - git apply --whitespace=fix ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" + git apply --whitespace=warn ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" + git apply --whitespace=warn ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" cd .. else @@ -46,8 +46,8 @@ else cd stable-diffusion git -c advice.detachedHead=false checkout f6cfebffa752ee11a7b07497b8529d5971de916c - git apply --whitespace=fix ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" - git apply --whitespace=fix ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" + git apply --whitespace=warn ../ui/sd_internal/ddim_callback.patch || fail "ddim patch failed" + git apply --whitespace=warn ../ui/sd_internal/env_yaml.patch || fail "yaml patch failed" cd .. fi From 3b0ace3410e6c0ea7835f25b6eb3edab18ae9f85 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 22 Nov 2022 23:27:46 +0530 Subject: [PATCH 4/4] Revert whitespace fix --- ui/sd_internal/ddim_callback.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/sd_internal/ddim_callback.patch b/ui/sd_internal/ddim_callback.patch index 9d5bd9e7..36335abe 100644 --- a/ui/sd_internal/ddim_callback.patch +++ b/ui/sd_internal/ddim_callback.patch @@ -17,7 +17,7 @@ index b967b55..35ef520 100644 # sampling + if sampler in ('ddim', 'dpm2', 'heun', 'dpm2_a', 'lms') and not hasattr(self, 'ddim_timesteps'): + self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=False) - + if sampler == "plms": self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=False) @@ -528,39 +530,46 @@ class UNet(DDPM): @@ -103,7 +103,7 @@ index b967b55..35ef520 100644 @@ -730,10 +740,13 @@ class UNet(DDPM): unconditional_guidance_scale=unconditional_guidance_scale, unconditional_conditioning=unconditional_conditioning) - + + if callback: yield from callback(i) + if img_callback: yield from img_callback(x_dec, i) + @@ -239,7 +239,7 @@ index b967b55..35ef520 100644 - + 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 @@ -945,11 +982,13 @@ class UNet(DDPM):