A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The LayerUtility: IC Mask node is a custom node intended for use in ComfyUI workflows. It allows for the manipulation and combination of images and masks by resizing, positioning, and stitching them together. This functionality is useful for image processing tasks where specific image portions need to be highlighted or combined, especially when dealing with high-resolution images needing consistent processing dimensions.
The LayerUtility: IC Mask node performs various operations on input images and masks, including:
The node accepts the following inputs:
First Image: This is the primary input image that will undergo resizing and masking operations.
Patch Mode: This determines how the images should be combined. There are three options:
auto
: Automatically determines the best orientation for combining images.patch_right
: Concatenates the second image to the right of the first image.patch_bottom
: Concatenates the second image below the first image.Output Length: Defines the dimension of the largest side of the output image. This value will be adjusted to be divisible by 64 if it is not already.
Patch Color: Specifies the color used to pad the images. The options are:
#FF0000
(Red)#00FF00
(Green)#0000FF
(Blue)#FFFFFF
(White, which is the default)First Mask: An optional mask corresponding to the first image.
Second Image: An optional secondary image to be combined with the first. If not provided, a blank image of the specified patch color is created.
Second Mask: An optional mask corresponding to the second image.
The node produces the following outputs:
Image: The resultant combined and processed image.
Mask: The resultant combined mask, which outlines regions of interest within the image.
ICMask Data: Metadata regarding the processed images, including information about offsets, target dimensions, and original dimensions. This data facilitates subsequent processing steps such as further image manipulation or extraction.
In a ComfyUI environment, the LayerUtility: IC Mask node is useful for:
output_length
to be a multiple of 64, ensuring compatibility with image processing algorithms that rely on specific granularity.patch_mode
allows for flexibility in how images and masks are stitched together, facilitating different compositional needs.By integrating the LayerUtility: IC Mask node into a ComfyUI workflow, users can streamline and automate complex image processing tasks, achieving consistent and high-quality results.