Nodes/Smart Upscaler - Hallett/Color Match to Original (Optional)
ComfyUI Node

Color Match to Original (Optional)

Pull a wayward tile back toward the source's colours

By HallettVisual·Created about a month ago·Updated about a month ago· 17
Color Match to Original (Optional)
  • generated_tile
  • source_tile
  • color_matched_tile
color_match_methodnone
color_match_strength50
color_presetManual (use dials below)

Generative upscalers drift. Z-Image Turbo (or whatever's in your generator block) re-renders every tile with fresh interpretation, and sometimes a tile comes back a different shade than its neighbours - slightly too warm, slightly too bright, subtly off. That's what this node is for: an optional, per-tile colour-match stage between the sampler and the stitcher that drags each generated tile back toward the source tile's colour and brightness.

Note the word optional. It's off by default, the pipeline runs fine without it, and the finalizer has its own, smarter source-reference correction downstream. This node is the dedicated knob when you know exactly what you want - keep the model's new detail, but make the colours behave.

The methods

One enum, five choices, and the tooltip is refreshingly honest about which is safest:

  • none - keep generated colours. Default.
  • luminance - match the original's overall brightness. The safest one, per the tooltip.
  • local_tone - even out brightness region by region, keeping generated colour and detail. Good when the mismatch is a gradient, not a flat offset.
  • rgb_mean - match the average colour.
  • rgb_mean_std - match colour and contrast fully. The strongest pull, and the one most likely to flatten what the model did.

color_match_strength (0–100, default 50) controls how much of the chosen match is applied - 0 leaves the generated tile untouched, 100 fully applies it.

There's also a color_preset dropdown (optional) that fills in the method and strength for you and stays on screen as a label: No color change for day-to-night or style edits, Match source brightness for faithful photo upscales (the recommended one), Even out local brightness, or Match source colors fully. Fine-tune the dials afterwards - the preset is a starting point, not a lock.

Inputs and output

Two images in: generated_tile (from the sampler) and source_tile (the matching enlarged original). One image out: color_matched_tile, which continues to SmartTileFinalizer. It's a per-tile node - wire it per tile job, or let the finalizer's own reference correction carry the load instead.

Where it fits (and where it doesn't)

The KB's upscaling doc makes the sharp distinction between "more pixels" and "more detail" - the same split shows up here. If your goal is a faithful photo upscale, matching source brightness is the honest setting and pairs naturally with the finalizer's "Stay close to the original" mode. If you deliberately changed the picture - a style, a time of day - you almost certainly want this node off or on a gentle luminance, because any colour match drags the new look back toward the old one. The README's rule of thumb is that visible shade mismatches get fixed here or by the finalizer's consistency settings; visible texture mismatches (a grid appearing in flat water or sky) are a prompt problem, not a colour problem, and no colour match will fix those.

Install

Same pack install as everything in this set:

cd ComfyUI/custom_nodes
git clone https://github.com/HallettVisual/ComfyUI-Smart-Upscaler

or ComfyUI Manager → search "ComfyUI-Smart-Upscaler", then restart. Also grab ComfyUI-KJNodes and rgthree-comfy for the shipped workflow. No Python deps; the model downloads in docs/MODELS.md (~13 GB) are the cost of running the pack at all, though this node itself is pure pixel math and works even if you're only testing the sampling side.

Gotchas

  • Strength 100 can flatten. rgb_mean_std at 100 fully imposes source contrast - which may erase the very detail the model added. Start with luminance at ~50 and move up only if the shade mismatch persists.
  • It can fight the finalizer. If you've already got SmartTileFinalizer in "Stay close to the original" mode, this node is often redundant - too much source-pulling from both directions and the generated detail gets squeezed out. Use one or the other as your primary colour anchor.
  • Style edits: leave it off. Matching the original is the opposite of what you want when you asked for a style change.
CategorySmart Upscaler/Processing

Inputs (5)

NameTypeDefaultDescription
generated_tileIMAGE
source_tileIMAGE
color_match_methodCOMBOnoneOff by default. none: keep generated colors. luminance: match the original's overall brightness (safest). local_tone: even out brightness region by region, keeping generated color and detail. rgb_mean: match average color. rgb_mean_std: match color and contrast fully.
color_match_strengthINT500–1000 keeps the generated tile untouched; 100 fully applies the chosen match to the source.
color_presetoptCOMBOManual (use dials below)One-click settings that fill in the two dials above and stay shown as a label. Pick No color change for day-to-night or style edits, Match source brightness for faithful photo upscales. Fine-tune the dials freely afterward.

Outputs (1)

NameTypeDescription
color_matched_tileIMAGE