diff --git a/src/diffusers/schedulers/scheduling_euler_discrete.py b/src/diffusers/schedulers/scheduling_euler_discrete.py index 53dc2ae15432..4e1b75845715 100644 --- a/src/diffusers/schedulers/scheduling_euler_discrete.py +++ b/src/diffusers/schedulers/scheduling_euler_discrete.py @@ -280,7 +280,12 @@ 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]) - sigmas = torch.from_numpy(sigmas).to(dtype=torch.float32, device=device) + # 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) + # 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":