A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The "LayerMask: Image To Mask" node in ComfyUI is designed to convert an input image into a mask using specified image channels and adjustment parameters. This node utilizes various image processing techniques to isolate specific components of an image and adjust their contrast levels, allowing users to create custom masks based on color channels, luminance, or other aspects of an image.
The node requires several inputs to function correctly:
Image: The primary input image that will be converted into a mask.
Channel: This specifies which channel of the image to use for the mask creation. Options include:
Black Point: An integer value (0 to 255) that sets the black point of the mask; it controls the darkest parts of the mask by setting a threshold.
White Point: An integer value (0 to 255) that sets the white point of the mask; it controls the brightest parts of the mask by setting a threshold.
Gray Point: A floating-point value (0.01 to 9.99) that influences the mid-tone adjustments, effectively altering the gamma and contrast of the mask.
Invert Output Mask: A boolean option to invert the resulting mask, swapping black and white areas.
Mask (Optional): An existing mask to use in conjunction with the generated mask, allowing further customization and composite mask creation.
The node produces one primary output:
In ComfyUI workflows, this node acts as a critical component for creating masks from images based on specific channels and image properties. It can be used to:
Channel Selection: The ability to choose between multiple channels such as RGB, LAB, YUV, and HSV allows for sophisticated channel-specific operations, catering to intricate image processing requirements.
Flexible Adjustments: With options to set black, white, and gray points, users have granular control over the tonal conversion of images, enabling the creation of precise and targeted masks.
Inversion Capability: The option to invert the output mask swiftly modifies the mask output, allowing users to reverse the mask without additional pre or post-processing steps.
Optional Mask Input: The feature to incorporate an optional mask provides users with the flexibility to blend existing masks with new ones, offering enhanced compositing possibilities in image workflows.
This node is a versatile tool within ComfyUI, suited for users needing detailed control over mask generation from color and luminance-based image channels. Understanding and utilizing this node effectively can enhance workflow outcomes in image editing and processing tasks.