Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: YiYi Xu <yixu310@gmail.com>
  • Loading branch information
hlky and yiyixuxu authored Sep 23, 2024
1 parent 7993eb3 commit e04194c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/diffusers/schedulers/scheduling_euler_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ def set_timesteps(
raise ValueError("Cannot set `timesteps` with `config.use_karras_sigmas = True`.")
if timesteps is not None and self.config.use_exponential_sigmas:
raise ValueError("Cannot set `timesteps` with `config.use_exponential_sigmas = True`.")
if self.config.use_exponential_sigmas and self.config.use_karras_sigmas:
raise ValueErrror("Cannot set both `config.use_exponential_sigmas = True` and config.use_karras_sigmas = True`")
if (
timesteps is not None
and self.config.timestep_type == "continuous"
Expand Down Expand Up @@ -402,7 +404,7 @@ def set_timesteps(
sigmas = self._convert_to_karras(in_sigmas=sigmas, num_inference_steps=self.num_inference_steps)
timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas])

if self.config.use_exponential_sigmas:
elif self.config.use_exponential_sigmas:
sigmas = self._convert_to_exponential(in_sigmas=sigmas, num_inference_steps=self.num_inference_steps)
timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas])

Expand Down

0 comments on commit e04194c

Please sign in to comment.