Color Transfer
Match one image's palette to another, three different ways
- target_images
- source_images
- images
Grading a whole batch of frames - or a whole batch of generations - to look like they came from the same shoot is a real problem, and "just change the prompt" doesn't fix it reliably. SAIColorTransfer is a dedicated tool for it: it moves the color statistics of one image onto another while leaving the structure (the actual content) alone.
What it does
Two image inputs do different jobs, and the naming is worth being precise about because it's easy to get backwards: source_images supplies the palette you want, target_images are the images that get recolored to match it. The output, images, is your target batch wearing the source's color mood.
There's a mode dropdown with three algorithms, and they're not interchangeable - each makes a different tradeoff:
mean_transfer- the simplest and fastest option. It matches the average brightness and color spread (mean and standard deviation) of the target to the source, channel by channel. Good for a quick, cheap grade; can look a little flat because it only matches two statistics per channel, not the full distribution.lab_transfer- does the same kind of statistical matching, but in LAB color space instead of RGB. LAB separates lightness from color, so this version tends to shift color without dragging brightness/contrast around with it - usually the more natural-looking result for a straightforward palette match.pdf_regrain- the heaviest option, based on full probability-density-function matching between the two images (not just mean/stddev) plus a "regrain" pass that restores fine detail/texture the statistical matching step would otherwise smooth away. Slower, but it's the one to reach for when a simpler transfer leaves your image looking waxy or loses grain.
Where it's actually useful
Think in terms of consistency, not correction: matching every frame of an AI-animated sequence to a single reference frame so the sequence doesn't flicker in color temperature, or pulling a batch of generations toward a specific photo's grade before you hand them off. It's not a fix for a bad generation - it moves color, not content - so don't reach for it expecting it to rescue composition or lighting direction that's actually wrong.
Installing it
ComfyUI Manager: search SaltAI-Open-Resources. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/get-salt-AI/SaltAI
Restart ComfyUI. No extra model downloads here - these are classic image-processing algorithms running on the CPU/GPU tensor math, not a neural network, so there's nothing to fetch on first run.
Common issues
If your output looks unchanged or barely shifted, double-check you haven't swapped source_images and target_images - a frequent mistake given how similar the two names read at a glance. If pdf_regrain is noticeably slower than the other two modes on a large batch, that's expected - it's doing real distribution matching per image rather than a couple of scalar stats, so budget for it if you're batching a long sequence. And if you're feeding batches of different sizes into source vs. target, keep them matched or intentionally use a single source image against a larger target batch - mismatched, unequal batches are the kind of thing that produces confusing per-image pairing rather than a clean error, so it's worth a quick sanity check on a small batch before you commit to grading the whole sequence.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| target_images | IMAGE | — | |
| source_images | IMAGE | — | |
| mode | COMBO | 3 options: pdf_regrain, mean_transfer, lab_transfer |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |