Nodes/opencv-comfyui/OpenCV blur_1
ComfyUI Node

OpenCV blur_1

The same box blur, a second overload, zero drama

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

If you landed here after finding OpenCV blur_0, stop searching - blur_1 is the same function. OpenCV declares cv2.blur with two overloads in its Python stubs, and opencv-comfyui (which auto-generated a node for every top-level cv2 function) emitted both as separate nodes, numbered _0 and _1. For every practical purpose inside ComfyUI they're identical: a plain box blur, where each pixel becomes the unweighted average of the pixels in a ksize window.

What's a box blur good for? It's the cheapest smoothing primitive OpenCV has. It softens, it flattens, and because it's a plain average it's fast enough to use as a building block - pre-filter before downsampling, a quick flatten for comparison, the "blur a copy" half of an unsharp-mask recipe. It won't give you the soft round falloff of a Gaussian, and it certainly won't preserve edges like a bilateral filter, but when the job is "average the neighborhood and move on," this is the tool. In the post-processing layer's terms: deterministic, milliseconds, no model involved.

Inputs

  • src - NPARRAY image (BGR, uint8). Convert with Image2Nparray.
  • ksize - STRING, typed as a Python literal list: [5, 5]. This is the pack's convention for composite types - the string gets parsed with a literal evaluator. Bad syntax throws invalid syntax (<unknown>, line 0).
  • anchor - STRING literal, (-1, -1) for center anchoring. Leave it.
  • borderType - INT, 4 (BORDER_DEFAULT) is the default and fine.
  • dst (optional) - out-parameter; leave unwired.

Output: one nparrayNparrays2Image for preview.

Install

Same as every node in this pack: ComfyUI Manager → opencv-comfyui, or clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes, restart. Needs opencv-contrib-python (already installed on nearly every machine running image nodes).

The usual caveats

NPARRAY in means you're in BGR/uint8/0–255 land, batch size 1 only (slice with ImageFromBatch). If your only goal is a soft blur, the Gaussian variants in image-filter packs or the stock Comfy blur nodes are usually a nicer look - reach for blur when you want the fastest plain average, or when you're chaining a multi-step CV pipeline and a box blur is the right building block. And pick _0 or _1 by coin flip; the distinction is a generation artifact, not a feature.

Categoryimage/OpenCV

Inputs (5)

NameTypeDefaultDescription
srcNPARRAY
ksizeSTRING
anchorSTRING
borderTypeINT
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY