Sawtooth mode
This commit is contained in:
+2
-2
@@ -37,8 +37,6 @@ class DynThresh:
|
||||
scale *= 1.0 - math.pow(self.step / max, self.sched_val)
|
||||
elif mode == "Linear Repeating":
|
||||
portion = ((self.step / max) * self.sched_val) % 1.0
|
||||
start = math.floor(portion)
|
||||
portion -= start
|
||||
scale *= (0.5 - portion) * 2 if portion < 0.5 else (portion - 0.5) * 2
|
||||
elif mode == "Cosine Repeating":
|
||||
curved = 1.0 - (math.cos((self.step / max) * 3.14159 * self.sched_val) * 0.5 + 0.5)
|
||||
@@ -46,6 +44,8 @@ class DynThresh:
|
||||
start = math.floor(portion)
|
||||
portion -= start
|
||||
scale *= (0.5 - portion) * 2 if portion < 0.5 else (portion - 0.5) * 2
|
||||
elif mode == "Sawtooth":
|
||||
scale *= ((self.step / max) * self.sched_val) % 1.0
|
||||
scale += min
|
||||
return scale
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ except Exception as e:
|
||||
print(f"\n\n======\nError! UniPC sampler support failed to load! Is your WebUI up to date?\n(Error: {e})\n======")
|
||||
|
||||
######################### Data values #########################
|
||||
VALID_MODES = ["Constant", "Linear Down", "Cosine Down", "Half Cosine Down", "Linear Up", "Cosine Up", "Half Cosine Up", "Power Up", "Power Down", "Linear Repeating", "Cosine Repeating"]
|
||||
MODES_WITH_VALUE = ["Power Up", "Power Down", "Linear Repeating", "Cosine Repeating"]
|
||||
VALID_MODES = ["Constant", "Linear Down", "Cosine Down", "Half Cosine Down", "Linear Up", "Cosine Up", "Half Cosine Up", "Power Up", "Power Down", "Linear Repeating", "Cosine Repeating", "Sawtooth"]
|
||||
MODES_WITH_VALUE = ["Power Up", "Power Down", "Linear Repeating", "Cosine Repeating", "Sawtooth"]
|
||||
|
||||
######################### Script class entrypoint #########################
|
||||
class Script(scripts.Script):
|
||||
|
||||
Reference in New Issue
Block a user