Nodes/ComfyUI-Rennart/🎨 Rennart Color Preview
ComfyUI Node

🎨 Rennart Color Preview

Paste a pile of hex codes, get a clean swatch grid

By Rennart2025Β·Created 4 days agoΒ·Updated 4 days agoΒ· 2
🎨 Rennart Color Preview
    • IMAGE
    • COLOR_COUNT
    β—„hex_stringβ–Ί
    β—„swatch_size128β–Ί

    Rennart Color Preview is the companion to the pack's Color Palette node, and it solves a small but real problem: seeing color as actual blocks instead of text. You feed it any text containing hex codes - a palette string, a comma-separated list, even a full paragraph of prompt text - and it extracts every #RRGGBB (or shorthand #RGB) and renders them as a grid of swatches on the canvas. If you've ever squinted at #8E44AD in a string widget and wondered whether it was purple or blue, this is your answer.

    How it works

    There's no machine learning anywhere near this. The node runs a regex over the hex_string input, finds every 6-digit or 3-digit hex code, expands the 3-digit ones to full form, and then lays them out using an "adaptive grid algorithm." That's a fancy name for something simple that the author tuned: up to 3 colors sit in one row, 4 makes a 2Γ—2, 8/12/16 use a 4-column layout, and anything else falls into a 3-column grid with short rows balanced so the whole thing looks even instead of ragged. Each swatch is swatch_size pixels (default 128, range 32–512), and the swatches stretch to fill their row width so there are no ugly gaps.

    Two outputs come out: IMAGE (the rendered grid) and COLOR_COUNT (an INT telling you how many distinct colors were found). The color count is genuinely useful - it's a quick sanity check that your palette string actually carries the number of colors you think it does, especially after a node upstream reformats it.

    The inputs that matter

    Just two, and neither is scary:

    • hex_string - a multiline text box. Paste anything containing hex codes. Note it parses #-prefixed codes only; a bare 8E44AD with no hash won't be picked up, and neither will rgb(142,68,173).
    • swatch_size - pixel size of each swatch. Crank it up if you want to actually inspect the colors on a big monitor.

    If the string contains no hex codes at all, the node doesn't error - it quietly renders a single black swatch and reports COLOR_COUNT of 1. That's a deliberate fallback rather than a crash, but it's also easy to misread as "my colors are black," so it's worth remembering when you see an all-black preview.

    Install

    It's part of the ComfyUI-Rennart pack, so one install covers it:

    # ComfyUI Manager: search "ComfyUI-Rennart", or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/Rennart2025/ComfyUI-Rennart
    

    Restart ComfyUI and it shows up under the Rennart menu. No models, no extra pip packages beyond torch/numpy, no keys.

    Where it fits

    The natural flow is Color Palette β†’ Color Preview: wire VARIATIONS_HEX or HEX_STRING from the palette node straight into hex_string here and you get a visual swatch board of the exact colors you're about to pass into a prompt or a JSON payload. You can also use it as a standalone checker for any hex list you have lying around in a note node. It's a tiny utility, and that's the point - it's the kind of node you forget exists until the moment it saves you from pasting hex codes into a browser tab to check them.

    CategoryRennart

    Inputs (2)

    NameTypeDefaultDescription
    hex_stringSTRINGβ€”
    swatch_sizeINT12832–512β€”

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGEβ€”
    COLOR_COUNTINTβ€”