Closed
Description
Describe the bug
following schedulers implement beta and exponential sigma methods:
scheduling_deis_multistep.py
scheduling_dpmsolver_multistep.py
scheduling_dpmsolver_multistep_inverse.py
scheduling_dpmsolver_sde.py
scheduling_dpmsolver_singlestep.py
scheduling_euler_discrete.py
scheduling_heun_discrete.py
scheduling_k_dpm_2_ancestral_discrete.py
scheduling_k_dpm_2_discrete.py
scheduling_lms_discrete.py
scheduling_sasolver.py
scheduling_unipc_multistep.py
and in all of them, its pretty much broken.
(ok, i admit i tested only 6, not all)
looking at code segment:
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])
elif self.config.use_beta_sigmas:
sigmas = self._convert_to_beta(in_sigmas=sigmas, num_inference_steps=self.num_inference_steps)
timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas])
- it refers to
log_sigmas
, but they are only set ifself.config.use_karras_sigmas
, otherwise its UNDEFINED - it refers to
self.num_inference_steps
, but that param is set AFTER this code segment and here its NONE - actual sigmas at the end are blindly converted from numpy to tensor even if they are already a tensor causing a runtime error
Reproduction
simply use ANY of the above schedulers with either use_exponential_sigmas
or use_beta_sigmas
Logs
UnboundLocalError: cannot access local variable 'log_sigmas' where it is not associated with a value
or
TypeError: linspace() received an invalid combination of arguments - got (float, float, NoneType), but expected one of:
or
TypeError: 'NoneType' object cannot be interpreted as an integer
or
TypeError: expected np.ndarray (got Tensor)
System Info
diffusers from main branch as of 11/18/24 commit #345907f