mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
Allow DDPMPipeline half precision (#9222)
Co-authored-by: YiYi Xu <yixu310@gmail.com>
This commit is contained in:
@@ -101,10 +101,10 @@ class DDPMPipeline(DiffusionPipeline):
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user