Nodes/ComfyUI-ListHelper/Auto White Balance
ComfyUI Node

Auto White Balance

Kill the color cast before it poisons your pipeline

By dseditor·Created about a year ago·Updated 7 months ago· 75
Auto White Balance
  • image
  • IMAGE
methodgray_world
strength1.0
preserve_brightnesstrue
clip_valuestrue

Every photographer has shot something under mixed lighting and watched the whole image come out orange or blue. AI-generated images do the same thing - a checkpoint will happily bake a tungsten cast into your character's skin or your product shot. AutoWhiteBalance is a small correction node that fixes that cast before it flows downstream, and it does it with classic computer-vision algorithms rather than a model. Think of it as the "neutralize the tint" step you drop right after loading an image and before it reaches your img2img or video pipeline.

How it works

Under the hood it's OpenCV with four well-known white-balance algorithms, selectable via method:

  • gray_world (default) - assumes the average color of a natural scene is gray, so it scales each channel to equalize the averages. Robust and usually right for photos.
  • white_patch - assumes the brightest pixel should be white, so it scales by per-channel maximums. Great for blown-out highlights, fragile when a highlight is genuinely colored.
  • simple_avg - equalizes channel averages using green as the reference (the channel human eyes weight most). A cheaper gray-world variant.
  • histogram_stretch - stretches each channel's 1st–99th percentile range to full scale, which can punch up contrast as a side effect.

The strength slider (0–2, default 1) blends the correction with the original - 1 is full correction, and dropping to ~0.4 is often the sweet spot for a subtle fix that doesn't shift your whole look. preserve_brightness (on by default) keeps the corrected image from getting darker or lighter, and clip_values keeps everything in the 0–255 range.

Inputs and output

Just image (IMAGE) in, IMAGE out, ready to wire into anything that accepts an image. The corrected tensor comes back as a normal batch of one, so it slots into existing pipelines without any list-wrangling.

Installing it

Bundled with ComfyUI-ListHelper:

cd ComfyUI/custom_nodes
git clone https://github.com/dseditor/ComfyUI-ListHelper

The catch: opencv-python isn't in the pack's requirements.txt. If the node complains about missing dependencies, install it once yourself:

pip install opencv-python Pillow

Restart ComfyUI and look under ListHelper/Tools. ComfyUI Manager search: "ComfyUI-ListHelper".

The honest take

This is a utility you'll reach for situationally, not every run - and it has real limits. Gray-world assumptions fall apart on scenes dominated by one color (a field of green, a red room), and none of these methods are as smart as a learned white-balance model. Where it shines is the common failure mode: a render that's uniformly too warm or too cool. Set strength below 1, and you get a natural de-tint that preserves the creative grade. Push it to 1 and you'll get a neutral image that can look flat on stylized renders. Start at 0.4–0.6, look, and dial in from there - that's the workflow the slider was built for.

CategoryListHelper/Tools

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
methodCOMBOgray_world4 options: gray_world, white_patch, simple_avg, histogram_stretch
strengthFLOAT1.00–2
preserve_brightnessoptBOOLEANtrue
clip_valuesoptBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE