Skip to content

Commit e0d2e1b

Browse files
committed
Propagated the fix to the klein inpaint pipeline
1 parent 8af5ee2 commit e0d2e1b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/diffusers/pipelines/flux2/pipeline_flux2_klein_inpaint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ def _encode_vae_image(self, image: torch.Tensor, generator: torch.Generator):
547547
image_latents = self._patchify_latents(image_latents)
548548

549549
latents_bn_mean = self.vae.bn.running_mean.view(1, -1, 1, 1).to(image_latents.device, image_latents.dtype)
550-
latents_bn_std = torch.sqrt(self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps)
550+
latents_bn_std = torch.sqrt(self.vae.bn.running_var.view(1, -1, 1, 1) + self.vae.config.batch_norm_eps).to(
551+
image_latents.device, image_latents.dtype
552+
)
551553
image_latents = (image_latents - latents_bn_mean) / latents_bn_std
552554

553555
return image_latents

0 commit comments

Comments
 (0)