KJNodes/imagegenerated

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

image
mask
shape
circle
coordinates
STRING
frame_width
512
frame_height
512
shape_width
128
shape_height
128
shape_color
white
bg_color
black
blur_radius
0.0
intensity
1.00
size_multiplier
1
trailing
1.00
border_width
0
border_color
black
KJNodes

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 NameData TypeRequiredDefault ValueRange/OptionsDescription
shapeCOMBOYescircle"circle", "square", "triangle"shape (input parameter): Select the shape type: circle, square, or triangle.
coordinatesSTRINGYes--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_widthINTYes51216 - 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_heightINTYes51216 - 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_widthINTYes1282 - 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_heightINTYes1282 - 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_colorSTRINGYeswhite-shape_color (input parameter): Specifies the fill color of the shape. Supports color names (e.g., white) or hexadecimal codes.
bg_colorSTRINGYesblack-bg_color (input parameter): Specifies the background color of the canvas. Supports color names (e.g., black) or hexadecimal codes.
blur_radiusFLOATYes0.00.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.
intensityFLOATYes1.00.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_multiplierFLOATNo[1.0]1.0-
trailingFLOATNo1.00.0 - 10.0 (step: 0.01)-
border_widthINTNo00 - 100 (step: 1)-
border_colorSTRINGNoblack--

Output

Parameter NameData TypeDescription
imageIMAGEimage (output parameter): The output image batch containing all shapes drawn on the canvas.
maskMASKmask (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.

The Create Shape Image On Path node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…