Nodes/Allor Plugin/ImageFilterMax
ComfyUI Node

ImageFilterMax

Grow the brights, kill the dark speckle

By Nourepide·Created 3 years ago·Updated 2 years ago· 296
ImageFilterMax
  • images
  • IMAGE
size2

Most filters blur. The max filter does the opposite in a useful way: for every pixel, it replaces the value with the brightest pixel in a neighborhood around it. Run it on an image and bright areas swell outward, dark specks vanish, and highlights grow - it's the morphological "dilate" idea applied to brightness. ImageFilterMax from the Allor plugin is a one-input-plus-size version of that, built on PIL's MaxFilter.

How it works

It's PIL's MaxFilter, which looks at a square neighborhood of size+1 around each pixel and takes the maximum. The practical effects:

  • Highlights expand. A small bright point (a light, a star, a specular) balloons into a larger bright blob. Run it once for a subtle glow, stack it a few times for a full light-streak look.
  • Dark speckle disappears. Because any single bright pixel in the neighborhood wins, isolated dark noise gets filled in. It's a great quick cleanup before edge detection or thresholding.
  • Edges push outward. The image effectively grows its bright regions, which is why it reads like a morphological dilation.

The single size input (default 2, stepping by 2) sets how wide the neighborhood is. Larger = brighter, fatter result. It goes through the pack's PIL bridge, so it's a CPU round-trip per image - fine for single images.

Inputs that matter

  • images - the IMAGE or batch.
  • size - neighborhood radius. Start at 2–4; high values turn a photo into glowing blobs fast.

Output is a single IMAGE.

Where it fits

It's the "grow the lights" node - great for prepping a bloom/glow mask (run max filter on the bright areas, then blur), for cleaning dark noise off an image before a contour or threshold step, or for stylized comic-ish rendering where highlights should read as solid blocks.

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 creates the pack's config.json; no model downloads.

Gotchas

  • Max filter shifts the overall brightness up - it's a "take the max" operation, so midtones creep brighter too. If your image starts looking washed, the filter is working; blend it back with the original to control the dose.
  • It's aggressive by nature; on a detailed photo even size 2 visibly fattens edges. Go small unless you want the stylized look.
  • The pack's standing update gotcha applies: Allor's repo was rebased to strip old images from history, so an old clone can fail on git pull; re-clone if auto-update breaks.

The inverse (shrink brights, grow darks) is available as ImageFilterMin elsewhere in the same pack.

Categoryimage/filter

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
sizeINT2

Outputs (1)

NameTypeDescription
IMAGEIMAGE