Nodes/ComfyUI CV/CV ArUco Draw Markers
ComfyUI Node

CV ArUco Draw Markers

Drawing detected ArUco markers

By bmad4ever·Created 3 months ago·Updated 14 days ago· 1
CV ArUco Draw Markers
  • image
  • corners
  • ids
  • image

Nobody's shipping a product with this node, and everybody who debugs fiducial tracking should. It paints the detections from CV ArUco Detect Markers onto your image - green outlines, a red dot on each marker's top-left corner, and optionally the ID printed next to it - so you can see whether the dictionary matched, whether the corner order is what you assumed, and which marker is which. When a pose solve comes out wrong, the question is almost always "did detection actually find all four markers and in the right order", and this answers it in one preview.

It's the cv2.aruco.drawDetectedMarkers call, curated because it needs the detector's corner array rather than a plain image.

Inputs and outputs

  • image - what to draw on. A copy is made, so nothing upstream is mutated. It takes a ComfyUI IMAGE/MASK or an NPARRAY, and frame 0 of a batch is what gets drawn.
  • corners - straight from CV ArUco Detect Markers, (N, 4, 2).
  • ids - optional. Connect it and each marker gets its integer label, which is how you check that the marker you think is 7 is in fact 7.

One output, image, in the same format the input arrived in - so an IMAGE stays an IMAGE and an NPARRAY stays an NPARRAY. Wire it to core Preview Image or Save Image and you're done.

An empty corners array isn't an error either: the image passes through unchanged. That means you can leave this debug node in a batch workflow permanently without it breaking on the frames where the board is out of shot.

Install

Manager → ComfyUI CV, or:

cd ComfyUI/custom_nodes && git clone https://github.com/bmad4ever/comfyui_cv
pip install "opencv-contrib-python-headless~=5.0.0.93"

Python ≥ 3.12, recent ComfyUI (V3 API). Because cv2.aruco is contrib-only in OpenCV, keep opencv-contrib-python-headless (or a contrib build someone else installed) as the winner of the cv2 import - a plain opencv-python installed later empties the contrib submodules and takes the ArUco nodes with it.

Reading the overlay

  • Red corner = the first corner, and the order is clockwise from there. If your pose is mirrored or rotated 180°, this is where you'll spot it.
  • IDs missing or wrong means the dictionary doesn't match the markers - a DICT_5X5_100 board read with a DICT_6X6_250 detector typically finds nothing at all, but partial hits do happen with similar families.
  • Detections flickering on and off frame to frame is usually lighting or blur, not a code problem. Detection is per-frame and stateless by design; if you need temporal stability, the pose nodes are where averaging belongs.

Use it as a permanent sidecar on any workflow you're tuning: one branch of the graph to a preview, the real path to the projection math.

Categoryimage/CV/features

Inputs (3)

NameTypeDefaultDescription
imageCOMFY_MATCHTYPE_V3Image to draw on (a copy is made). Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
cornersNPARRAYMarker corners from 'CV ArUco Detect Markers', (N, 4, 2).
idsoptNPARRAYMarker ids, (N,); connect to print id labels.

Outputs (1)

NameTypeDescription
imageCOMFY_MATCHTYPE_V3Same format as the image input.