Nodes/comfyui-timesaver/TS Color Match
ComfyUI Node

TS Color Match

Transfer the colour palette of a reference image onto a target batch.

By AlexYez·Created 2 years ago·Updated 3 days ago· 11
TS Color Match
  • reference
  • target
  • image
modemkl
deviceauto
strength1.0
enabletrue
match_masknone
mask_size32
compute_max_side1024
mkl_sample_points300000
sinkhorn_max_points2048
reuse_referencetrue
temporal_smoothingtrue
chunk_size4
loggingfalse
CategoryTS/Image/Color

Inputs (15)

NameTypeDefaultDescription
referenceIMAGEReference whose colors the target is matched to. With batch=1 the statistics can be reused across a whole video.
targetIMAGEFrames/images that get recolored toward the reference.
modeCOMBOmklmkl is faster and more stable; sinkhorn is more accurate but heavier on memory and time.
deviceCOMBOautoauto = GPU if available, otherwise CPU. In GPU mode large tensors stay on CPU to guard against OOM.
strengthFLOAT1.00–1Softly blends the original and the color-corrected result.
enableBOOLEANtrueWhen off, the node returns the input target unchanged.
match_maskCOMBOnonerectangle/ellipse sample only the image border of width mask_size, for stabilization.
mask_sizeINT320–512Used only when match_mask is rectangle or ellipse.
compute_max_sideINT10240–4096Compute A,b on a downscaled copy (e.g. 512–1024). Saves memory at 4K with almost no quality loss.
mkl_sample_pointsINT3000000–2000000200k–500k recommended. At 0 all pixels are used, which can OOM at 4K.
sinkhorn_max_pointsINT20480–65536Usually 1024–2048 for 4K. Too large a value can OOM.
reuse_referenceBOOLEANtrueSpeeds up and stabilizes video when one reference is shared across the whole batch.
temporal_smoothingBOOLEANtrueEMA smoothing of the color transforms between frames. Enable for video (suppresses flicker); disable for a batch of UNrelated images, otherwise per-frame corrections bleed into each other.
chunk_sizeINT40–2564–8 recommended for long 4K videos. 0 processes the whole batch at once.
loggingBOOLEANfalseWhen on, logs processing stages, chunk index and GPU memory state to the console.

Outputs (1)

NameTypeDescription
imageIMAGE