Nodes/opencv-comfyui/OpenCV accumulateProduct_1
ComfyUI Node

OpenCV accumulateProduct_1

OpenCV accumulateProduct_1

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV accumulateProduct_1
  • src1
  • src2
  • dst
  • mask
  • nparray

Let me save you the comparison: accumulateProduct_1 is functionally identical to accumulateProduct_0. Same inputs - src1, src2, dst, optional mask - same dst = dst + src1 * src2 math, same single nparray output. opencv-comfyui generates a numbered node for every overload it finds in OpenCV's type definitions, and for this function the overloads map to the same signature. Pick whichever shows up first in your search and move on.

What it does

It multiplies two images pixel by pixel and folds the product into a running accumulator. Over a sequence of pairs, the accumulator becomes Σ(src1·src2), which is a piece of machinery used in correlation, energy accumulation, and various statistics over image pairs. It's non-saturating and floating-point, so the total keeps growing until you stop feeding it - the accumulator isn't an image you look at, it's a number-field you eventually do something with.

The inputs that matter

  • src1 / src2 (NPARRAY) - the images to multiply element-wise.
  • dst (NPARRAY, required) - the growing accumulator. Must be float32 and the same size as the inputs; uint8 trips the dst.type() == CV_32F assertion.
  • mask (NPARRAY, optional) - limits accumulation to nonzero pixels.

Output: a single nparray, the updated total.

The honest take

This is one of the pack's "exhaustive API coverage" nodes rather than a daily driver - 635 wrappers were auto-generated, and the README itself warns that not every cv2 function is actually useful inside ComfyUI without further processing. Accumulate-family nodes also fight the grain of stock ComfyUI because they want a loop and a hand-built float accumulator to start from. If you're already building custom frame-iteration plumbing, this is a clean primitive; if you're wiring a standard graph, skip it.

Installing opencv-comfyui

ComfyUI Manager → search "opencv-comfyui", or:

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

Restart ComfyUI. OpenCV (opencv-contrib-python) is the dependency; you likely already have it.

Gotchas

  • dst must be float32 - same size as the inputs, usually zeros to begin.
  • Batch_size == 1 - conversion nodes refuse batches; use ImageFromBatch.
  • Float output isn't a viewable image - don't wire the accumulator straight into Nparrays2Image and expect a picture.
Categoryimage/OpenCV

Inputs (4)

NameTypeDefaultDescription
src1NPARRAY
src2NPARRAY
dstNPARRAY
maskoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY