Nodes/FlowCV/高斯滤波
ComfyUI Node

高斯滤波

Gaussian blur in FlowCV

By Bit-Walker·Created about a year ago·Updated 7 months ago· 3
高斯滤波
  • 图像输入
  • 图像输出
核大小X5
核大小Y5
X方向标准差0.0
Y方向标准差0.0

Gaussian blur is the default answer to "smooth this a bit," and it's the filter you'll reach for most out of FlowCV's four. The 高斯滤波 node (class FCV_Gaussian) wraps cv2.GaussianBlur with independent control over the horizontal and vertical blur, and it's the sensible midpoint between the crudeness of a mean filter and the expense of bilateral filtering: it smooths noise and texture without the harsh boxy artifacts of FCV_Blur, while staying dramatically cheaper than FCV_Bilateral.

In a real workflow you'd drop it in front of FCV_Canny (edges on a blurred image are far cleaner), before thresholding a noisy image, or as a softener on masks and texture maps. It's also a genuinely good way to understand the difference between "blur strength" and "blur shape" - this node gives you both, separately.

How it works

A Gaussian kernel weights neighboring pixels by a bell curve centered on the target, so near pixels matter more than far ones. Unlike a mean filter's flat box, that weighting keeps the smoothing natural-looking and avoids harsh transitions. OpenCV derives the kernel from two parameters - kernel size and sigma - and FlowCV exposes all four:

  • 核大小X / 核大小Y (kernel size X/Y, default 5) - window dimensions. Must be odd; the node silently bumps even values up by one.
  • X方向标准差 / Y方向标准差 (sigma X/Y, default 0) - the spread of the Gaussian. 0 means "let OpenCV compute it automatically" from the kernel size, which is almost always a good idea. Only set these by hand if you want a specific character of blur - higher sigma smears more.

Asymmetric values are the hidden feature: X=1 with Y=9 gives you a vertical-only smear, which is handy for directional motion-blur-like effects on the cheap.

Wiring it up

CVIMAGE in, CVIMAGE out - the pack's standard BGR numpy format. Chain it before FCV_Canny or FCV_AdaptiveThreshold for visibly cleaner results, and convert with FCV_CVToIMAGE when you want to preview or hand the result to standard ComfyUI nodes.

Installing

Bundled in FlowCV, so install once - ComfyUI Manager (search "FlowCV") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Koren-cy/FlowCV

Restart ComfyUI. Dependencies are minimal: opencv-python, numpy, pyserial, no model downloads. The README notes the project has migrated to ComfyUI_For_Academic - this repo is effectively archived, fine to use, not under active development.

Gotchas

Gaussian blur still softens edges (that's inherent to smoothing); if you need edges preserved, that's FCV_Bilateral's job. And keep the pack's silent-failure quirk in mind: an exception prints a Chinese error to the console and returns the input untouched. Output unchanged = read the terminal.

CategoryopenCV/滤波

Inputs (5)

NameTypeDefaultDescription
图像输入CVIMAGE输入的openCV格式图像
核大小XINT51–99高斯核在X方向的大小,必须为奇数,控制水平方向的模糊程度,值越大越模糊
核大小YINT51–99高斯核在Y方向的大小,必须为奇数,控制垂直方向的模糊程度,值越大越模糊
X方向标准差FLOAT0.00–10X方向的高斯核标准差,0表示自动计算,控制水平方向的模糊程度,值越大越模糊
Y方向标准差FLOAT0.00–10Y方向的高斯核标准差,0表示自动计算,控制垂直方向的模糊程度,值越大越模糊

Outputs (1)

NameTypeDescription
图像输出CVIMAGE高斯滤波处理后的图像