Nodes/ComfyUI-ArchiGraph/Draw Circles πŸ¦β€πŸ”₯
ComfyUI Node

Draw Circles πŸ¦β€πŸ”₯

Mark the detected centers on your image

By vincentfsΒ·Created 2 years agoΒ·Updated 9 months agoΒ· 3
Draw Circles πŸ¦β€πŸ”₯
  • nparrays
  • points
  • dst
β—„radius3β–Ί
β—„colorREDβ–Ί
β—„thickness-1β–Ί

Detection nodes hand you coordinates; this node turns them back into something you can look at. cv2.circle run in a loop, wrapped for batches - you give it an image and a list of center points, and it stamps a circle on each one. It's the visual payoff at the end of a pipeline that finds things, whether those things are detected objects, keypoints, or centroids from the pack's Connected Components With Stats node.

The inputs

  • nparrays: the image to draw on (it's converted to color internally if it isn't already).
  • points: the *-typed center points. The shape contract is precise and worth reading twice: (batch_size, num_circles, 2), where the last dimension is (x, y). Batch index must line up with the image batch - circle list [b] draws onto image [b]. Get the shape wrong and you'll get indexing errors or silently misplaced circles.
  • radius (default 3): pixel radius.
  • color: WHITE / BLACK / RED / GREEN / BLUE.
  • thickness (default -1): positive = outline width; negative = filled circle. The -1 default means solid dots, which is usually what you want for "mark here."

Output

dst - the annotated NPARRAY, forced to a color 3-channel array. Run it through To Image and hit preview, or save it. That's the whole loop: detect something, get centers, draw the centers, look at the result.

The honest gap

Where do points come from? The pack's own detectors - Hough lines, contours - don't emit circles. The natural sources are the centroids output of Connected Components With Stats (that's exactly (x, y) per blob) or a custom script node. So in practice this node is the visualization half of the connected-components story: count the blobs, grab centroids, draw them as dots, confirm the detector wasn't hallucinating.

Install

ComfyUI Manager β†’ search ComfyUI-ArchiGraph, or:

cd ComfyUI/custom_nodes
git clone https://github.com/vincentfs/ComfyUI-ArchiGraph

Restart and run the pack's install script once. OpenCV is the real dependency; no models.

Gotchas

  • Shape is (batch, circles, 2) - 3D, not 2D. A flat list of points won't work.
  • Color is BGR under the hood (RED = (0,0,255)), so if you convert and preview, the node's own To Image flips it back correctly - just don't hand the raw array to something that assumes RGB.
  • Thickness -1 = filled. If you wanted outlines, set thickness β‰₯ 1.

A small node with one precise contract. Meet the shape requirement and it's the cleanest way to see what your detector found.

CategoryπŸ¦β€πŸ”₯ ArchiGraph/πŸ“€ OpenCV

Inputs (5)

NameTypeDefaultDescription
nparraysNPARRAYInput image to draw circles on. Will be convert to color image.
points*list of center points for the circles. Shape should be (batch_size, num_circles, 2) where last dimension is (x, y).
radiusINT31–100Radius of the circles.
colorCOMBOREDColor of the circles.
thicknessINT-1-1–20Thickness of the circle outlines, if positive. Negative thickness means filled circle.

Outputs (1)

NameTypeDescription
dstNPARRAYβ€”