aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-28 10:59:12 -0400
committerGitHub <noreply@github.com>2023-03-28 10:59:12 -0400
commit4414d36bf6e4f64cb6eac871c89c2e0daa4c5338 (patch)
treef35f4205328d275427781cdef145ae12014a6ad4 /scripts
parentc5f9f7c23759f9a74fa2b563451569c8926604ba (diff)
parent955df7751eef11bb7697e2d77f6b8a6226b21e13 (diff)
Merge branch 'master' into img2img-enhance
Diffstat (limited to 'scripts')
-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