Skip to content

Commit 34c8eee

Browse files
Fix ImageColorToMask not returning right mask values. (comfyanonymous#8771)
1 parent 9f10692 commit 34c8eee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

comfy_extras/nodes_mask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def INPUT_TYPES(s):
152152
def image_to_mask(self, image, color):
153153
temp = (torch.clamp(image, 0, 1.0) * 255.0).round().to(torch.int)
154154
temp = torch.bitwise_left_shift(temp[:,:,:,0], 16) + torch.bitwise_left_shift(temp[:,:,:,1], 8) + temp[:,:,:,2]
155-
mask = torch.where(temp == color, 255, 0).float()
155+
mask = torch.where(temp == color, 1.0, 0).float()
156156
return (mask,)
157157

158158
class SolidMask:

0 commit comments

Comments
 (0)