💀Image Palette 6-3-1
The three-color take on an image's palette
- image
- preview_image
- color1
- color2
- color3
Color extraction in ComfyUI is a spectrum: one color is too blunt, five is a whole mood board. 💀Image Palette 6-3-1 sits in the middle - three colors, which the "6-3-1" name gestures at: a dominant color, a strong secondary, and a supporting accent, roughly in the weightings you'd use for a quick design palette. It's the sibling of 💀Image Primary Color and 💀Image Palette in the same S4Tool-Image pack, sharing the same extraction engine but returning a trio.
The mechanism is the pack's shared color engine: the image is downsampled, pixels are analyzed by your chosen algorithm, and three representative colors are returned as hex strings plus a preview strip. The "6-3-1" in the name isn't a hard 60/30/10 split in the code - it's the author's shorthand for a dominant-plus-accents palette, and honestly the three strongest colors from K-Means usually land close to that shape anyway.
The inputs that matter
image- the IMAGE to analyze.algorithm- same five choices as the pack's other color nodes:- K-Means Clustering (default) - the all-rounder; good for most photos.
- Median Cut - histogram-median splitting; fast, slightly noisier.
- Histogram Frequency - most common colors by raw count.
- High Saturation - prefers vivid pixels; good for brand-style colors.
- Center Weighted - favors the frame's center.
Outputs: preview_image (three stacked color blocks so you can eyeball the result) plus color1, color2, color3 - three STRING hex values, in descending importance. Color1 is your anchor; color3 is the accent.
Install
It's part of the S4Tool-Image pack:
cd ComfyUI/custom_nodes/
git clone https://github.com/S4MUEL-404/ComfyUI-S4Tool-Image.git
pip install -r ComfyUI-S4Tool-Image/requirements.txt
Or ComfyUI Manager → search "S4Tool-Image" → Install → restart. No models to download - scikit-learn and numpy only.
Gotchas
- Which node do I want? - This is the middle child. One color? 💀Image Primary Color. Five sorted colors with a preview? 💀Image Palette. Three colors for a compact accent scheme? This one.
- The 6-3-1 is vibes, not math - don't hunt for a 60/30/10 weighting parameter; there isn't one. The three returned colors are simply the top three from your algorithm.
- Sorting is fixed - unlike 💀Image Palette, there's no
sort_modehere, so the order is dominance, not hue. If you need hue-sorted, use the five-color node and take what you need.
If a quick three-color read of an image is the whole job - say, to pull accent colors for a themed composition - this is the most direct node for it in the pack. Nothing clever, but it's exactly the right amount of clever.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| algorithm | COMBO | K-Means Clustering | 5 options: K-Means Clustering, Median Cut, Histogram Frequency, High Saturation, Center Weighted |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| preview_image | IMAGE | — |
| color1 | STRING | — |
| color2 | STRING | — |
| color3 | STRING | — |