From 1f030793381118266ff8208253813cd9c87dcebf Mon Sep 17 00:00:00 2001 From: Kevin Ramirez Date: Fri, 21 Jun 2024 03:34:49 +0000 Subject: [PATCH] Fix mask_color widget in ImageAndMaskPreview node --- nodes/image_nodes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nodes/image_nodes.py b/nodes/image_nodes.py index c33967e..8f4732c 100644 --- a/nodes/image_nodes.py +++ b/nodes/image_nodes.py @@ -873,9 +873,9 @@ nodes for example. mask_image = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3).clone() color_list = list(map(int, mask_color.split(', '))) - mask_image[:, :, :, 0] = color_list[0] // 255 # Red channel - mask_image[:, :, :, 1] = color_list[1] // 255 # Green channel - mask_image[:, :, :, 2] = color_list[2] // 255 # Blue channel + mask_image[:, :, :, 0] = color_list[0] / 255 # Red channel + mask_image[:, :, :, 1] = color_list[1] / 255 # Green channel + mask_image[:, :, :, 2] = color_list[2] / 255 # Blue channel preview, = ImageCompositeMasked.composite(self, image, mask_image, 0, 0, True, mask_adjusted) if pass_through: