Nodes/AusBoss/Color Match πŸ†Ž
ComfyUI Node

Color Match πŸ†Ž

The fix for 'that inpainted region is slightly too bright'

By ausbossΒ·Created 2 months agoΒ·Updated 4 days agoΒ· 2
Color Match πŸ†Ž
  • image
  • reference
  • mask
  • image
β—„strength1.00β–Ί
β—„methodlabβ–Ί
β—„invert_maskfalseβ–Ί
β—„reference_modereferenceβ–Ί

Every outpaint or inpaint eventually hits the same wall: the patched region comes back a hair brighter, a touch cooler, or just off compared to the plate around it. Re-rolling the seed is the wrong tool - that's the thing the knowledge base keeps hammering, and it's right: a statistics transfer is deterministic and instant, a regeneration is neither. Color Match πŸ†Ž is the deterministic fix.

It transfers the reference image's color statistics onto your input. The default lab method moves per-channel mean and standard deviation in LAB space, which is the perceptual-friendly, "make this look like that" default. rgb does the same math in raw channels, mkl maps the full covariance (better when hues are rotated rather than just shifted), and histogram matches each channel's distribution exactly - the strongest, least subtle option. For the classic use case, lab at strength 1.0 is where you start.

The two inputs that make it useful

reference is the image whose colors you want to copy - for an inpainted crop, feed it the original untouched image. It broadcasts across a batch, so one reference serves a whole video's worth of frames.

mask is where this node gets clever, and it's also the thing that trips people up. The mask restricts both the statistics measurement and the correction to its white area - perfect for recoloring just an inpainted region instead of the whole frame. Black pixels pass through bit-identical. Here's the catch: the node has no mask output. That's not a bug. The mask only scopes the fix; it doesn't change your mask, so you keep wiring your original mask onward and don't need it echoed back. invert_mask flips which side gets corrected, and strength blends between the original and the fully matched result - 0.3 is a gentle nudge, 1.0 is a full takeover.

The video trick

For video there's reference_mode: first_frame, which locks every frame to the batch's own first frame as the target. That's the one-node flicker fix: instead of each frame being matched against a static reference, they're all pulled toward a single anchor so colors stop breathing across the clip. No reference input needed.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ausboss/ComfyUI-AusBoss.git

Restart ComfyUI and search for AusBoss (also in Manager under the pack title). No extra Python dependencies; the pack uses Pillow and NumPy that ship with ComfyUI. Minimum ComfyUI is 0.27.1.

Troubleshooting

If the match is too aggressive, that's what strength is for - a feathered inpaint seam usually wants 0.5–0.8, not 1.0. If hues look rotated rather than shifted, switch lab to mkl. And if your mask correction is landing on the wrong side of the frame, you've got invert_mask backwards, which is the most common mistake here. One real limitation: a plain statistics transfer can't fix a fundamentally different white balance or lighting angle - that's a regrade, not a match.

CategoryπŸ†Ž AusBoss/Image

Inputs (7)

NameTypeDefaultDescription
imageIMAGEBHWC image whose colors get corrected.
strengthFLOAT1.000–1Blend between the original (0) and the fully matched image (1).
referenceoptIMAGEThe image whose color statistics to copy β€” for an inpainted crop, feed the original image here. A single reference broadcasts across a batch. Required unless reference_mode is first_frame.
methodoptCOMBOlabHow the colors move. lab: perceptual mean/std shift, the safe default. rgb: the same in raw channels. mkl: full covariance mapping, best when hues are rotated, not just shifted. histogram: exact per-channel distribution match, the strongest and least subtle.
maskoptMASKRestricts the correction to the white area β€” both the statistics measured on the image and where the fix is applied; typical for recoloring just an inpainted region. Black pixels pass through bit-identical, so the mask itself never changes β€” wire your original mask onward. Without a mask the whole image is matched.
invert_maskoptBOOLEANfalseTreat the mask's black area as the region to correct instead of the white area.
reference_modeoptCOMBOreferenceWhere the target statistics come from. reference uses the connected reference image. first_frame uses the batch's own first frame as the target for every frame β€” locks a video's color in place to kill flicker; the reference input is ignored.

Outputs (1)

NameTypeDescription
imageIMAGEThe color-matched image; pixels outside the mask are untouched.