Commit 8712a9ca authored by wangshankun's avatar wangshankun
Browse files

audio scheduler using noise generator

parent bb642a99
...@@ -98,5 +98,5 @@ class ConsistencyModelScheduler(EulerSchedulerTimestepFix): ...@@ -98,5 +98,5 @@ class ConsistencyModelScheduler(EulerSchedulerTimestepFix):
sigma = unsqueeze_to_ndim(self.sigmas[self.step_index], sample.ndim).to(sample.device, sample.dtype) sigma = unsqueeze_to_ndim(self.sigmas[self.step_index], sample.ndim).to(sample.device, sample.dtype)
sigma_next = unsqueeze_to_ndim(self.sigmas[self.step_index + 1], sample.ndim).to(sample.device, sample.dtype) sigma_next = unsqueeze_to_ndim(self.sigmas[self.step_index + 1], sample.ndim).to(sample.device, sample.dtype)
x0 = sample - model_output * sigma x0 = sample - model_output * sigma
x_t_next = x0 * (1 - sigma_next) + sigma_next * torch.randn_like(x0) x_t_next = x0 * (1 - sigma_next) + sigma_next * torch.randn(x0.shape, dtype=x0.dtype, device=x0.device, generator=self.generator)
self.latents = x_t_next self.latents = x_t_next
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment