Find Furthest Color
Auto-pick a color that will never blend into your image
- images
- 24-bit
- hex
- rgb
Picking a padding color, an outline color, or a chroma-key-style background by eye is fine for one image; across a whole batch of varied generations, a hardcoded color you liked for one frame can quietly blend into the next. Find Furthest Color removes the guesswork: it analyzes an image and hands you back a color that's maximally distant from what's actually in it - in three formats, ready to plug straight into whatever needs a color value.
How it works
It samples pixels across your image batch and searches for a color that stands as far as possible from the colors actually present, while staying within sane, visible bounds - it's constrained away from pure extremes (near-black, near-white, near-gray) so what it hands back is a genuinely usable, distinguishable color rather than a degenerate edge case.
The inputs and outputs that matter
images(IMAGE, required) - the image(s) to analyze.sample_rate(INT, optional, default10, 1–100) - rather than scanning every pixel, it samples every Nth one for speed. Lower it for more thorough (slower) analysis on a batch where precision matters; the default is a reasonable speed/accuracy tradeoff.max_brightness(INT, optional, default140, 50–200) - caps how bright the chosen color can be, keeping it away from washed-out near-white results.min_saturation/max_saturation(FLOAT, optional, defaults0.2/0.6) - bounds the color to a visibly saturated range rather than a dull gray or an oversaturated neon.
Three outputs, all describing the same color: 24-bit (INT), hex (STRING), and rgb (STRING). The hex output is worth noting specifically - it's the exact format that Crop by BBox's and Auto Cropper's padding_color fields expect, so this pairs directly with either of them if you want padding that's guaranteed not to blend into your subject.
How to install it
Through ComfyUI Manager: search "Link Comfy Nodes," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Mister-Link/link-comfy-nodes
pip install -r link-comfy-nodes/requirements.txt
Restart ComfyUI afterward.
Common issues & troubleshooting
Result looks like an odd, slightly muddy color rather than something bold. That's the max_brightness/saturation bounds doing their job - the node deliberately avoids extremes, so don't expect pure neon or pure white/black back. If you specifically want a bolder result, widen min_saturation/max_saturation and raise max_brightness toward its ceiling.
Result changes noticeably run to run on the same image. Check sample_rate - a coarser sample (a higher number) means it's only looking at a subset of pixels, and on an image with subtle variation that can shift which color reads as "farthest" between runs if anything else about the input changes even slightly. Lower it if you need a more stable, deterministic result.
Picking a color for a batch, not a single image. If your batch has varied content frame to frame, a single "farthest color" computed once may not stay maximally distinct for every frame - it's a batch-level analysis, not a per-frame one. For content that varies a lot, treat the result as a good general-purpose choice rather than a guarantee for every single frame.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| sample_rateopt | INT | 101–100 | — |
| max_brightnessopt | INT | 14050–200 | — |
| min_saturationopt | FLOAT | 0.200–0.5 | — |
| max_saturationopt | FLOAT | 0.600.3–0.9 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 24-bit | INT | — |
| hex | STRING | — |
| rgb | STRING | — |