Nodes/ComfyUI-Image-Process/Achromatic Stabilizer
ComfyUI Node

Achromatic Stabilizer

Your near-white pixels aren't broken — they're unstable. This fixes that.

By wakaura-asaho·Created 5 months ago·Updated 2 months ago· 1
Achromatic Stabilizer
  • image
  • mask
  • OUTPUT
  • ALPHA
smoothtrue
sat_threshold0.08
kernel_size3
preserve_alphatrue
invert_alphafalse

You know that thing where a near-white or near-black area of a generated image looks vaguely dirty - little blotches of pink, green, or blue swimming around in what should be a clean grey? That's achromatic instability, and it's annoyingly common in AI output. The sampler decided those pixels "should" have some hue, then changed its mind every few steps. This node hunts down every pixel whose saturation is basically zero and forces it back to a stable neutral grey, so your whites stop looking like a color-noise photo of a wall.

Achromatic Stabilizer is the "process" part of this pack showing off. It's the one node here that fixes the image rather than just saving it, and it slots in right after your VAE decode and before anything that downscales or sharpens.

How it works

The math is refreshingly simple. The node converts each frame to RGB, computes the chroma (max channel minus min channel) per pixel, and anything below your saturation threshold counts as "artifact." Those pixels get their hue snapped to zero, saturation zeroed, and the RGB replaced with the pixel's own luminance grey - meaning the brightness stays, only the phantom color goes.

Two knobs matter:

  • Saturation Threshold (0.0–1.0, default 0.08) - how saturated a pixel has to be to escape the purge. Lower is more aggressive; the README suggests starting at 0.08 and trying 0.05 for heavy correction, 0.15 if you want to be gentle.
  • Smoothing Kernel Size (1–15, default 3) - with Smooth Transitions on (it is by default), corrected areas get blended with a uniform filter instead of hard-edged. Kernel 3–5 gives subtle cleanup; 7–15 visibly softens regions, at the cost of some blur. If you've ever tried this, you know the hard cutoff creates ugly banding - the smoothing is what saves it.

If you're feeding a cut-out with transparency, keep Preserve Alpha on and connect your mask to the mask input. The node passes the alpha through untouched (or inverted, if you flip Invert Alpha), and outputs it separately.

Outputs

This one's not a dead-end. You get two outputs:

  • OUTPUT (IMAGE) - the corrected image, with alpha baked in if you preserved it.
  • ALPHA (MASK) - the alpha channel on its own, ready to feed a Join Image with Alpha or a save node later.

That dual-output design is why it fits cleanly into a graph: stabilize, then keep working with the mask instead of losing it.

Installation

It ships in ComfyUI-Image-Process. Easiest path is ComfyUI Manager: search "ComfyUI-Image-Process" (or paste the git URL under Install via Git URL) and restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/wakaura-asaho/comfyui-image-process
pip install -r comfyui-image-process/requirements.txt

Then restart ComfyUI. Note the dependencies are the scientific stack - numpy, Pillow, scipy, opencv, scikit-image - and the README suggests installing with --upgrade-strategy only-if-needed to avoid pip reshuffling your whole environment. No model files to download. One real gotcha: this pack targets modern ComfyUI (frontend ≥ 1.37, base ≥ 0.12). On an older install the nodes won't even appear.

Troubleshooting

  • "I get a warning that preserve_alpha was requested but the image has no alpha" - you connected a mask-less image with Preserve Alpha on. The output is just opaque; either skip the mask or don't expect transparency.
  • Banding around corrected areas - your threshold is too aggressive for the content, or kernel size is too small. Ease off the threshold first; it's the sharper control.
  • Everything looks grey - threshold at 0.15 on a colorful image shouldn't do this; check that you're not routing this before a color-tampering node downstream that reintroduces noise.

The one trap worth naming: this is a neutral fixer. It will happily flatten legitimately-desaturated artistic intent if your threshold is high, so if your image has a deliberate muted palette, keep the threshold low and let it only touch the near-zero pixels.

CategoryWakaura

Inputs (7)

NameTypeDefaultDescription
imageIMAGEThe image to be processed.
smoothBOOLEANtrueWhether to apply a smoothing filter to the corrected areas.
sat_thresholdFLOAT0.080–1The saturation level below which pixels are considered artifacts.
kernel_sizeINT31–15The size of the smoothing kernel to apply.
preserve_alphaBOOLEANtrueWhether to preserve the alpha channel during processing.
invert_alphaBOOLEANfalseWhether to invert the alpha channel before saving.
maskoptMASKOptional alpha channel mask. If provided and preserve_alpha is True, this mask will be used as the alpha channel.

Outputs (2)

NameTypeDescription
OUTPUTIMAGE
ALPHAMASK