Nodes/opencv-comfyui/OpenCV reduceArgMax_1
ComfyUI Node

OpenCV reduceArgMax_1

ReduceArgMax_1 — the argmax twin nobody needs to pick between

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV reduceArgMax_1
  • src
  • dst
  • nparray
axis
lastIndex

reduceArgMax_1 is byte-for-byte the same node as reduceArgMax_0, under a second name. This is the pack's overload duplication again: opencv-comfyui (geroldmeisinger/opencv-comfyui) parses OpenCV's type stubs and emits one class per overload, and this cv2.reduceArgMax overload appears twice. There is no situation where you need both. The pack's own README tells you to expect this ("These nodes are auto-generated from source and so they are ugly and complex to use"), and the todo list even flags "blacklist functions which don't make sense" as future work.

What the node does, if you landed here cold: takes an NPARRAY src plus an axis int (0 → find the row index of each column's max, 1 → find the column index of each row's max), a lastIndex boolean for tie-breaking (first vs last occurrence of the max), and an optional dst out-parameter you should leave alone. It outputs an nparray of integer indices - the location of the max along that axis, useful for "where is the bright spot in this scanline" style analysis. The output is not an image, so don't feed it to Nparrays2Image.

Full detail, use cases, and the tie-handling nuances are in the reduceArgMax_0 article. This one is a placeholder for the fact that ComfyUI's node search will happily show you both.

Installing it

Same as the rest of the pack. ComfyUI Manager (search "opencv-comfyui"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

restart, and make sure OpenCV is present:

pip install opencv-contrib-python

That's it - no models, no GPU, no extra downloads. And here's your general survival tip for this pack: when you see _0 and _1 twins, assume they're identical overloads until proven otherwise. Bookmark the _0, ignore the _1, and spend your saved time on the nodes that actually differ.

Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
srcNPARRAY
axisINT
lastIndexBOOLEAN
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY