ComfyUI Node

Apply Exposure Gain

The node that actually applies the exposure fix you measured elsewhere

By MengYe-Z·Created 4 months ago·Updated 4 months ago· 1
Apply Exposure Gain
  • images
  • exposure_data
  • IMAGE

Apply Exposure Gain is the "apply" half of the MultiPoint White Balance pack's exposure path. On its own it does one dumb, useful thing: it takes a single number and multiplies every pixel of your image by it. The clever part - where that number comes from - happens in a different node, and understanding that split is the whole trick of this pack.

What it's for

The pack's workflow is deliberately two-stage. First you compute a gain from a blurred copy of the image (using ExposureMatchFromPoint, which samples points you clicked on the background). Then you apply that gain to the original sharp image - that's this node. Why bother? Because a blur suppresses noise, dust spots and uneven color in a stained white background before you measure it, so the number you compute isn't thrown off by a single dirty pixel. Then the clean, sharp original gets corrected. It's a classic measure-on-the-noise-free-version, apply-to-the-real-thing pipeline, and this node is where the "apply" lands.

How it works

Under the hood it's embarrassingly simple: it parses the JSON you hand it, pulls out a gain value, multiplies every channel of every image by it, and clamps to 0–1. One global scalar for the whole frame. No masking, no per-pixel logic, no gradient awareness. That's why the recommended workflow composites a background mask (BiRefNet + a composite node) around it if you only want the background touched - this node is aggressively whole-image.

The inputs that matter

  • images - the original sharp image. The README is emphatic: the corrected result is only as good as what you feed here, and feeding the blurred copy back in defeats the whole design.
  • exposure_data - the JSON string from ExposureMatchFromPoint, containing the gain. Any string works as long as it parses, but the author intends a direct wire.

The output is a single IMAGE, corrected and ready to preview or composite.

Install

The pack ships all its nodes together, so:

cd ComfyUI/custom_nodes
git clone https://github.com/MengYe-Z/ComfyUI-MultiPointWhiteBalance.git

Or open ComfyUI Manager → Install Custom Nodes and search for "ComfyUI MultiPoint White Balance", then restart. No model downloads and effectively no pip dependencies - the code is pure torch. The one thing you do need already installed is KJNodes, because its PointsEditor is what generates the sample points that feed the compute node.

The trap

Here's the failure mode that will quietly waste your time: if exposure_data fails to parse, this node doesn't error out - it prints a warning to the console and falls back to gain = 1.0. A broken or wrong wire therefore does nothing, silently, and you'll sit there wondering why the image never changes. Check the console if a "fixed" image looks untouched.

Also, since the gain is a single multiplier, any exposure push over 1.0 clips highlights to pure white. If your sampled background was a dark shadow, the compute node produces a huge gain and you get blown-out whites. Sample midtones, not shadows - more on that in the ExposureMatchFromPoint article.

Categoryimage/color

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
exposure_data*JSON string from ExposureMatchFromPoint (contains 'gain')

Outputs (1)

NameTypeDescription
IMAGEIMAGE