ColorPalette
Hex codes in, color names FLUX actually understands out
- prompt
- color_palettes
FLUX is famously bad at exact color codes. You can type #E10000 or "the dress is hex code #FF0000" into the prompt and it will nod along and hand you something that's maybe red, maybe maroon, maybe a gradient of regret. That's not a prompting failure - it's the T5-XXL encoder. It learned color from captions, which means it learned color as words ("red", "cerulean", "sandy brown"), not as coordinate systems. Name a color and FLUX is remarkably consistent; hand it a hex code and it's guessing.
ColorPalette (node class ColorPalette|AIPOQUE, from AIPOQUE/ComfyUI-APQNodes) is the cheat sheet for exactly that problem. It converts your hex codes into the closest of 155 color names that have been pre-tested to actually reproduce well with FLUX.1 Dev, then rewrites your prompt to restrict the whole generation to those colors.
How it works
The mechanism is simple and worth knowing because it sets your expectations. The node splits the hexcodes string on the # character, parses each token into RGB, then finds the nearest match in a hardcoded list of 155 colors by Manhattan distance (sum of absolute differences across channels - blunt, but fine for this job). The winning name goes into a restriction sentence along the lines of "The colors are restricted to following 2 colors: red, blue", which gets appended to your prompt. It also draws a 64-pixel-tall swatch strip of your chosen colors so you can eyeball what you actually asked for before you burn a generation on it. That 155-color list comes from novuschroma's CivitAI "Color Wildcards for Flux and SDXL" resource; the README credits it directly.
Inputs and outputs that matter
Two inputs, both plain single-line text (multiline is off, and both are force-input, so you can wire them from other text nodes):
- prompt - your normal text prompt. Passed through completely unchanged; the node never scans it for color mentions.
- hexcodes - your hex codes, space-separated,
#included.#FF0000 #00FF00 #0000FFgives you a three-color red/blue/green palette.
Two outputs:
- prompt (STRING) - wire this into your CLIP Text Encode. The example workflow pairs it with DualCLIPLoader in the standard FLUX setup.
- color_palettes (IMAGE) - the white swatch strip; hook it to a PreviewImage node.
That's the whole thing. Despite what a lot of people initially assumed when the author posted it, it does not sample colors from an image - the author's own clarification in the release thread was that only the hexcodes input gets converted.
Installing it
About as painless as a custom node install gets: no requirements.txt, no model files, no heavy downloads - just numpy, torch, and PIL, all of which ComfyUI already ships. Either use ComfyUI Manager (search "ComfyUI-APQNodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/AIPOQUE/ComfyUI-APQNodes
then restart ComfyUI.
Gotchas
- Nearest-match drift. RGB Manhattan distance is a blunt instrument, so an exact teal or off-orange you care about may snap to a name that's "close enough" but not the one you meant. Glance at the swatch output before trusting the generation - that preview image is exactly there for this.
- It's FLUX-flavored. The 155 names were pre-tested on FLUX.1 Dev. It technically works on SDXL too (a color name is a color name), but treat those results as approximate.
- Only the hexcodes field is converted. If you want a palette applied, put hex in the second input; prose in the first input is left alone.
- Temper expectations on scope. The pack is one node and essentially one commit - a utility, not a workflow suite. But for the narrow job of translating your brand colors into something FLUX will actually honor, it's the fastest path in the ecosystem.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Hello | — |
| hexcodes | STRING | World | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| color_palettes | IMAGE | — |