Nodes/ComfyUI_OpenCV/Gaussian Blur
ComfyUI Node

Gaussian Blur

Sigma can stay 0)

By PiggyDance·Created about a year ago·Updated about a year ago· 1
Gaussian Blur
  • image
  • image
ksize_x5
ksize_y5
sigma_x0.0
sigma_y0.0

You need to soften an image - knock the noise off before an upscaler, de-emphasize a busy background, or smooth a mask edge so it doesn't produce a hard cutoff. That's Gaussian blur's job, and this node gives it to you with OpenCV's exact behavior and no tensor math of your own. It's from the ComfyUI_OpenCV pack, a three-node collection that wraps classic OpenCV filters, and honestly the README won't help you (still template scaffolding) - the node is the spec.

How it works

This is cv2.GaussianBlur under the hood. The kernel is the outer product of two one-dimensional Gaussians, which makes it separable - that's why Gaussian blur is fast despite covering a wide area. Each pixel becomes a weighted average of its neighborhood, with weights falling off smoothly from the center. Everything, edges included, gets smeared the same way. That's the defining trait: Gaussian is a linear blur, and if you want to keep edges crisp you'd reach for the sibling Median Blur node in the same pack instead.

The inputs

Four knobs, and only two of them matter most of the time:

  • ksize_x / ksize_y - kernel width and height. Default 5, and the sliders step by 2 because OpenCV needs odd sizes. If you somehow type an even number, the node quietly bumps it to odd for you. The tooltip says it must be "odd and greater than 1", and it means it: a kernel of 1 is a no-op.
  • sigma_x / sigma_y - standard deviation in each direction. Default 0, and here's the thing worth knowing: in OpenCV, sigma 0 means derive it from the kernel size automatically. So for 95% of cases you leave these alone, set the kernel size, and get the "natural" blur for that size. Set sigma yourself only when you want a specific width regardless of kernel, or a directional blur - making ksize_x bigger than ksize_y gives you a subtle motion-blur feel.

Keep x and y equal for a plain soft focus. And a warning for the enthusiastic: kernel size is cheap to think about but not free to compute - at ksize 99 you're blurring each pixel against a nearly 100×100 neighborhood, and this node runs on the CPU, frame by frame, in a Python loop. One image is nothing; a batch of 64 video frames at a big kernel will have you reading a book.

Install

Same as the rest of the pack. In ComfyUI Manager, search ComfyUI_OpenCV and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/PiggyDance/ComfyUI_OpenCV
# then restart ComfyUI

No models to download. The pack declares no pip dependencies but imports cv2 at load time, and a fresh ComfyUI install no longer ships OpenCV - so if the node doesn't show up in the menu, run pip install opencv-python-headless in ComfyUI's Python environment and restart. That missing-cv2 failure is the single most common reason this whole pack fails to load.

Where to use it

  • Before upscaling - a light Gaussian (ksize 3–5) takes the sting out of noise that an upscaler will otherwise sharpen into artifacts.
  • Smoothing masks - soften the edges of a mask before it hits a compositing or inpainting node so you don't get a hard line.
  • Soft-glow looks - blur a copy, screen or overlay it back. Cheap, effective, everyone's done it.

It's a utility, not a headline feature, and it's comfortably interchangeable with the blur in bigger packs like WAS if you already have those installed. But if you're OpenCV-minded or just don't want another 200-node suite for a single filter, this one's fine.

CategoryOpenCV/Filters

Inputs (5)

NameTypeDefaultDescription
imageIMAGEThe input image to apply Gaussian blur
ksize_xINT51–99Kernel width. Must be odd and greater than 1
ksize_yINT51–99Kernel height. Must be odd and greater than 1
sigma_xFLOAT0.00–20Gaussian kernel standard deviation in X direction
sigma_yFLOAT0.00–20Gaussian kernel standard deviation in Y direction

Outputs (1)

NameTypeDescription
imageIMAGE