Create Shape Image On Path(CreateShapeImageOnPath)
This node determines the center position of each shape by parsing the input coordinate string and draws them based on the user-selected shape type (circle, square, triangle).
Create Shape Image On Path
The Create Shape Image On Path node determines the center position of each shape by parsing the input coordinate string and draws them based on the user-selected shape type (circle, square, triangle).
The Create Shape Image On Path node is used to batch-generate images of specific shapes and their corresponding masks along a specified coordinate path on the canvas. It allows users to customize the shape, size, color, and background, serving as a fundamental tool for creating dynamic graphic elements or mask sequences.
Node Functionality
This node determines the center position of each shape by parsing the input coordinate string and draws them based on the user-selected shape type (circle, square, triangle). It supports applying blur effects and intensity adjustments to the shapes, and can handle optional size multipliers, trailing effects, and border settings. Ultimately, it outputs a batch of images containing all the shapes and their corresponding binarized masks.
Node Parameter Description - Create Shape Image On Path
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
shape | COMBO | Yes | circle | "circle", "square", "triangle" | shape (input parameter): Select the shape type: circle, square, or triangle. |
coordinates | STRING | Yes | - | - | coordinates (input parameter): A coordinate string defining the center point positions of the shapes. The format is typically x1,y1;x2,y2, where each coordinate pair represents the position of one shape. |
frame_width | INT | Yes | 512 | 16 - 4096 (step: 1) | frame_width (input parameter): Sets the width of the output canvas (image). The range is 16 to 4096, with a step of 1. |
frame_height | INT | Yes | 512 | 16 - 4096 (step: 1) | frame_height (input parameter): Sets the height of the output canvas (image). The range is 16 to 4096, with a step of 1. |
shape_width | INT | Yes | 128 | 2 - 4096 (step: 1) | shape_width (input parameter): Sets the width of a single shape. The range is 2 to 4096, with a step of 1. |
shape_height | INT | Yes | 128 | 2 - 4096 (step: 1) | shape_height (input parameter): Sets the height of a single shape. The range is 2 to 4096, with a step of 1. |
shape_color | STRING | Yes | white | - | shape_color (input parameter): Specifies the fill color of the shape. Supports color names (e.g., white) or hexadecimal codes. |
bg_color | STRING | Yes | black | - | bg_color (input parameter): Specifies the background color of the canvas. Supports color names (e.g., black) or hexadecimal codes. |
blur_radius | FLOAT | Yes | 0.0 | 0.0 - 100 (step: 0.1) | blur_radius (input parameter): The radius for applying Gaussian blur to the shape edges. The range is 0.0 to 100.0, with a step of 0.1. |
intensity | FLOAT | Yes | 1.0 | 0.01 - 100.0 (step: 0.01) | intensity (input parameter): Controls the intensity or transparency of the shape color. The range is 0.01 to 100.0, with a step of 0.01. |
size_multiplier | FLOAT | No | [1.0] | 1.0 | - |
trailing | FLOAT | No | 1.0 | 0.0 - 10.0 (step: 0.01) | - |
border_width | INT | No | 0 | 0 - 100 (step: 1) | - |
border_color | STRING | No | black | - | - |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| image | IMAGE | image (output parameter): The output image batch containing all shapes drawn on the canvas. |
| mask | MASK | mask (output parameter): The output mask batch, corresponding to the binarized masks of the shape areas in the image. |
Usage Scenarios
This node is very useful in workflows involving animation or requiring precise control over graphic element positions. For example, you can first use other nodes to generate a series of motion coordinates, then connect them to this node to create a sequence of shapes moving along a motion trajectory. These sequence images and masks can be further used to control regions for image generation or video compositing.
Notes
Please note that the input coordinate string must follow a specific format (e.g., x1,y1;x2,y2); otherwise, parsing errors or incorrect shape placement may occur. Additionally, shapes are drawn with their center point as the reference position.
Create Shape Image On Path Node Source Code Link
The Create Shape Image On Path node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.