Skip to content

Commit

Permalink
+1
Browse files Browse the repository at this point in the history
  • Loading branch information
hlky committed Nov 23, 2024
1 parent 6be2301 commit f41b2f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/diffusers/schedulers/scheduling_euler_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,22 +420,20 @@ def set_timesteps(
timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas[:-1]])
elif sigmas is not None and self.config.use_flow_match:
sigmas = np.array(sigmas).astype(np.float32)
timesteps = sigmas * self.config.num_train_timesteps

if self.config.use_flow_match:
if self.config.use_dynamic_shifting:
sigmas = self.time_shift(mu, 1.0, sigmas)
else:
sigmas = self.config.shift * sigmas / (1 + (self.config.shift - 1) * sigmas)

if self.config.use_karras_sigmas:
sigmas = self._convert_to_karras(in_sigmas=sigmas, num_inference_steps=self.num_inference_steps)
sigmas = self._convert_to_karras(in_sigmas=sigmas, num_inference_steps=num_inference_steps + 1)

elif self.config.use_exponential_sigmas:
sigmas = self._convert_to_exponential(in_sigmas=sigmas, num_inference_steps=num_inference_steps)
sigmas = self._convert_to_exponential(in_sigmas=sigmas, num_inference_steps=num_inference_steps + 1)

elif self.config.use_beta_sigmas:
sigmas = self._convert_to_beta(in_sigmas=sigmas, num_inference_steps=num_inference_steps)
sigmas = self._convert_to_beta(in_sigmas=sigmas, num_inference_steps=num_inference_steps + 1)

if self.config.invert_sigmas:
sigmas = 1.0 - sigmas
Expand Down

0 comments on commit f41b2f1

Please sign in to comment.