OpenCV integral_1
Same summed-area table, second overload
- src
- sum
- nparray
Straight to it: OpenCV integral_1 is a byte-for-byte duplicate of OpenCV integral_0. Same cv2.integral call, same src / sdepth inputs, same (H+1, W+1) output. The pack is auto-generated from OpenCV's type-stub files, and integral shows up in those stubs twice - one overload annotated MatLike, one UMat - so the generator emitted two numbered nodes. With real nparrays they're interchangeable. Everything mechanical lives in the integral_0 article; here's the short version plus the practical notes.
What it does
Computes an integral image (summed-area table): a single pass over the source, writing at each (i, j) the sum of every pixel in the top-left rectangle. The output is one row and column larger than the input and holds large sums rather than colors. Its entire purpose is enabling O(1) rectangle sums downstream - adaptive thresholding, box-blur approximations, local-lighting correction. You won't look at the output; you'll feed it to math. In a typical ComfyUI graph you rarely need it directly - adaptiveThreshold_0, blur_0, and threshold_0 in the same pack wrap the results you actually want.
Inputs and outputs
src- NPARRAY, your image viaImage2Nparray.sdepth- INT, output depth:4(CV_32S) for 8-bit sources,5(CV_32F) or6(CV_64F) when you need float or extra headroom.sum- optional out-parameter; safe to ignore.- Output
nparray- the integral image.
Installing
One pack, one install, ~635 nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
cd opencv-comfyui
pip install -r requirements.txt
Or search "opencv-comfyui" in ComfyUI Manager. No models, no downloads - requirements.txt is just opencv-contrib-python, numpy, torch.
Gotchas
The integral image is not a viewable image - values blow past 255, and Nparrays2Image divides by 255 without rescaling, so a preview will look like clipped garbage. That's expected; don't treat it as a bug in the node. Keep batch_size == 1, and remember the whole pack speaks BGR. And since this is a pure overload duplicate of integral_0, there's zero advantage to picking one over the other - use whichever a shared workflow references, and don't let the _1 suffix make you think it's the newer or better variant.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| sdepth | INT | — | |
| sumopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |