ComfyUI > Nodes > KJNodes for ComfyUI > Grow Mask With Blur

ComfyUI Node: Grow Mask With Blur

Class Name

GrowMaskWithBlur

Category
KJNodes/masking
Author
kijai (Account age: 2192days)
Extension
KJNodes for ComfyUI
Latest Updated
2024-06-25
Github Stars
0.35K

How to Install KJNodes for ComfyUI

Install this extension via the ComfyUI Manager by searching for KJNodes for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter KJNodes for ComfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Grow Mask With Blur Description

Manipulate mask images with blur effects and transformations for AI artists, refining boundaries and edges.

Grow Mask With Blur:

The GrowMaskWithBlur node is designed to manipulate and enhance mask images by expanding or contracting them, applying blur effects, and performing various other transformations. This node is particularly useful for AI artists who need to refine mask boundaries, smooth transitions, and fill gaps in mask images. By leveraging a combination of dilation, erosion, and Gaussian blur techniques, GrowMaskWithBlur allows for precise control over mask shapes and edges, making it an essential tool for creating polished and professional-looking AI-generated art. The node also supports incremental adjustments, interpolation between frames, and the option to fill holes, providing a comprehensive solution for mask manipulation.

Grow Mask With Blur Input Parameters:

mask

The input mask or batch of masks that you want to manipulate. This parameter is essential as it serves as the base image for all subsequent transformations.

expand

This parameter controls the amount by which the mask is expanded or contracted. Positive values will expand the mask, while negative values will contract it. The default value is 0, and it can range from -MAX_RESOLUTION to MAX_RESOLUTION.

incremental_expandrate

This parameter specifies the rate at which the expand value is incrementally adjusted per frame. It allows for gradual changes in the mask size over multiple frames, providing a smooth transition effect.

tapered_corners

A boolean parameter that determines whether to use tapered corners for the mask. When set to True, the corners of the mask will be tapered, resulting in smoother edges. The default value is True.

flip_input

A boolean parameter that, when set to True, flips the input mask. This can be useful for creating inverse masks or for specific artistic effects. The default value is False.

blur_radius

This parameter sets the radius for the Gaussian blur applied to the mask. A value higher than 0 will blur the mask, softening its edges and transitions. The default value is 0.

lerp_alpha

The alpha value for linear interpolation between frames. This parameter controls the blending of the current frame with the previous frame, allowing for smooth transitions. The default value is 1.0.

decay_factor

The decay value for interpolation between frames. This parameter adds a decayed version of the previous frame to the current frame, creating a fading effect. The default value is 1.0.

fill_holes

A boolean parameter that, when set to True, fills holes in the mask. This process can be slow but is useful for creating solid, contiguous mask areas. The default value is False.

Grow Mask With Blur Output Parameters:

MASK

The primary output is the manipulated mask or batch of masks. This output reflects all the transformations applied, including expansion, contraction, blurring, and hole filling.

INVERSE_MASK

The secondary output is the inverse of the manipulated mask. This can be useful for creating complementary mask effects or for further processing in other nodes.

Grow Mask With Blur Usage Tips:

  • To create smooth transitions between frames, use a combination of lerp_alpha and decay_factor to blend and fade the mask edges.
  • For a more polished look, apply a small blur_radius to soften the mask edges and reduce harsh transitions.
  • Use the incremental_expandrate to gradually change the mask size over multiple frames, creating a dynamic effect.
  • Enable fill_holes when you need to ensure that the mask is solid and contiguous, especially for complex shapes.

Grow Mask With Blur Common Errors and Solutions:

"Invalid mask input"

  • Explanation: The input mask is not in the correct format or is missing.
  • Solution: Ensure that the input mask is provided and is in the correct format expected by the node.

"Expand value out of range"

  • Explanation: The expand parameter value is outside the allowable range.
  • Solution: Adjust the expand value to be within the range of -MAX_RESOLUTION to MAX_RESOLUTION.

"Blur radius must be non-negative"

  • Explanation: The blur_radius parameter is set to a negative value.
  • Solution: Set the blur_radius to a non-negative value to apply the blur effect correctly.

"Interpolation parameters out of range"

  • Explanation: The lerp_alpha or decay_factor parameters are set outside the range of 0.0 to 1.0.
  • Solution: Adjust the lerp_alpha and decay_factor values to be within the range of 0.0 to 1.0 for proper interpolation.

Grow Mask With Blur Related Nodes

Go back to the extension to check out more related nodes.
KJNodes for ComfyUI
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.