ImageFilterMedianBlur
The noise-killer that keeps edges sharp
- images
- IMAGE
Gaussian and box blurs average pixels, which means a single bright outlier (sensor noise, a stray hot pixel, JPEG junk) drags its whole neighborhood toward it. The median blur doesn't have that problem: for each pixel it takes the median of the neighborhood, so outliers get thrown out rather than averaged in. ImageFilterMedianBlur from the Allor plugin is that filter as a node - the one you reach for when you want to kill speckle noise without smearing the edges you care about.
How it works
It's OpenCV's medianBlur under the hood. For each pixel, the node looks at a size×size neighborhood and takes the median value. Because the median is a "middle value" rather than a mean, a few extreme pixels don't move it - salt-and-pepper noise disappears while genuine edges (which are local and consistent) survive mostly intact. That's the filter's superpower: it denoises without the edge-sacrificing smudge that a mean-based blur leaves behind.
The size input (default 10, stepping by 2) sets the neighborhood. Larger sizes remove bigger noise but start to eat real detail, so it's a "as large as you need, no larger" sort of knob.
Inputs that matter
images- the IMAGE or batch.size- neighborhood size. Start small; on 1024 images a size around 5–15 handles typical noise.
Output is a single IMAGE.
Where it fits
It's the standard cleanup step before anything that's sensitive to noise: edge detection, contour extraction, thresholding, or upscaling a slightly-gritty render. It's also the right blur for photographic noise (film grain, sensor noise) because it kills the speckle without turning fine texture into mush - a Gaussian on the same image would smooth the texture and the noise together.
Installing it
Part of the Allor pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
Restart ComfyUI, or use ComfyUI Manager → Allor Plugin. First launch installs rembg + onnx and writes config.json; no model downloads.
Gotchas
- Median is genuinely slower than a Gaussian at the same kernel size, and the cost climbs fast with
size. If you're processing a big batch, keep sizes small. - It can give a slight "posterized" flatness on smooth gradients - the median clamps to existing values, so gradual tones can band a little. If that bothers you, a light Gaussian after it smooths the bands back.
- Pack-wide update gotcha: Allor's repo was rebased to shrink history, so an old clone can fail on
git pull; re-clone if auto-update breaks.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| size | INT | 10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |