OpenCV blur_0
OpenCV blur_0 and when to actually use it
- src
- dst
- nparray
OpenCV blur_0 is the humblest blur in the pack, and that's not a knock. It's a box blur: every pixel becomes the plain average of its neighbors inside a ksize window. No weighting toward the center, no edge-preserving magic - just a moving average. Gaussian gives you a softer, rounder falloff; box blur is the cheap, blocky cousin. Where it earns its keep is speed: it's one of the fastest smoothing operations OpenCV has, which makes it ideal as a component of bigger things - a downsampling pre-filter, a quick flatten for comparison, the blur side of an unsharp-mask-style recipe (blur a copy, subtract, add detail back).
The post-processing layer this lives in is all deterministic, millisecond pixel math - nothing here runs a model, and for jobs like "soften this region slightly" you want a $0 operation, not a diffusion pass. If you specifically want a soft blur, Gaussian is the friendlier look; blur is for when the job doesn't care and speed does.
It's part of opencv-comfyui, Gerold Meisinger's auto-generated pack wrapping every top-level OpenCV function. The node calls cv2.blur(src, ksize, dst, anchor, borderType) straight through. blur_1 is the identical overload.
The inputs that matter
- src - your
NPARRAYimage (BGR,uint8; convert withImage2Nparray). - ksize - a STRING, and here's the pack's signature quirk: composite types are typed as text and parsed with Python's literal evaluator. For
blurit's a list, so type[3, 3]or[5, 5]- square brackets, no spaces issues, keep it odd. Wrong syntax →invalid syntax (<unknown>, line 0), straight from the README's troubleshooting. - anchor - a STRING literal too,
(-1, -1)means "center of the kernel," which is what you want. Leave it at that. - borderType - an INT. 4 (
BORDER_DEFAULT) is the OpenCV default and fine for almost everything. - dst (optional) - the out-parameter. Leave it unwired.
Output: one blurred nparray → Nparrays2Image to preview.
Install
ComfyUI Manager → search opencv-comfyui, or clone https://github.com/geroldmeisinger/opencv-comfyui into ComfyUI/custom_nodes and restart. Requires opencv-contrib-python, which is a near-certain already-have on any machine that runs image custom nodes.
Gotchas
Batch size 1 only - slice multi-frame batches with ImageFromBatch (length=1). And remember OpenCV eats BGR uint8, so if your blur looks color-inverted when you convert back, that's the RGB↔BGR convention doing its thing, not the blur. Honestly, for most ComfyUI users this is a "nice to know" node: the stock blur nodes and the Gaussian variants in image-filter packs cover the everyday cases, and you'll reach here mainly when you want the fastest possible blur or you're building a multi-step CV pipeline where a plain average is the right primitive.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| src | NPARRAY | — | |
| ksize | STRING | — | |
| anchor | STRING | — | |
| borderType | INT | — | |
| dstopt | NPARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| nparray | NPARRAY | — |