🧮 Annotate Hex Lines
It won't touch your image — it numbers your hex lines (and that's fine)
- annotated_list
The README for this pack says Annotate Hex Lines "adds text annotations onto an image." It doesn't. The name lies, gently - this node never draws a pixel. It takes a multiline list of hex colors and returns the same list with line numbers stuck on the front. That's the whole job, and once you know that, it's a handy little text formatter instead of a disappointment.
You reach for it inside a palette workflow: after a color extractor gives you a bare hex list, or you've pasted a palette from somewhere, Annotate Hex Lines turns
#ff0000
#00ff00
#0000ff
into
(1) #ff0000
(2) #00ff00
(3) #0000ff
That formatted string is what you drop into a prompt, a notes node, or a text concat so you can actually read which swatch is which. If you're iterating on a color scheme by hand-editing a text node, numbering the lines stops you from counting "wait, was turquoise line 3 or 4?"
How it works
It's a string-in, string-out utility. The node splits your hex_list on newlines, then prefixes each line with prefix + line number + suffix, joined by a space if space is on. Nothing leaves the text domain, which is also why it's about as bug-proof as a custom node gets - no image tensors, no PIL, no GPU involved.
The inputs that matter
You only set three things, honestly:
- hex_list (multiline text) - paste your colors, one per line.
- prefix / suffix (defaults
(and)) - the brackets around the number. Change them if you want1.or#1instead. - space (default on) - whether there's a gap between
(1)and the color. Off gives you(1)#ff0000, which is rarely what you want.
Output is a single annotated_list string, newline-separated, ready to feed into whatever text input accepts a string connection.
Installing it
Same story as the rest of the Colormaster pack: ComfyUI Manager, search "Colormaster," install, restart. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI_colormaster
pip install -r requirements.txt # Pillow, torch, numpy - you already have all three
Then restart ComfyUI. No model files, nothing heavy. One genuine gotcha: the pack's sibling Color Palette Extractor needs scikit-learn (for KMeans), which isn't in requirements.txt - but the pack's __init__.py wraps each node in a try/except, so the rest of the pack loads fine even if that one doesn't.
Common issues
The only real trap is expectations. Because the README says "annotate," people wire an image in and wonder why nothing happens - there's no image input here. It's a text node; feed it text and feed its output to text. Beyond that: turn space off and you'll get cramped (1)#ff0000 output, and if you don't care about the numbering at all you can set prefix and suffix to empty strings and it becomes a trim-and-join utility. Small pack, small node, one job - it does that job cleanly.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| hex_list | STRING | — | |
| prefix | STRING | ( | — |
| suffix | STRING | ) | — |
| space | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| annotated_list | STRING | — |