Create Shape Image On Path
Drawing a moving dot from coordinates
- image
- mask
This node draws a simple shape - a circle, square, or triangle - at a list of coordinates you give it, one frame per point, and hands you back an image batch (plus a matching mask). Think of it as a way to turn "here's where I want something to be, frame by frame" into an actual image sequence you can feed somewhere else in your graph.
Why you'd want this
It sits in KJNodes' small family of coordinate-driven generators, alongside Create Text On Path and Create Gradient From Coords - all three take the same kind of input (a JSON string of {x, y} points, typically produced by KJNodes' own Spline Editor or another coordinate-emitting node upstream, though you can also hand-type it) and turn it into pixels. The practical use cases are things like: building a synthetic motion mask to drive an animation or video model along a path you control precisely, generating a moving-dot overlay for compositing (a laser pointer, a tracking reticle, a bouncing-ball test pattern), or producing training/test masks where you need a known, reproducible shape trajectory rather than something hand-painted.
It's not a general drawing tool - you don't get arbitrary artwork, just a shape following a path. That's the whole point: it's precise and scriptable in a way freehand masking isn't.
How it works
For each coordinate in your path, the node stamps the chosen shape at that location (locations are center points, not corners) and outputs one frame per coordinate, so the length of your coordinate list is the length of your output batch. The shape's size, color, and the background it sits on are all fixed settings rather than per-frame - except where a per-frame float list is explicitly supported (see size_multiplier below).
The inputs and outputs that matter
The essentials: shape (circle, square, or triangle), coordinates (your JSON path string), and frame_width/frame_height (canvas size, default 512×512). Then the look of the shape itself: shape_width/shape_height, shape_color and bg_color (plain color names or values, default white-on-black), plus blur_radius to soften the edges and intensity to scale brightness/opacity.
Three optional knobs are worth knowing: size_multiplier is a per-frame float list, so the shape can grow or shrink as it moves along the path instead of staying a fixed size; trailing (0–10, default 1) blends earlier frames' shape positions into later ones for a comet-tail effect rather than a hard-cut dot; and border_width/border_color add an outline.
Outputs are image (the rendered shape sequence) and mask (the same shape as a grayscale mask) - wire the mask into anything that wants a motion or region mask, and the image into anything treating it as visual content directly (a compositing node, or a preview).
How to install it
- ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, thenpip install -r ComfyUI-KJNodes/requirements.txt(portable:python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), then restart.
No model downloads here - it's pure image drawing, no ML involved.
Common issues & troubleshooting
The shape doesn't show up, or shows up in the wrong place. Remember coordinates are center points, and they're in the same pixel space as frame_width/frame_height. If your path was generated at a different canvas size than you're rendering here, everything will be offset or clipped - keep the coordinate source and this node's frame dimensions in sync.
Malformed coordinates string. Since this field is just STRING, ComfyUI won't validate the JSON for you until the node actually runs. If you're hand-writing the path instead of piping it from another node, a stray comma or bracket will fail at execution time, not at graph-build time - worth pasting it into a JSON validator first if you're debugging blind.
Trailing looks like nothing changed. At the default of 1, the effect is subtle. Push it higher (toward the 10 max) if you want an obvious streak rather than a faint smear.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| shape | COMBO | circle | 3 options: circle, square, triangle |
| coordinates | STRING | — | |
| frame_width | INT | 51216–4096 | — |
| frame_height | INT | 51216–4096 | — |
| shape_width | INT | 1282–4096 | — |
| shape_height | INT | 1282–4096 | — |
| shape_color | STRING | white | — |
| bg_color | STRING | black | — |
| blur_radius | FLOAT | 0.00–100 | — |
| intensity | FLOAT | 1.000.01–100 | — |
| size_multiplieropt | FLOAT | 1 | — |
| trailingopt | FLOAT | 1.000–10 | — |
| border_widthopt | INT | 00–100 | — |
| border_coloropt | STRING | black | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |