A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The LayerMask: MaskGrain node is a component of the ComfyUI framework that processes mask images by applying a grain effect, with options to adjust the grain intensity and invert the mask. This allows for more sophisticated image processing and customization in layer masking tasks within the ComfyUI environment.
The LayerMask: MaskGrain node accepts the following input parameters:
Mask: This input expects a mask image. A mask is typically a grayscale image used to determine transparency areas, with different gray levels indicating varying levels of opacity.
Grain (integer): Determines the intensity of the grain effect to be applied. The valid range for this parameter is from 0 to 127, with a default value of 6. A higher value corresponds to a stronger grain effect.
Invert Mask (boolean): A toggle option to invert the input mask. When activated (i.e., set to True), the black and white areas of the mask are swapped, effectively inverting the mask's effect.
The output of the LayerMask: MaskGrain node is a single modified mask image. It retains the same format as the input mask, but with the specified grain effect applied and potentially inverted according to user preference.
In ComfyUI workflows, the LayerMask: MaskGrain node is typically used where there is a need to add texture or complexity to mask layers, either for aesthetic purposes or to simulate certain material textures in image compositions. It can be strategically placed between nodes involved in generating base mask layers and those that apply the final compositing effects.
For instance, a user might first generate or select a mask, then connect it to the LayerMask: MaskGrain node to apply a desired grain effect, and finally feed the processed mask into other nodes for additional effects like color adjustments or blending.
Automatic Mask Handling: The node automatically ensures the input mask has the correct dimensions and format by adjusting its dimensions if necessary.
Customizability: With adjustable grain intensity and the ability to invert the mask, users can fine-tune the mask effect to suit their specific creative needs.
Processing Efficiency: It is optimized to process multiple masks efficiently, logging the number of processed masks at completion to give users feedback on the operation.
Users should be aware that applying high grain levels can significantly alter the appearance of a mask. It's recommended to experiment with different grain values to achieve the best visual results without compromising the intended design or effect within their ComfyUI project.