Bilateral Filter Image
Smooth the image without smoothing away the edges
- images
- IMAGE
A gaussian blur doesn't care what it's blurring across - it'll happily smear a hard edge as readily as a smooth gradient. A bilateral filter is smarter about it: it only blends pixels that are both spatially close and similar in color, so it smooths within a region (skin, sky, a flat wall) while leaving strong edges more or less intact. Bilateral Filter Image is exactly that classic operator, and the author's own line on it is simple: "can be used to remove noise or high frequency details while preserving edges."
It's one of the older tricks in image processing - base/detail decomposition that respects boundaries - and it still shows up constantly as the cheap building block before something more specialized (a guided filter, or a full frequency-separation workflow) gets layered on top.
The three settings
images(IMAGE) - required.size(default 8, 1–64) - the neighborhood diameter. Bigger means more pixels get considered for each output pixel, and more compute.sigma_color(default 0.5, 0.01–1000) - how similar two pixels' colors need to be before they get blended together. Low values are strict - only near-identical colors blend, which keeps edges sharp but limits how much smoothing you get. High values relax that, letting bigger color differences blend, which pushes the result toward looking like a plain gaussian blur.sigma_space(default 100, 0.01–1000) - the spatial falloff, roughly analogous to blur radius influence: how much distance matters alongside color similarity.
One output: IMAGE.
What it's actually good for
Denoising without losing edges is the headline use - cleaning up compression artifacts or generation noise on a photo-real output while keeping the subject's outlines crisp. It's also a common step in skin-smoothing pipelines (blur the skin tones together, leave the edges of features intact) and as a pre-pass before frequency-separation work, where you want a clean low-frequency base layer that doesn't bleed color across the boundaries you care about.
How to install it
ComfyUI Manager: search "ComfyUI-Image-Filters", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters
then restart. Needs opencv-contrib-python - if cv2 fails to import, it's almost always another pack's conflicting opencv variant rather than this one being broken; the author's install.bat/import_error_install.bat fix it on Windows, and manually uninstalling stray opencv installs and reinstalling opencv-contrib-python alone does the same job elsewhere. No models, negligible VRAM cost.
Common issues & troubleshooting
Result looks flat or posterized, like edges got blurred anyway. sigma_color is set too high - you've relaxed the color-similarity requirement enough that it's blending across what should be a preserved edge, which pushes the result toward a regular blur. Bring it down.
Barely any smoothing effect at all. Either size is too small for the noise scale you're trying to remove, or sigma_color is too strict (low) for how much color variation exists in the region you want smoothed. Nudge both up together and check the effect at each step rather than jumping straight to extreme values.
It's slow on a large image at a big size. Bilateral filtering is more expensive per pixel than a simple blur - that's the cost of the edge-aware behavior. If it's a bottleneck, work at a lower resolution and upscale afterward, or drop to this pack's plain Blur Image (Fast) if you don't actually need edge preservation for that particular step.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| size | INT | 81–64 | — |
| sigma_color | FLOAT | 0.500.01–1000 | — |
| sigma_space | FLOAT | 100.000.01–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |