Nodes/opencv-comfyui/OpenCV stackBlur_1
ComfyUI Node

OpenCV stackBlur_1

Stack blur, take two — identical, and that's the point

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

stackBlur_1 is the duplicate you can safely ignore: same generated wrapper as stackBlur_0, same call to cv2.stackBlur, same inputs, same output. The pack auto-generates a node per OpenCV overload and doesn't bother deduplicating, so you get twins. Use _0, use _1, it genuinely does not matter. What matters is what the function does, because it's quietly one of the best blurs in the pack.

Stack blur is Photoshop's name for it: a near-Gaussian smoothing that runs in constant time no matter the kernel size. A Gaussian's cost grows with radius; stack blur uses an incremental, separable box-blur stack so a 100-pixel-radius soften costs about the same as a 5-pixel one. That makes it the right tool for big dreamy glows, bloom passes, soft backgrounds, or the smooth reference plane you subtract for an unsharp mask - exactly the jobs where a normal Gaussian makes you wait. The look is a touch softer than true Gaussian, and nobody will ever tell at a glance.

Inputs and output. src (NPARRAY) and ksize, where ksize is a STRING typed as a Python literal - [31, 31] for a square kernel, odd sizes preferred. Optional dst out-parameter, best left alone. Output is a single nparray. Standard pack contract applies: NPARRAY means BGR uint8 0–255 numpy, not ComfyUI IMAGE. Image2Nparray on the way in (batch_size 1 only), Nparrays2Image on the way out.

Install. ComfyUI Manager → search "opencv-comfyui", or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/opencv-comfyui

restart. This function lives in the contrib module, so you need opencv-contrib-python (pip install opencv-python-contrib if missing). The classic conflict symptom - Cannot import name 'guidedFilter' from 'cv2.ximgproc' - means you have both opencv-python and the contrib wheel installed, and that has to be fixed before anything in this pack runs cleanly. If you typo the ksize literal you'll get invalid syntax (<unknown>, line 0); that's just the string parsing, not a broken node.

Categoryimage/OpenCV

Inputs (3)

NameTypeDefaultDescription
srcNPARRAY
ksizeSTRING
dstoptNPARRAY

Outputs (1)

NameTypeDescription
nparrayNPARRAY