Skip to content

Commit

Permalink
passing sigmas beta, exponential and karras
Browse files Browse the repository at this point in the history
  • Loading branch information
hlky committed Nov 23, 2024
1 parent e8c9f9d commit 6be2301
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/diffusers/schedulers/scheduling_euler_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ def set_timesteps(
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)

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

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

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

0 comments on commit 6be2301

Please sign in to comment.