MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / step

Method step

diffsynth/schedulers/flow_match.py:40–50  ·  view source on GitHub ↗
(self, model_output, timestep, sample, to_final=False, **kwargs)

Source from the content-addressed store, hash-verified

38
39
40 def step(self, model_output, timestep, sample, to_final=False, **kwargs):
41 if isinstance(timestep, torch.Tensor):
42 timestep = timestep.cpu()
43 timestep_id = torch.argmin((self.timesteps - timestep).abs())
44 sigma = self.sigmas[timestep_id]
45 if to_final or timestep_id + 1 >= len(self.timesteps):
46 sigma_ = 1 if (self.inverse_timesteps or self.reverse_sigmas) else 0
47 else:
48 sigma_ = self.sigmas[timestep_id + 1]
49 prev_sample = sample + model_output * (sigma_ - sigma)
50 return prev_sample
51
52
53 def return_to_timestep(self, timestep, sample, sample_stablized):

Callers

nothing calls this directly

Calls 1

cpuMethod · 0.80

Tested by

no test coverage detected