Skip to content

Commit

Permalink
Allow DDPMPipeline half precision (#9222)
Browse files Browse the repository at this point in the history
Co-authored-by: YiYi Xu <[email protected]>
  • Loading branch information
2 people authored and sayakpaul committed Dec 23, 2024
1 parent 7d92452 commit 078286a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/diffusers/pipelines/ddpm/pipeline_ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def __call__(

if self.device.type == "mps":
# randn does not work reproducibly on mps
image = randn_tensor(image_shape, generator=generator)
image = randn_tensor(image_shape, generator=generator, dtype=self.unet.dtype)
image = image.to(self.device)
else:
image = randn_tensor(image_shape, generator=generator, device=self.device)
image = randn_tensor(image_shape, generator=generator, device=self.device, dtype=self.unet.dtype)

# set step values
self.scheduler.set_timesteps(num_inference_steps)
Expand Down

0 comments on commit 078286a

Please sign in to comment.