A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The LayerUtility: LayerMaskTransform node in the ComfyUI framework is designed for advanced image manipulation, particularly focusing on mask transformations. This node allows users to perform multiple transformations on mask images, such as scaling, rotating, and mirroring, among others. It is particularly useful for users working with layered image compositions who require precise control over how individual masks are manipulated.
This node primarily transforms mask images using a series of specified parameters. It uses several image manipulation techniques to adjust the position, scale, rotation, and mirroring of mask layers. The node processes the incoming mask and produces a transformed version based on the inputs provided, making it ideal for applications where mask accuracy and precision are essential.
Below is a detailed list of inputs that the LayerMaskTransform node accepts:
mask: This is the primary input representing the mask that needs to be transformed. It is required for any transformation to occur.
x: An integer input that controls the horizontal offset applied to the transformed mask. The default value is 0, and it can range from -99,999 to 99,999.
y: An integer input that controls the vertical offset applied to the transformed mask. The default value is 0, with the same possible range as the x input.
mirror: This input allows for mirroring transformations, with options for 'None', 'horizontal', and 'vertical' mirroring. It specifies whether and how the mask should be flipped.
scale: A float input defining the scale factor for resizing the mask. The default value is 1, with a range from 0.01 to 100.
aspect_ratio: A float input that adjusts the aspect ratio of the mask during scaling. The default value is 1, with a range from 0.01 to 100.
rotate: A float input that specifies the degree of rotation applied to the mask. The default is 0 degrees, and the range is from -999,999 to 999,999 degrees.
transform_method: This input determines the resizing method used during transformation. Supported methods include 'lanczos', 'bicubic', 'hamming', 'bilinear', 'box', and 'nearest'.
anti_aliasing: An integer input that controls the level of anti-aliasing applied. The default value is 2, with a minimum of 0 and a maximum of 16.
In ComfyUI workflows, this node is used to manipulate the appearance and orientation of mask layers within an image composition project. By integrating this node into a workflow, users can:
Batch Processing: This node is capable of processing multiple masks at once, which is efficient for workflows involving multiple layers.
Comprehensive Control: Users have fine-grained control over mask properties, with parameters allowing for a wide range of transformations.
Method Variety: Different transformation methods offer flexibility for achieving specific visual qualities in resized or transformed masks.
Performance: While offering a robust feature set, consider the computational cost associated with high-resolution masks or batch processing scenarios.
The LayerUtility: LayerMaskTransform node is a powerful component within ComfyUI for anyone needing detailed manipulation of image masks. Its rich feature set coupled with precise control options makes it indispensable for complex image processing and UI design projects. With this node, users can transform their masks to fit seamlessly into any visual scenario they are creating.