Nodes/ComfyUI-Fossiel-QoL-Nodes/Image Level Matcher
ComfyUI Node

Image Level Matcher

Match an Image's Brightness to a Reference, Not a Guess

By Fossiel·Created 10 months ago·Updated 5 months ago· 1
Image Level Matcher
  • image
  • Brightness_Ref
  • Contrast_Ref
  • Saturation_Ref
  • IMAGE
MatchAll
Brightness_offset0.000
Contrast_offset0.000
Saturation_offset0.000
Saturation_algorithmMidtone-Weighted

On the surface this is yet another brightness/contrast/saturation adjuster, and there are a hundred of those. What makes Image Level Matcher different is the word "match": it can take a reference image and pull your image's levels to that reference automatically, then fine-tune from there. Developed for greyscale work, but it's equally at home on color.

The pitch: you've got a consistent look across a series of frames or a batch of generations, and you want a new image to sit in the same exposure neighborhood without eyeballing sliders. Wire the reference in, pick what to match, done.

How it works

Read the source and the approach is clean. For brightness, it computes the ratio of the reference's mean luminance to your image's mean and uses that as a multiplication factor. For contrast, it does the same with standard deviation - the spread of pixel values, which is what "contrast" actually measures. For saturation, it works in HSV and compares saturation spread; the Saturation_algorithm toggle picks between a straight global measure and Midtone-Weighted, which ignores blown highlights and crushed shadows (luminance outside 0.15–0.85) so a single bright hotspot doesn't wreck the match.

Then the three *_offset sliders nudge each factor on top of the reference match - the reference sets the baseline, you tune. Everything clamps to a sane minimum so you can't zero a channel into a black void.

One important detail from the author, worth its weight: when you feed it a batch, only the first frame is used to compute the match - deliberately, to prevent the levels from shifting frame to frame and causing flicker. It's applied consistently across the whole batch, which is exactly what you want if your batch is a video sequence.

The inputs that matter

  • Match - the selector: All, or any pairing of Brightness Only, Contrast Only, Saturation Only, Brightness & Contrast, Brightness & Saturation, Contrast & Saturation. If you only want exposure equalized, don't touch saturation.
  • Brightness_Ref / Contrast_Ref / Saturation_Ref (optional) - you can point each level at a different reference image, which is a nice touch if your exposure reference isn't the same frame as your color reference.
  • The offsets - Brightness_offset (−1 to 1), Contrast_offset (−1 to 1), Saturation_offset (−1 to 2). Zero with no reference means "no change."
  • Saturation_algorithm - Global or Midtone-Weighted (default). Default is the right call for almost everything.

Single IMAGE in, single IMAGE out.

Installing it

Same pack, same ritual - ComfyUI Manager (search "ComfyUI-Fossiel-QoL-Nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Fossiel/ComfyUI-Fossiel-QoL-Nodes
pip install -r ComfyUI-Fossiel-QoL-Nodes/requirements.txt

Restart, find it under Fossiel.

Where people get burned

Same dependency trap as the pack's Video De-flicker: this node imports cv2 at module load and it's not in requirements.txt. If the pack won't load with No module named 'cv2', pip install opencv-python fixes it. Beyond that, the main gotcha is expectation-setting: this matches statistical levels (mean, standard deviation), not color grading. If your reference has a warm cast and your image doesn't, brightness/contrast matching won't create that cast - it equalizes exposure and punch. For consistent look across a batch of frames from the same shoot, it's ideal. For "make this photo look like this other photo's grade," it's a starting point, not the whole job.

CategoryFossiel

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
MatchCOMBOAll7 options: All, Brightness Only, Contrast Only, Saturation Only, Brightness & Contrast, Brightness & Saturation, +1
Brightness_offsetFLOAT0.000-1–1
Contrast_offsetFLOAT0.000-1–1
Saturation_offsetFLOAT0.000-1–2
Saturation_algorithmCOMBOMidtone-Weighted2 options: Global, Midtone-Weighted
Brightness_RefoptIMAGE
Contrast_RefoptIMAGE
Saturation_RefoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE