From 3f903091b3ed3a23b1bd4010d135f138ffc7f187 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:01:27 +0200 Subject: [PATCH] Update image_nodes.py --- nodes/image_nodes.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nodes/image_nodes.py b/nodes/image_nodes.py index 11e111e..0a6869d 100644 --- a/nodes/image_nodes.py +++ b/nodes/image_nodes.py @@ -2474,8 +2474,6 @@ class ImageCropByMaskAndResize: return (int(x0), int(y0), int(w), int(h)) def crop(self, image, mask, base_resolution, padding=0, min_crop_resolution=128, max_crop_resolution=512): - print("mask shape: ",mask.shape) - print("image shape: ",image.shape) image_list = [] mask_list = [] bbox_list = [] @@ -2500,9 +2498,6 @@ class ImageCropByMaskAndResize: cropped_image = common_upscale(cropped_image, target_width, target_height, "lanczos", "disabled") cropped_image = cropped_image.movedim(1, -1).squeeze(0) - print("cropped_image shape: ",cropped_image.shape) - print("cropped_mask shape: ",cropped_mask.shape) - cropped_mask = cropped_mask.unsqueeze(0).unsqueeze(0) cropped_mask = common_upscale(cropped_mask, target_width, target_height, 'bilinear', "disabled") cropped_mask = cropped_mask.squeeze(0).squeeze(0) @@ -2548,7 +2543,7 @@ class ImageUncropByMask: resized_source = resized_source.movedim(1, -1).squeeze(0) # Resize mask to match the bounding box dimensions - resized_mask = F.interpolate(mask[i].unsqueeze(0).unsqueeze(0), size=(bbox_height, bbox_width), mode='bilinear') + resized_mask = common_upscale(mask[i].unsqueeze(0).unsqueeze(0), bbox_width, bbox_height, "bilinear", "disabled") resized_mask = resized_mask.squeeze(0).squeeze(0) # Calculate padding values