A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
The LayerMask: MaskStroke
node is a component of the ComfyUI library, provided by the https://github.com/chflame163/ComfyUI_LayerStyle repository. It is designed to manipulate image masks by applying a series of transformations such as inverting, growing, and blurring strokes around specified areas. This can be particularly useful for graphic design or image editing tasks where precise mask manipulation is required.
The primary function of the LayerMask: MaskStroke
node is to process image masks through its mask_stroke
method. This includes:
These operations result in modified masks that can control which areas of an image are affected by subsequent image processing nodes.
The LayerMask: MaskStroke
node requires several inputs to function. These are:
mask: The primary input which is an image mask. The node can handle masks in both single and batch formats.
invert_mask: A boolean flag (either true or false) that determines if the input mask should be inverted before further processing. By default, this is set to true.
stroke_grow: An integer that specifies how much the stroke should shrink or grow. This can range from -999 to 999, allowing for flexible adjustment.
stroke_width: An integer representing the width of the stroke to be applied around or within the mask. It ranges from 0 to 999 and defaults to 20.
blur: An integer determining the amount of blur to apply to the stroke. The blur value can vary from 0 to 100, with a default setting of 6.
The LayerMask: MaskStroke
node produces a single output:
The LayerMask: MaskStroke
node is particularly useful in workflows that require intricate mask manipulation. Common use cases include:
By integrating this node into your workflow, you can achieve detailed control over image masks that can enhance the final output's visual appeal and accuracy.
Mask Inversion: The option to invert masks gives flexibility, allowing for quick toggling between highlighting or excluding designated areas without manually altering the mask data.
Flexible Stroke Control: With adjustable growth and width parameters, this node allows for intricate stroke designs, providing both shrinkage and expansion capabilities.
Blur Integration: The ability to blur strokes can lead to smoother transitions and more natural-looking effects in composited images.
Batch Processing: The node is capable of processing multiple masks at once, making it suitable for batch operations in large-scale image editing projects.
When using the LayerMask: MaskStroke
node, consider these features to optimize your image processing workflows effectively.