From a2ce2e7424b41591ea92a73833ace6d842055a9b Mon Sep 17 00:00:00 2001 From: alex choi Date: Mon, 3 Jun 2024 17:39:29 +0000 Subject: [PATCH] ensure dtype match between diffused latents and vae weights --- src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py b/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py index 69f028914774..3842f1fc09af 100644 --- a/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py +++ b/src/diffusers/pipelines/pixart_alpha/pipeline_pixart_sigma.py @@ -862,7 +862,7 @@ def __call__( callback(step_idx, t, latents) if not output_type == "latent": - image = self.vae.decode(latents / self.vae.config.scaling_factor, return_dict=False)[0] + image = self.vae.decode(latents.to(self.vae.dtype) / self.vae.config.scaling_factor, return_dict=False)[0] if use_resolution_binning: image = self.image_processor.resize_and_crop_tensor(image, orig_width, orig_height) else: