Nodes/opencv-comfyui/OpenCV boxFilter_1
ComfyUI Node

OpenCV boxFilter_1

The redundant twin of the general box filter

By geroldmeisinger·Created about a year ago·Updated about a year ago· 35
OpenCV boxFilter_1
  • src
  • dst
  • nparray
ddepth
ksize
anchor
normalize
borderType

Here's the short version: OpenCV boxFilter_1 is the same node as boxFilter_0. The opencv-comfyui generator extracted every top-level cv2 function from OpenCV's type stubs, numbered the overloads, and shipped them all - so _0 and _1 are two signatures of the same cv2.boxFilter, and for anything you'll actually do they're interchangeable. You can stop comparing them and pick one.

So what is boxFilter? The general form of the box blur. Each pixel becomes a function of its ksize neighborhood - the sum, and with normalize checked, the average. That boolean is the whole difference:

  • normalize = True → a plain average → a box blur, the fastest cheap smoothing OpenCV has.
  • normalize = False → the raw window sum → values blow past 255 quickly; only useful if you're deliberately doing sum math and rescaling yourself.

In the deterministic post-processing layer (per the KB, "almost none of this is AI"), this is a millisecond primitive - the kind of thing you chain inside a bigger CV pipeline, not a node you build a workflow around. The blur node in this same pack is literally boxFilter with normalize on.

Inputs

  • src - NPARRAY (BGR, uint8; via Image2Nparray).
  • ddepth - INT, output depth; -1 keeps the source depth, which is what you want.
  • ksize - STRING literal, [5, 5], odd numbers. Literal syntax errors throw the pack's trademark invalid syntax (<unknown>, line 0).
  • normalize - BOOLEAN; the on/off switch between blur and sum.
  • anchor - STRING literal (-1, -1) for center anchoring.
  • borderType - INT, 4 is the default and fine.
  • dst (optional) - out-parameter; leave unwired.

Output: one nparrayNparrays2Image.

Install and the usual caveats

ComfyUI Manager → opencv-comfyui, or clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, restart. Needs opencv-contrib-python.

Same pack-wide rules as every sibling: batch size 1 only, NPARRAY in means BGR/uint8/0–255 and you handle conversions. If your result looks like a bright smear instead of a blur, you've got normalize off - flip it. Otherwise, treat this node like its twin: reach for it when you need the general filter, and don't overthink the _1.

Categoryimage/OpenCV

Inputs (7)

NameTypeDefaultDescription
srcNPARRAY
ddepthINT
ksizeSTRING
anchorSTRING
normalizeBOOLEAN
borderTypeINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY