From fea8a25299c9674ce66f5b65e1c255aab43cd218 Mon Sep 17 00:00:00 2001 From: gafar-code Date: Wed, 17 Apr 2024 15:30:21 +0700 Subject: [PATCH] Fix --- nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index ea1e3203..448a1697 100644 --- a/nodes.py +++ b/nodes.py @@ -321,7 +321,7 @@ class VAEEncodeForInpaint: def encode(self, vae, pixels, mask, grow_mask_by=6): x = (pixels.shape[1] // vae.downscale_ratio) * vae.downscale_ratio y = (pixels.shape[2] // vae.downscale_ratio) * vae.downscale_ratio - mask = torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(pixels.shape[1], pixels.shape[2]), mode="bilinear") + mask = torch.nn.functional.interpolate(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])), size=(pixels.shape[1], pixels.shape[2]), mode="bilinear").float() pixels = pixels.clone() if pixels.shape[1] != x or pixels.shape[2] != y: