ComfyUI Node

Color Palette

The 30-second way to feed colors into every palette node

By 45uee·Created 2 years ago·Updated 5 months ago· 41
Color Palette
    • Color palette
    color_palette[(30, 32, 30), (60, 61, 55), (105, 117, 101), (236, 223, 204)]

    This node is boring on purpose. ColorPalette is just a text box that turns your colors into a COLOR_LIST - the exact thing every palette-based node in ComfyUI-Color_Transfer wants on its target_colors input. You don't generate anything with it, you don't preview with it, you type a palette and it hands it off. It's the equivalent of a constants node in a programming workflow, and for the palette-transfer family it's the whole point of entry.

    What you actually type

    One input, one output, that's the whole node. The field is a multi-line string that must be a Python list of (R, G, B) tuples, each channel an integer between 0 and 255:

    [(30, 32, 30), (60, 61, 55), (105, 117, 101), (236, 223, 204)]
    

    That default is a muted green-ish neutral palette, and it's a good sanity check - hook it up, run it, and you'll see what the transfer nodes do before you start inventing palettes of your own.

    The parsing is ast.literal_eval, which means it's strict: it must be a list of tuples (not lists), each tuple needs exactly three ints in 0–255, and stray text will throw a ValueError telling you exactly that. The good news is the check is real, so a typo won't silently give you garbage colors - it'll just refuse.

    The output is a single Color palette of type COLOR_LIST. Wire that into target_colors on PaletteTransfer, PalletteSoftTransfer, PaletteRbfTransfer, or any of the others. If you ever want to see what you've defined, drop an ExtractPalette in reverse, or just eyeball the values - the node doesn't render a swatch.

    How it fits a workflow

    ComfyUI's palette transfer nodes need their palette as data, not as an image. This node is how you supply that data without hand-rolling a script. A typical pipeline: LoadImage → a transfer node → PreviewImage, with this node feeding the palette in. Want to try five palette variants of the same shot? Duplicate the node, change the numbers, hit run.

    Two things worth knowing:

    • If you pass an empty list [], the transfer nodes mostly pass your image through untouched, so an empty palette is a quick "bypass" that still leaves the graph wired.
    • This pack's ExtractPalette node goes the other direction - pull dominant colors out of a photo as a COLOR_LIST. Pair them: extract from a reference shot, paste into this node (or wire directly), and recolor your target image with the reference's mood.

    Installing it

    The whole pack installs together - there's no point installing this node alone. From ComfyUI Manager, search "Color_Transfer" (it's 45uee/ComfyUI-Color_Transfer) and hit install, or clone manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/45uee/ComfyUI-Color_Transfer
    

    Then restart ComfyUI. No model files, no API key - the pack is pure numpy/OpenCV math that runs on CPU. If you hit an import error on first load, the README's fix is pip install scikit-learn. It's a small, lightly-maintained pack from a solo dev (45uee), and this node is the least demanding piece of it - it can't really fail at runtime because it's just parsing text.

    CategoryColor Transfer/Palette Transfer

    Inputs (1)

    NameTypeDefaultDescription
    color_paletteSTRING[(30, 32, 30), (60, 61, 55), (105, 117, 101), (236, 223, 204)]

    Outputs (1)

    NameTypeDescription
    Color paletteCOLOR_LIST