Nodes/opencv-comfyui/OpenCV drawMarker_1
ComfyUI Node

OpenCV drawMarker_1

DrawMarker, second overload — same markers, still BGR

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV drawMarker_1
  • img
  • nparray
position
color
markerType
markerSize
thickness
line_type

Let's get the naming out of the way first: drawMarker_1 and drawMarker_0 are the same node. OpenCV declares cv2.drawMarker twice in its type stubs - once for MatLike, once for UMat - and the opencv-comfyui generator emitted one node per signature. The _1 is not newer, not better, not a different marker style. It's the second overload, functionally identical, and you can use whichever one your workflow already has in it.

What it's for

It draws a small marker - cross, star, diamond, square, triangle - at a specific point on an image. If you have detection points (keypoints, corners, landmarks) from another OpenCV node and you want to render them visibly, this is the direct tool. The inputs:

  • img - your NPARRAY.
  • position - a STRING literal, (x, y). Python literal syntax required; 50, 120 without parens will throw invalid syntax (<unknown>, line 0).
  • color - a STRING literal in BGR. Red is (0, 0, 255). This trips up more people than anything else about this node, because every other image tool you've used is RGB.
  • markerType - int 0–6: cross, tilted cross, star, diamond, square, triangle up, triangle down.
  • markerSize, thickness, line_type - size in pixels, stroke thickness, and 8 (normal) vs. 16 (LINE_AA anti-aliased).

One nparray output.

Install

Part of opencv-comfyui. ComfyUI Manager → search OpenCV, or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
pip install opencv-python-contrib

Restart ComfyUI. requirements.txt: opencv-contrib-python, numpy, torch. No weights, no downloads.

The house rules, once more

Everything in this pack is NPARRAY-based: in through Image2Nparray, out through Nparrays2Image, and only batch_size==1 is supported (else Image2Nparray throws Only images with batch_size==1 are supported! - fix with an ImageFromBatch at length 1). Literal fields are parsed with ast.literal_eval, so keep them valid Python. And because the whole pipeline is BGR, your (0, 255, 0) really is green - trust the flip.

Verdict: _1 is a perfectly fine choice for a simple, useful job. There's nothing to choose between it and _0 except which one you happened to drag in first.

Categoryimage/OpenCV

Inputs (7)

NameTypeDefaultDescription
imgNPARRAY
positionSTRING
colorSTRING
markerTypeINT
markerSizeINT
thicknessINT
line_typeINT

Outputs (1)

NameTypeDescription
nparrayNPARRAY