Nodes/DJZ-Nodes/String Painter
ComfyUI Node

String Painter

Turn any seed into a hex color — the 16/32-bit painter

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 78
String Painter
    • STRING
    seed0
    bits16
    modeincrement

    String Painter doesn't paint pictures - it paints colors, as hex strings, derived from a seed. Feed it a seed and it spits out something like 0A1B2C; change the seed and you get a different color. It's a deterministic color picker for people who are tired of hand-typing hex values or who need a color that changes with their seed.

    How it works

    The whole mechanism is two bitwise operations. Your seed is masked against the max value for the chosen bit depth, then formatted as uppercase hex:

    • 16-bit → 4 hex digits (seed & 0xFFFF, formatted :04X)
    • 32-bit → 8 hex digits (seed & 0xFFFFFFFF, formatted :08X)

    That's it. No randomness beyond what's in the seed. The same seed and settings always produce the same hex string, which is the entire point if you're building repeatable workflows.

    The inputs that matter

    • seed - the color source (default 0, up to 4294967295)
    • bits - 16 or 32. 32-bit gives you a "wider" palette because more of the seed survives the mask
    • mode - increment or random. Increment does the deterministic seed→hex mapping above. Random calls random.randint internally and ignores your seed for the output, which... we'll get to.

    Output: a single STRING with the hex color.

    Where you'd use it

    The obvious use is prompt work: many models respond to color words, so a seeded hex that maps to a color can feed a "color" token into a prompt builder - and it stays consistent with your generation seed for reproducibility. It's also handy for tinting backgrounds or border images when you want the accent color to vary per run without opening a color picker.

    This is where V1 and V2 diverge, and honestly V2 is the one to reach for. V1 in random mode rolls a fresh random int and formats that - you get a color, but the node doesn't tell you which seed produced it. That makes the random mode nearly useless if you ever want to reproduce a color you liked. V2 added a used_seed output to fix exactly that, plus a count input to batch-generate palettes. If you're starting fresh, go straight to StringPainter V2.

    Install

    String Painter is one node inside DJZ-Nodes by Drift Johnson. Install the pack via ComfyUI Manager (search "DJZ-Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/DJZ-Nodes
    cd DJZ-Nodes
    pip install -r requirements.txt
    

    Restart ComfyUI. Zero extra dependencies for this node - the pack's heavy requirements.txt (librosa, numba, trimesh...) serves its other 70+ nodes.

    Gotchas

    The V1 random-mode opacity is the real one - you can't reproduce an output from random mode because the used seed is discarded. And the output is a bare hex string with no # prefix, so if you're wiring it into a node that expects a styled hex color, add the # yourself or check the downstream input first.

    Categorypainting

    Inputs (3)

    NameTypeDefaultDescription
    seedINT00–4294967295
    bitsCOMBO162 options: 16, 32
    modeCOMBOincrement2 options: increment, random

    Outputs (1)

    NameTypeDescription
    STRINGSTRING