mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-05 23:07:09 +08:00
Fix ImageColorToMask not returning right mask values. (#8771)
This commit is contained in:
parent
9f1069290c
commit
34c8eeec06
@ -152,7 +152,7 @@ class ImageColorToMask:
|
||||
def image_to_mask(self, image, color):
|
||||
temp = (torch.clamp(image, 0, 1.0) * 255.0).round().to(torch.int)
|
||||
temp = torch.bitwise_left_shift(temp[:,:,:,0], 16) + torch.bitwise_left_shift(temp[:,:,:,1], 8) + temp[:,:,:,2]
|
||||
mask = torch.where(temp == color, 255, 0).float()
|
||||
mask = torch.where(temp == color, 1.0, 0).float()
|
||||
return (mask,)
|
||||
|
||||
class SolidMask:
|
||||
|
Loading…
x
Reference in New Issue
Block a user