diff options
author | space-nuko <24979496+space-nuko@users.noreply.github.com> | 2023-03-28 14:59:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 14:59:12 +0000 |
commit | 4414d36bf6e4f64cb6eac871c89c2e0daa4c5338 (patch) | |
tree | f35f4205328d275427781cdef145ae12014a6ad4 /scripts/loopback.py | |
parent | c5f9f7c23759f9a74fa2b563451569c8926604ba (diff) | |
parent | 955df7751eef11bb7697e2d77f6b8a6226b21e13 (diff) | |
download | stable-diffusion-webui-gfx803-4414d36bf6e4f64cb6eac871c89c2e0daa4c5338.tar.gz stable-diffusion-webui-gfx803-4414d36bf6e4f64cb6eac871c89c2e0daa4c5338.tar.bz2 stable-diffusion-webui-gfx803-4414d36bf6e4f64cb6eac871c89c2e0daa4c5338.zip |
Merge branch 'master' into img2img-enhance
Diffstat (limited to 'scripts/loopback.py')
-rw-r--r-- | scripts/loopback.py | 15 |
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
|