OpenCV min_1
The identical twin of the darker-pixel-wins node
- src1
- src2
- dst
- nparray
Same story as every _1 twin in this pack: min_1 and min_0 are the same node. opencv-comfyui emits one node per cv2 overload, cv2.min is declared for both MatLike and UMat, and you got two copies of an element-wise minimum. No behavioral difference, no performance difference in practice (the pack has no Image2UMat node, so the "GPU" overload runs on the same CPU arrays). Pick one, wire it, forget the other exists.
What the node does: at every pixel, keep the smaller of the two input values. The applications are small but real:
- Mask intersection. Want the region two masks both cover?
min_1them. It's the logical AND of two masks, done as a single deterministic op. - Shadow compositing. Min two images and the dark pixels from each win - handy when you're layering a dark element and want it to sit under the highlights.
- A ceiling. Pair it with a constant array and it becomes "never brighter than this," a poor-man's clamp.
For the diffusion crowd, the mask-intersection use is the one that comes up: two overlapping region masks from a segmenter, and you only want the overlap to drive an inpaint. That's min_1 in under a second.
Inputs and outputs
- src1, src2 - two
NPARRAYs, same size and type, BGR uint8 by default. - dst - optional; leave it disconnected (out-parameter).
- nparray - the element-wise minimum, a real image array you can pipe into
Nparrays2Image.
Both inputs must be arrays - there's no scalar variant, so you can't min against a bare number without manufacturing a constant nparray. For a hard floor/ceiling you actually want a clamp node; for merging two arrays, this is it.
Setup
cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui
or ComfyUI Manager → "opencv-comfyui" → install → restart. The pack wants opencv-contrib-python, numpy, torch. Plumbing: Image2Nparray → min_1 → Nparrays2Image, with Image2Nparray limited to batch_size==1 - slice the batch if you get the "Only images with batch_size==1 are supported" error.
Usual suspects if something breaks: an OpenCV version conflict from another custom node (Cannot import name 'guidedFilter' from 'cv2.ximgproc', README has the fix) or a mismatched-input assertion. min_1 is a boring node that does one thing right - and in a node graph full of flashy AI, boring-and-correct is frequently the most useful thing you can add.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src1 | NPARRAY | — | |
| src2 | NPARRAY | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |