From bf1dc1d9bcb58407b910e2162b00db3d035a8d77 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 16 Mar 2023 17:10:08 -0400 Subject: [PATCH] Fix VAEEncodeForInpaint modifying source image. --- nodes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nodes.py b/nodes.py index 766be75d..9a878b44 100644 --- a/nodes.py +++ b/nodes.py @@ -189,6 +189,7 @@ class VAEEncodeForInpaint: y = (pixels.shape[2] // 64) * 64 mask = torch.nn.functional.interpolate(mask[None,None,], size=(pixels.shape[1], pixels.shape[2]), mode="bilinear")[0][0] + pixels = pixels.clone() if pixels.shape[1] != x or pixels.shape[2] != y: pixels = pixels[:,:x,:y,:] mask = mask[:x,:y]