Nodes/ComfyUI LC123 Nodes/LC Auto White Balance
ComfyUI Node

LC Auto White Balance

Fix the color cast without touching a temperature slider

By lonecatone23·Created 2 months ago·Updated 3 days ago· 18
LC Auto White Balance
  • image
  • image
methodShades of Gray
minkowski_p6.0
strength1.00

Every AI image eventually comes out with a cast - too yellow under warm light, too blue in a "cool" render, or just plain green from a checkpoint with opinions. You could eyeball a temperature slider for five minutes, or you can let a white-balance algorithm do it for you. LCAutoWhiteBalance is the "let the math sort it out" option, and it's a proper implementation, not a hue knob.

It's built from the classic white-balance algorithms, the same four you'd find in computer-vision literature. The source is refreshingly transparent about the mechanism: the image is converted to linear space, each channel's "reference white" is estimated, and the gains that push the average toward neutral are computed and applied. The method dropdown picks the estimator:

  • Gray World - assumes the average of everything is gray; measure the mean of each channel and balance to it. Fast, and wrong exactly when a scene is supposed to be one color.
  • White Patch - assumes some bright pixel is white; uses the 97th percentile of each channel. Good for shots with a genuine highlight to anchor on.
  • Shades of Gray (default) - the robust compromise; a Minkowski norm that down-weights outliers so a dominant color doesn't skew the whole estimate.
  • Gray Edge - the clever one; estimates from the average of gradients rather than pixels, so it's largely immune to scenes that are uniformly colored.

minkowski_p (default 6) tunes Shades of Gray and Gray Edge - it's the Minkowski norm parameter, and it controls how much weight extreme values get. Leave it at 6 unless you have a reason, and you can read it as a "how conservative is the estimate" dial.

strength blends the corrected result back against the original, 0 to 1. That's the control you'll actually live on: a full 1.0 correction can over-neutralize a deliberately warm photo, so running at 0.6–0.8 and letting a little of the original's character through is usually the move for creative work. At strength 0 it's a pass-through - useful for A/B when you want the node in the graph but not active.

This is one of the LC image-FX nodes, so it inherits the pack's on-node preview with a before/after hover wipe - you can flick between the original and the corrected result right on the node before you commit to a value. That's a genuinely nice workflow touch, and it's the fastest way to decide whether Gray World or Gray Edge suits the shot.

Where people get tripped up: it's easy to reach for this when the actual problem is a color grade (too much teal-and-orange, a stylized palette) rather than a white balance error. If the image has a deliberate look, auto-WB will fight it - that's what strength is for, and it's also why presets exist elsewhere in the pack for stylized grades. The other gotcha is scenes dominated by one hue, like a field of grass or a red room: Gray World will try to neutralize that and can make grass gray. Switch to White Patch or Shades of Gray in those cases.

It's an output node - single image out, terminates a chain or feeds a save. Install is the standard LC123 clone:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

Restart, no pip deps, no models. A cast that took you five sliders and a headache now takes one node and a dropdown.

CategoryLC123/image

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
methodCOMBOShades of GrayWhite-balance algorithm.
minkowski_pFLOAT6.01–16Minkowski norm p (used by Gray Edge / Shades of Gray).
strengthFLOAT1.000–10 = original, 1 = full correction.

Outputs (1)

NameTypeDescription
imageIMAGE