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
CreateVoronoiMask
CreateVoronoiMask Node Documentation
Overview
The CreateVoronoiMask node is a part of the ComfyUI-KJNodes extension for ComfyUI. It is designed to generate a dynamic Voronoi diagram mask that can be applied to images or other visual content within a workflow. A Voronoi diagram is a partitioning of a plane into regions based on distance to points in a specific subset of the plane. In this context, it is used to create interesting and dynamic visual effects.
Features
-
Animated Voronoi Diagram: Generates a sequence of Voronoi diagrams that change over a sequence of frames, providing an animated effect.
-
Customizable Parameters: Users can specify parameters such as the number of points in the Voronoi diagram, the line width, the speed of animation, and the dimensions of each frame.
Inputs
-
frames:
- Type: Integer
- Description: The total number of frames in the animation sequence. This determines the length of the generated mask animation.
-
num_points:
- Type: Integer
- Description: The number of points used to generate the Voronoi diagram. More points will create a more complex diagram with smaller regions.
-
line_width:
- Type: Integer
- Description: The thickness of the lines that make up the edges of the Voronoi cells.
-
speed:
- Type: Float
- Description: This parameter controls how quickly points move during the animation. Values range between 0.0 and 1.0.
-
frame_width:
- Type: Integer
- Description: The width of each frame in the animation. Determines the horizontal resolution of the output mask.
-
frame_height:
- Type: Integer
- Description: The height of each frame in the animation. Determines the vertical resolution of the output mask.
Outputs
-
mask:
- Type: Mask
- Description: The main output mask, consisting of the generated Voronoi diagrams over the specified frames. This is ready to be used as a mask input in other nodes.
-
mask_inverted:
- Type: Mask
- Description: An inverted version of the original mask, where the regions are flipped to negative space. This can be useful for creating complementary mask effects.
Usage in Workflows
The CreateVoronoiMask node can be used in various ComfyUI workflows to add animated mask effects to images or videos. Example use cases include:
-
Image Composition: Use the generated Voronoi mask to blend multiple images or layers together in an interesting pattern.
-
Transition Effects: Apply the mask to create dynamic transition effects in animations or videos.
-
Creative Filtering: Use the mask to apply effects selectively across an image, such as blurring only certain regions defined by the Voronoi cells.
Special Features and Considerations
-
Aspect Ratio Management: Make sure that the aspect ratio of the input width and height is consistent with your desired output. Voronoi masks are highly sensitive to aspect ratio, which affects how the regions are drawn and animated.
-
High Resolution and Complexity: Increasing the number of points or the resolution significantly may impact performance. Test performance settings and adjust parameters accordingly, particularly when handling large animations.
-
Combining Masks: Combine the generated masks with other masking techniques for layered effects. The presence of both normal and inverted outputs allows for flexible combination in various creative scenarios.
This node is designed to bring dynamic visual possibilities to your ComfyUI projects, allowing for highly creative and customizable mask designs. Adjust the available parameters to explore the full range of visual styles possible with Voronoi diagrams.