ComfyUI > Nodes > KJNodes for ComfyUI > Create Voronoi Mask

ComfyUI Node: Create Voronoi Mask

Class Name

CreateVoronoiMask

Category
KJNodes/masking/generate
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

Create Voronoi Mask Description

Generate dynamic Voronoi masks for artistic patterns with customizable parameters.

Create Voronoi Mask:

The CreateVoronoiMask node is designed to generate Voronoi masks, which are useful for creating intricate and visually appealing patterns based on Voronoi diagrams. This node allows you to create a series of frames where each frame contains a Voronoi diagram with points that interpolate over time, creating a dynamic and evolving pattern. The primary benefit of this node is its ability to produce complex, organic-looking masks that can be used in various artistic applications, such as texture generation, procedural art, and more. By adjusting parameters like the number of points, line width, and animation speed, you can customize the appearance and behavior of the Voronoi masks to suit your creative needs.

Create Voronoi Mask Input Parameters:

frames

This parameter specifies the number of frames to generate in the batch. It determines the total number of images that will be created, each containing a Voronoi diagram. The more frames you generate, the smoother the transition between points will be. The minimum value is 1, and there is no explicit maximum value, but higher values will require more computational resources.

num_points

This parameter defines the number of points used to generate the Voronoi diagram. More points will result in a more complex and detailed pattern, while fewer points will create a simpler diagram. The minimum value is 1, and there is no explicit maximum value, but very high values may impact performance.

line_width

This parameter controls the width of the lines used to draw the Voronoi ridges. A larger line width will make the lines more prominent, while a smaller line width will create finer lines. The minimum value is 1, and there is no explicit maximum value, but extremely large values may obscure the pattern.

speed

This parameter determines the speed at which the points interpolate between their start and end positions over the frames. A higher speed will result in faster movement, while a lower speed will create a slower, more gradual transition. The value should be normalized between 0 and 1.

frame_width

This parameter sets the width of each frame in pixels. It defines the horizontal resolution of the generated images. The minimum value is 16, and the maximum value is 4096, with a default value of 512.

frame_height

This parameter sets the height of each frame in pixels. It defines the vertical resolution of the generated images. The minimum value is 16, and the maximum value is 4096, with a default value of 512.

Create Voronoi Mask Output Parameters:

mask

This output parameter provides the generated Voronoi mask as a tensor. The mask is a grayscale image where the Voronoi ridges are represented by lines, and the regions between the lines are filled with white. This mask can be used in various artistic applications, such as texture generation or as a base for further image processing.

mask_inverted

This output parameter provides the inverted version of the generated Voronoi mask. In the inverted mask, the Voronoi ridges are represented by white lines, and the regions between the lines are filled with black. This can be useful for different artistic effects or as an alternative representation of the Voronoi pattern.

Create Voronoi Mask Usage Tips:

  • Experiment with different values for num_points to achieve varying levels of complexity in your Voronoi patterns. Fewer points will create simpler diagrams, while more points will result in intricate patterns.
  • Adjust the line_width parameter to control the prominence of the Voronoi ridges. Thicker lines can create bold, striking patterns, while thinner lines can produce delicate, detailed designs.
  • Use the speed parameter to control the animation of the points. A slower speed can create smooth, gradual transitions, while a faster speed can result in dynamic, rapidly changing patterns.

Create Voronoi Mask Common Errors and Solutions:

ValueError: Invalid frame dimensions

  • Explanation: This error occurs when the frame_width or frame_height parameters are set to values outside the allowed range (16 to 4096).
  • Solution: Ensure that both frame_width and frame_height are within the valid range and try again.

MemoryError: Unable to allocate memory

  • Explanation: This error occurs when the node tries to generate a very large number of frames or uses a very high resolution, exceeding the available memory.
  • Solution: Reduce the number of frames, frame_width, or frame_height to lower the memory requirements and try again.

ValueError: Invalid number of points

  • Explanation: This error occurs when the num_points parameter is set to a value less than 1.
  • Solution: Ensure that num_points is set to a value of 1 or higher and try again.

Create Voronoi Mask 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.