Nodes/ComfyUI Colormaster Nodes/๐ŸŽฏ Select Hex Line
ComfyUI Node

๐ŸŽฏ Select Hex Line

Pick one color out of a palette โ€” despite what the README calls it

By orion4dยทCreated about a year agoยทUpdated about a year agoยท 2
๐ŸŽฏ Select Hex Line
    • selected_hex
    โ—„hex_listโ€”โ–บ
    โ—„line_number1โ–บ

    The README advertises Select Hex Line as a dropdown node that reads a .txt or .csv file and lets you pick a line. The actual node doesn't do any of that. In reality it's a paste-in-your-palette, give-it-a-line-number utility that returns one hex color. It's a small correction with a big payoff: once you stop expecting a file browser, this becomes a surprisingly useful way to pull a single color out of a list and feed it into the rest of your workflow.

    You'll typically use it after a palette extractor hands you a hex list. You paste that list in, set the line number, and the node returns that one color - which you can then wire into Hex Color โ†’ Image to render a swatch, or into a text node that feeds a prompt. Change the line number and you've got a different color from the same palette, which is exactly the loop you want when you're auditioning colors.

    How it works

    It splits your multiline hex_list on newlines, grabs the line at line_number, and returns it as a string. Line numbering starts at 1, so line 1 is the first entry. Two behaviors to keep in mind:

    • Out-of-range line numbers silently return #000000. Ask for line 12 when you only pasted 8 colors and you get black, not an error. That's a quiet trap - it looks like your color is wrong when really your index is.
    • It doesn't validate that a line looks like a hex code. Line 2 of your list could be "blue" and it'll happily return "blue." Garbage in, garbage out, so keep the list clean.

    The inputs

    Just two, and one of them is your data:

    • hex_list - multiline text, one color per line.
    • line_number - integer, default 1, minimum 1. The line to return.

    Output is a single selected_hex string. That's the whole interface; there's no dropdown, no file input, no random mode.

    Installing it

    Standard pack install: ComfyUI Manager โ†’ search "Colormaster" โ†’ install โ†’ restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orion4d/ComfyUI_colormaster
    pip install -r requirements.txt   # Pillow, torch, numpy - already installed
    

    Restart ComfyUI. No models, no extra downloads.

    Common issues

    The README gap is the thing that bites people: they search for the file-list dropdown, find nothing, and assume the node is broken. It isn't - the interface is a multiline string plus a number. If you genuinely need file-driven selection, this isn't the node; if you have a static palette in a text node, it's great. To get "random" behavior that the README implies exists, wire a random integer into line_number yourself - the node just needs a number. And mind that black fallback: if your selected color keeps coming back #000000, check that line_number is actually within your list before blaming the hex. Once you've got that mental model, it's a dependable little picker.

    CategoryColormaster

    Inputs (2)

    NameTypeDefaultDescription
    hex_listSTRINGโ€”
    line_numberINT1โ€”

    Outputs (1)

    NameTypeDescription
    selected_hexSTRINGโ€”