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
CreateShapeMaskOnPath
CreateShapeMaskOnPath Node Documentation
Overview
The CreateShapeMaskOnPath node is part of the KJNodes package for ComfyUI. This node is designed to generate a mask or a batch of masks in specific shapes (such as circles, squares, or triangles) placed along pre-defined paths. It is a versatile tool that can create complex masking patterns based on user-defined coordinates and parameters.
Functionality
Purpose
The primary function of the CreateShapeMaskOnPath node is to generate masks with specified geometric shapes. These masks can then be utilized in various ComfyUI workflows for purposes like image editing, object isolation, or any scenario where a masking technique is necessary.
Inputs
The node requires the following inputs to operate:
-
Shape: Specifies the type of geometric shape to use for the mask. Options include:
- Circle
- Square
- Triangle
-
Coordinates: A list of coordinates (in JSON format) that define the center positions for placing each shape.
-
Frame Width & Frame Height: The dimensions of the frame that the entire mask batch will occupy. The sizes determine the overall canvas where the shapes will be drawn.
-
Shape Width & Shape Height: The dimensions of the individual shapes to be drawn on the frame. These define how big each shape will appear within the canvas.
-
Size Multiplier (Optional): A list of multipliers for scaling the size of the shapes on a per-batch-element basis. Provides flexibility for varying shape sizes within one batch.
Outputs
Upon execution, the node produces two outputs:
-
Mask: This is the directly generated mask based on the defined shapes and coordinates. It appears as white shapes on a black background within each frame, which can be utilized for masking purposes.
-
Inverted Mask: This is the inverse of the mask, representing the background (black shapes on a white background) which can be useful for operations requiring opposite mask logic.
Usage in ComfyUI Workflows
The CreateShapeMaskOnPath node can be integrated into ComfyUI workflows requiring dynamic and customizable masking solutions. Some potential use cases include:
-
Image Object Masking: Isolating specific objects or regions within an image for editing or processing.
-
Mask Animation Frames: Generating animated sequences of masks where the shapes move along specified paths.
-
Visual Design & Artistic Projects: Crafting creative visual elements or patterns that require precision and repeatable geometric designs.
Special Features and Considerations
-
Dynamic Sizing: The inclusion of a size multiplier allows users to create masks with varying sizes in a single batch, catering to complex requirements.
-
Batch Processing: Supports processing of multiple frames in parallel, facilitating efficient mask creation for animations or bulk image processing.
-
Coordinate Flexibility: Can interpret complex path definitions through its coordinate input, enabling sophisticated mask pathing and design.
Installation and Requirements
To use the CreateShapeMaskOnPath node, ensure you have installed the KJNodes repository in the custom_nodes folder of ComfyUI and fulfilled all necessary dependencies as specified in the KJNodes repository.
For detailed installation guidance, refer to the KJNodes GitHub repository.