ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
GrowMaskWithBlur
GrowMaskWithBlur Node Documentation
1. Overview
The GrowMaskWithBlur node is part of the masking utilities within the ComfyUI library, specifically found in the KJNodes collection. This node allows users to modify masks by expanding or contracting them, optionally applying a blur for softer edges. Masks can be inverted or flipped as needed, and adjustments can be finely controlled with a variety of parameters.
2. Inputs
The GrowMaskWithBlur node accepts the following inputs:
-
mask: The primary input mask or batch of masks that will be processed. It is a required input that provides the base image mask to be adjusted.
-
expand: An integer value determining how much the mask should grow or shrink. Positive values will expand the mask, while negative values will contract it.
-
incremental_expandrate: A float value that increases the expand amount per frame in a batch. Useful for creating animated expansion effects.
-
tapered_corners: A boolean toggle that specifies if the corners of the mask should be tapered (rounded) for smoother edges when expanding.
-
flip_input: A boolean toggle to invert the input mask. When enabled, it flips the mask's black and white areas.
-
blur_radius: A float indicating the radius of the blur effect applied to the mask. A higher value results in more blurred edges.
-
lerp_alpha: A float determining the alpha value for linear interpolation between consecutive frames. It controls how much the previous frame affects the current frame.
-
decay_factor: A float that acts as a decay coefficient in frame interpolation, which influences how much the previous frames fade over time.
-
fill_holes: An optional boolean input to determine if holes in the mask should be filled. This operation may be computationally slow, especially with large batches or complex masks.
3. Outputs
The GrowMaskWithBlur node produces two outputs:
-
mask: The modified mask after processing, which has been expanded, contracted, or blurred according to the user's input parameters. This might include interpolated and decayed transformations based on the lerp and decay options.
-
mask_inverted: An inverted version of the processed mask. This output can be used directly when the inverted mask is needed in a workflow or for further operations.
4. Usage in ComfyUI Workflows
The GrowMaskWithBlur node is versatile in its applications, making it useful for a variety of workflows within ComfyUI:
-
Image Manipulation: Use it to change the size and shape of masks that define regions of images that should be kept or altered, such as in compositing tasks.
-
Animation Effects: By utilizing the
incremental_expandrateand dynamic blurring withblur_radius, users can create animated transitions that grow or shrink elements over time. -
Artistic Creations: In projects that require creative masking, this node allows artists to smoothly morph specific image regions and incorporate soft transitions.
-
Visual Effects: Enabling options like
fill_holesandtapered_corners, the node helps create more natural masking effects, suitable for complex visual processing tasks or enhancements.
5. Special Features or Considerations
-
Performance: When dealing with large batches or high-resolution masks, some options like
fill_holesand highblur_radiusvalues may increase processing times significantly. -
Precision Control: The node provides detailed control over mask modification through parameters like
lerp_alphaanddecay_factor, which are less common in typical masking tools and offer enhanced control for dynamic effects. -
Inversion Capability: The ability to flip the mask (via
flip_input) and provide an inverted output makes the node adaptable for situations where quick inversions are necessary without additional steps.
This node is an essential tool for users requiring high flexibility in mask manipulation and effect creation, especially within complex workflows or when producing multimedia content.