"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0744378dc0c34d53ec4b1155f2cf87364a0754b1"
Unverified Commit e4052643 authored by FurryPotato's avatar FurryPotato Committed by GitHub
Browse files

[scheduler] fix some scheduler dtype error (#2992)


Co-authored-by: default avatarwangguan <dizhipeng.dzp@alibaba-inc.com>
Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
parent 24947317
...@@ -201,7 +201,7 @@ class KDPM2AncestralDiscreteScheduler(SchedulerMixin, ConfigMixin): ...@@ -201,7 +201,7 @@ class KDPM2AncestralDiscreteScheduler(SchedulerMixin, ConfigMixin):
else: else:
timesteps = torch.from_numpy(timesteps).to(device) timesteps = torch.from_numpy(timesteps).to(device)
timesteps_interpol = self.sigma_to_t(sigmas_interpol).to(device) timesteps_interpol = self.sigma_to_t(sigmas_interpol).to(device, dtype=timesteps.dtype)
interleaved_timesteps = torch.stack((timesteps_interpol[:-2, None], timesteps[1:, None]), dim=-1).flatten() interleaved_timesteps = torch.stack((timesteps_interpol[:-2, None], timesteps[1:, None]), dim=-1).flatten()
self.timesteps = torch.cat([timesteps[:1], interleaved_timesteps]) self.timesteps = torch.cat([timesteps[:1], interleaved_timesteps])
......
...@@ -190,7 +190,7 @@ class KDPM2DiscreteScheduler(SchedulerMixin, ConfigMixin): ...@@ -190,7 +190,7 @@ class KDPM2DiscreteScheduler(SchedulerMixin, ConfigMixin):
timesteps = torch.from_numpy(timesteps).to(device) timesteps = torch.from_numpy(timesteps).to(device)
# interpolate timesteps # interpolate timesteps
timesteps_interpol = self.sigma_to_t(sigmas_interpol).to(device) timesteps_interpol = self.sigma_to_t(sigmas_interpol).to(device, dtype=timesteps.dtype)
interleaved_timesteps = torch.stack((timesteps_interpol[1:-1, None], timesteps[1:, None]), dim=-1).flatten() interleaved_timesteps = torch.stack((timesteps_interpol[1:-1, None], timesteps[1:, None]), dim=-1).flatten()
self.timesteps = torch.cat([timesteps[:1], interleaved_timesteps]) self.timesteps = torch.cat([timesteps[:1], interleaved_timesteps])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment