hunyuanvideo step_processor

This commit is contained in:
Artiprocher
2024-12-26 10:13:46 +08:00
parent e38ccf4c2f
commit 6a999e1127
2 changed files with 21 additions and 1 deletions

View File

@@ -47,7 +47,12 @@ class FlowMatchScheduler():
def return_to_timestep(self, timestep, sample, sample_stablized):
# This scheduler doesn't support this function.
pass
if isinstance(timestep, torch.Tensor):
timestep = timestep.cpu()
timestep_id = torch.argmin((self.timesteps - timestep).abs())
sigma = self.sigmas[timestep_id]
model_output = (sample - sample_stablized) / sigma
return model_output
def add_noise(self, original_samples, noise, timestep):