💀Image Palette
Five colors, sorted the way you want, as hex strings
- image
- palette_image
- color1
- color2
- color3
- color4
- color5
The full color story of an image, in five colors, ordered the way you want them, as usable hex strings. That's 💀Image Palette from the S4Tool-Image pack - the biggest of the pack's color-extraction nodes and the one you reach for when you need a working palette, not just a dominant color. It shares an engine with 💀Image Primary Color and 💀Image Palette 6-3-1, but adds the two things those lack: five colors and a real sort mode.
The mechanism is the pack's shared extraction engine with a sorting step bolted on. The image is downsampled, five representative colors are pulled using your chosen algorithm, then sorted by hue, saturation, or brightness. The sorted order is what makes the output predictable: sort by hue and you get a rainbow-ordered strip; sort by saturation and the vivid colors line up. The node renders a preview strip of the sorted blocks and returns the five hex strings separately.
The inputs that matter
image- the IMAGE to analyze.algorithm- the five-way choice: K-Means Clustering (default), Median Cut, Histogram Frequency, High Saturation, Center Weighted. Same semantics as the other palette nodes - K-Means for a balanced read, High Saturation for brand-style colors, Center Weighted when the subject sits mid-frame.sort_mode- Hue (default), Saturation, or Brightness. This is the input that makes this node distinct from its siblings.
Outputs: palette_image (the preview strip) plus color1 through color5 - five STRING hex values in the sorted order.
Install
Pack install as usual:
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 - scikit-learn and numpy only.
Gotchas
- Hue-sorted ≠ importance-sorted - color1 is not "the most dominant color" here; it's the first after sorting. If you need dominance order, use 💀Image Primary Color or 💀Image Palette 6-3-1, which don't re-sort.
- Five hex strings, wire them individually - there's no combined "palette" string output; each color is its own port, so feeding them somewhere usually means routing a few wires.
- The preview is a strip, not the source -
palette_imageshows the five colors as blocks for eyeballing; the actual data you want lives in the hex outputs.
For "what does this image actually look like in color" - pulling a reference's palette to drive a themed composition, matching a character's outfit colors, or just understanding an image's mood at a glance - this is the most complete one-stop node in the pack.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| algorithm | COMBO | K-Means Clustering | 5 options: K-Means Clustering, Median Cut, Histogram Frequency, High Saturation, Center Weighted |
| sort_mode | COMBO | Hue | 3 options: Hue, Saturation, Brightness |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| palette_image | IMAGE | — |
| color1 | STRING | — |
| color2 | STRING | — |
| color3 | STRING | — |
| color4 | STRING | — |
| color5 | STRING | — |