Skip to content

Commit

Permalink
Organized the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Senume authored Dec 5, 2023
1 parent 0601382 commit 7f63b05
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/diffusers/schedulers/scheduling_euler_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,7 @@ def set_timesteps(self, num_inference_steps: int, device: Union[str, torch.devic
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])

# Checking 'sigmas' type before datatype conversion
if isinstance(sigmas, np.ndarray):
sigmas = torch.from_numpy(sigmas).to(dtype=torch.float32, device=device)
else:
sigmas = sigmas.to(dtype=torch.float32, device=device)
sigmas = torch.from_numpy(sigmas).to(dtype=torch.float32, device=device)

# TODO: Support the full EDM scalings for all prediction types and timestep types
if self.config.timestep_type == "continuous" and self.config.prediction_type == "v_prediction":
Expand Down

0 comments on commit 7f63b05

Please sign in to comment.