From 5b3eb3b24c2ed33911a7c50b5b1e0f729b86c688 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 1 Oct 2022 11:40:14 +0200 Subject: Made inference script interactive --- schedulers/scheduling_euler_a.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'schedulers') diff --git a/schedulers/scheduling_euler_a.py b/schedulers/scheduling_euler_a.py index 57a56de..29ebd07 100644 --- a/schedulers/scheduling_euler_a.py +++ b/schedulers/scheduling_euler_a.py @@ -216,7 +216,7 @@ class EulerAScheduler(SchedulerMixin, ConfigMixin): self.num_inference_steps = num_inference_steps self.DSsigmas = ((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5 - self.sigmas = get_sigmas(self.DSsigmas, self.num_inference_steps).to(device=device) + self.sigmas = get_sigmas(self.DSsigmas, self.num_inference_steps - 1).to(device=device) self.timesteps = self.sigmas def add_noise_to_input( @@ -272,11 +272,7 @@ class EulerAScheduler(SchedulerMixin, ConfigMixin): """ latents = sample sigma_down, sigma_up = get_ancestral_step(timestep, timestep_prev) - - # if callback is not None: - # callback({'x': latents, 'i': i, 'sigma': timestep, 'sigma_hat': timestep, 'denoised': model_output}) d = to_d(latents, timestep, model_output) - # Euler method dt = sigma_down - timestep latents = latents + d * dt latents = latents + torch.randn(latents.shape, layout=latents.layout, device=latents.device, -- cgit v1.2.3-70-g09d2