Compare commits

...

2 Commits

Author SHA1 Message Date
yiyixuxu
768d662d31 Merge branch 'main' into fix-scheduler-index 2023-11-10 02:32:33 +00:00
yiyixuxu
3a9d18e8ce fix 2023-11-10 02:19:15 +00:00

View File

@@ -771,10 +771,7 @@ class DPMSolverMultistepScheduler(SchedulerMixin, ConfigMixin):
# is always the second index (or the last index if there is only 1)
# This way we can ensure we don't accidentally skip a sigma in
# case we start in the middle of the denoising schedule (e.g. for image-to-image)
elif len(index_candidates) > 1:
step_index = index_candidates[1].item()
else:
step_index = index_candidates[0].item()
step_index = index_candidates[0].item()
self._step_index = step_index
@@ -885,7 +882,7 @@ class DPMSolverMultistepScheduler(SchedulerMixin, ConfigMixin):
schedule_timesteps = self.timesteps.to(original_samples.device)
timesteps = timesteps.to(original_samples.device)
step_indices = [(schedule_timesteps == t).nonzero().item() for t in timesteps]
step_indices = [(schedule_timesteps == t).nonzero()[0].item() for t in timesteps]
sigma = sigmas[step_indices].flatten()
while len(sigma.shape) < len(original_samples.shape):