From d838453c4202246577522349b97480bd165578be Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Thu, 9 Feb 2023 22:46:49 -0800 Subject: [PATCH] fix cosine rates --- scripts/dynamic_thresholding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dynamic_thresholding.py b/scripts/dynamic_thresholding.py index 2aa39c3..c5e6568 100644 --- a/scripts/dynamic_thresholding.py +++ b/scripts/dynamic_thresholding.py @@ -126,11 +126,11 @@ class CustomCFGDenoiser(sd_samplers_kdiffusion.CFGDenoiser): elif mode == "Linear Down": scale *= 1.0 - (self.step / max) elif mode == "Cosine Down": - scale *= 1.0 - math.cos(self.step / max) + scale *= 1.0 - math.cos((self.step / max) * 1.5707) elif mode == "Linear Up": scale *= self.step / max elif mode == "Cosine Up": - scale *= math.cos(self.step / max) + scale *= math.cos((self.step / max) * 1.5707) scale += min return scale