MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / scale_schedule

Method scale_schedule

diffusers/examples/community/sde_drag.py:537–546  ·  view source on GitHub ↗
(begin, end, n, length, type="linear")

Source from the content-addressed store, hash-verified

535
536 def _forward(self, latent, steps, t0, lora_scale_min, text_embeddings, generator):
537 def scale_schedule(begin, end, n, length, type="linear"):
538 if type == "constant":
539 return end
540 elif type == "linear":
541 return begin + (end - begin) * n / length
542 elif type == "cos":
543 factor = (1 - math.cos(n * math.pi / length)) / 2
544 return (1 - factor) * begin + factor * end
545 else:
546 raise NotImplementedError(type)
547
548 noises = []
549 latents = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected