From 6ba8969810ceaf9df93398dbe923eb9ec77917b7 Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Tue, 31 Jan 2023 20:29:06 -0800 Subject: [PATCH] correction to scale scheduler --- scripts/dynamic_thresholding.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/dynamic_thresholding.py b/scripts/dynamic_thresholding.py index 0c08772..e16a274 100644 --- a/scripts/dynamic_thresholding.py +++ b/scripts/dynamic_thresholding.py @@ -109,16 +109,17 @@ class CustomCFGDenoiser(sd_samplers_kdiffusion.CFGDenoiser): def interpretScale(self, scale, mode, min): scale -= min + max = self.maxSteps - 1 if mode == "Constant": pass elif mode == "Linear Down": - scale *= 1.0 - (self.step / self.maxSteps) + scale *= 1.0 - (self.step / max) elif mode == "Cosine Down": - scale *= 1.0 - math.cos(self.step / self.maxSteps) + scale *= 1.0 - math.cos(self.step / max) elif mode == "Linear Up": - scale *= self.step / self.maxSteps + scale *= self.step / max elif mode == "Cosine Up": - scale *= math.cos(self.step / self.maxSteps) + scale *= math.cos(self.step / max) scale += min return scale