| 996 | return (image_width, image_height,) |
| 997 | |
| 998 | class ChangeChannelCount: |
| 999 | def __init__(self): |
| 1000 | pass |
| 1001 | |
| 1002 | @classmethod |
| 1003 | def INPUT_TYPES(cls): |
| 1004 | return { |
| 1005 | "required": { |
| 1006 | "image": ("IMAGE",), |
| 1007 | "kind": (["mask", "RGB", "RGBA"],), |
| 1008 | }, |
| 1009 | } |
| 1010 | |
| 1011 | RETURN_TYPES = ("IMAGE",) |
| 1012 | FUNCTION = "change_channels" |
| 1013 | |
| 1014 | CATEGORY = "Masquerade Nodes" |
| 1015 | |
| 1016 | def change_channels(self, image, kind): |
| 1017 | image_size = image.size() |
| 1018 | |
| 1019 | if kind == "mask": |
| 1020 | return (tensor2mask(image),) |
| 1021 | elif kind == "RGBA": |
| 1022 | return (tensor2rgba(image),) |
| 1023 | else: # RGB |
| 1024 | return (tensor2rgb(image),) |
| 1025 | |
| 1026 | class ConstantMask: |
| 1027 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected