aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/loopback.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-03-26 03:48:29 +0000
committerGitHub <noreply@github.com>2023-03-26 03:48:29 +0000
commit64da5c46ef0d68b9048747c2e0d46ce3495f9f29 (patch)
tree8938fd832c31dad5fe6aa6b98742432caee510ea /scripts/loopback.py
parenta0d07fb5807ad55c8ccfdfc9a6d9ae3c62b9d211 (diff)
parent5c7ab90a4ea0ae907bb915c9ddbe40c529b7bcc9 (diff)
downloadstable-diffusion-webui-gfx803-64da5c46ef0d68b9048747c2e0d46ce3495f9f29.tar.gz
stable-diffusion-webui-gfx803-64da5c46ef0d68b9048747c2e0d46ce3495f9f29.tar.bz2
stable-diffusion-webui-gfx803-64da5c46ef0d68b9048747c2e0d46ce3495f9f29.zip
Merge pull request #8931 from LipeCarmel/patch-1
loopback.py Colab compatibility and bug fix
Diffstat (limited to 'scripts/loopback.py')
-rw-r--r--scripts/loopback.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/loopback.py b/scripts/loopback.py
index 9c388aa8..d3065fe6 100644
--- a/scripts/loopback.py
+++ b/scripts/loopback.py
@@ -54,15 +54,12 @@ class Script(scripts.Script):
return strength
progress = loop / (loops - 1)
- match denoising_curve:
- case "Aggressive":
- strength = math.sin((progress) * math.pi * 0.5)
-
- case "Lazy":
- strength = 1 - math.cos((progress) * math.pi * 0.5)
-
- case _:
- strength = progress
+ if denoising_curve == "Aggressive":
+ strength = math.sin((progress) * math.pi * 0.5)
+ elif denoising_curve == "Lazy":
+ strength = 1 - math.cos((progress) * math.pi * 0.5)
+ else:
+ strength = progress
change = (final_denoising_strength - initial_denoising_strength) * strength
return initial_denoising_strength + change