From 8716116ada220172c36aa34a138f0a0ebefdd684 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 2 Oct 2022 16:30:30 +0200 Subject: Fix img2img --- schedulers/scheduling_euler_a.py | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'schedulers') diff --git a/schedulers/scheduling_euler_a.py b/schedulers/scheduling_euler_a.py index 1b1c9cf..a2d0e9f 100644 --- a/schedulers/scheduling_euler_a.py +++ b/schedulers/scheduling_euler_a.py @@ -191,27 +191,6 @@ class EulerAScheduler(SchedulerMixin, ConfigMixin): self.sigmas = get_sigmas(self.DSsigmas, self.num_inference_steps).to(device=device) self.timesteps = np.arange(0, self.num_inference_steps) - def add_noise_to_input( - self, sample: torch.FloatTensor, sigma: float, generator: Optional[torch.Generator] = None - ) -> Tuple[torch.FloatTensor, float]: - """ - Explicit Langevin-like "churn" step of adding noise to the sample according to a factor gamma_i ≥ 0 to reach a - higher noise level sigma_hat = sigma_i + gamma_i*sigma_i. - - TODO Args: - """ - if self.config.s_min <= sigma <= self.config.s_max: - gamma = min(self.config.s_churn / self.num_inference_steps, 2**0.5 - 1) - else: - gamma = 0 - - # sample eps ~ N(0, S_noise^2 * I) - eps = self.config.s_noise * torch.randn(sample.shape, generator=generator).to(sample.device) - sigma_hat = sigma + gamma * sigma - sample_hat = sample + ((sigma_hat**2 - sigma**2) ** 0.5 * eps) - - return sample_hat, sigma_hat - def step( self, model_output: torch.FloatTensor, @@ -219,9 +198,6 @@ class EulerAScheduler(SchedulerMixin, ConfigMixin): timestep_prev: int, sample: torch.FloatTensor, generator: None, - # ,sigma_hat: float, - # sigma_prev: float, - # sample_hat: torch.FloatTensor, return_dict: bool = True, ) -> Union[SchedulerOutput, Tuple]: """ -- cgit v1.2.3-70-g09d2