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
CreateShapeMask
CreateShapeMask Node Documentation
Overview
The CreateShapeMask node is part of the ComfyUI-KJNodes collection. It facilitates the creation of masks featuring specific shapes, such as circles, squares, or triangles. These masks can be used in various image processing workflows where a particular region of interest needs to be defined or manipulated.
Functionality
The CreateShapeMask node generates a mask or a batch of masks that are centered on a specified location and grow or shrink over a series of frames. This growing or shrinking is defined by a "grow" parameter, allowing for animations or dynamic changes within the workflow.
Inputs
The CreateShapeMask node accepts the following inputs:
- Shape: The type of shape to create, with options for 'circle', 'square', and 'triangle'.
- Frames: The number of frames in the batch. Each frame can have a different size for the shape, allowing for animations.
- Location X: The x-coordinate for the center of the shape within the mask frame.
- Location Y: The y-coordinate for the center of the shape within the mask frame.
- Grow: The amount by which the shape size changes on each frame. Positive values enlarge the shape, while negative values reduce its size.
- Frame Width: The width dimension of the mask frame.
- Frame Height: The height dimension of the mask frame.
- Shape Width: The initial width of the shape on the first frame.
- Shape Height: The initial height of the shape on the first frame.
Outputs
The CreateShapeMask node produces two outputs:
- Mask: A mask or a batch of masks featuring the specified shape, with potential size changes applied over multiple frames.
- Mask Inverted: An inverted version of the generated mask, useful for workflows where the negative space is of interest.
Usage in ComfyUI Workflows
In ComfyUI workflows, the CreateShapeMask node is used to define areas of interest within an image for further processing or analysis. Its uses include:
- Dynamic Region Highlighting: Create animated sequences where the region of interest grows or shrinks over time.
- Focus or Blurring Effects: Set up areas to be selectively focused or blurred using corresponding filtering nodes.
- Layer Composition: Combine with other compositing or effect nodes to build complex visual narratives.
Special Features and Considerations
- Dynamic Size Changes: The ability to grow or shrink the shape over time makes the node versatile for animations and dynamic displays.
- Shape Selection: Supports multiple basic geometric shapes suitable for a wide array of visualization needs.
- Inverted Output: Provides an inverted version of the mask, enhancing flexibility for different masking requirements.
- Center-based Sizing: Shapes are grown or shrunk from their center, maintaining a consistent region of interest focus within each frame of a batch.
- Batch Processing: Can handle multiple frames, allowing for seamless integration into workflows dealing with animations or sequences.
This node is especially useful for users looking to automate and streamline tasks involving shape-based masking in image and video processing within ComfyUI.