Nodes/DJZ-Nodes/String Painter V2
ComfyUI Node

String Painter V2

Seeded hex colors, now with receipts — the V2 that fixes V1

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 77
String Painter V2
    • hex_string
    • used_seed
    seed0
    bits16
    modeincrement
    count1
    random_min0
    random_max4294967295

    String Painter V2 is the version of StringPainter the first one should have been. Same idea - derive a hex color from a seed - but it adds a count input so you can batch out a whole palette, an optional random_min/random_max range for the random mode, and the killer feature: a used_seed output that tells you exactly what produced each color. That last bit is the difference between "random colors" and "random colors I can reproduce tomorrow."

    How it works

    For each of count iterations it does the same seed→hex masking as V1, then:

    • increment mode uses your seed, formats it, and bumps self.seed = (self.seed + 1) & 0xFFFFFFFF - so a count of 5 walks five consecutive seeds and wraps at 32 bits.
    • random mode draws each value from random_min to random_max (defaulting to the full 32-bit range).

    Both the hex strings and the seeds that produced them come out, comma-joined, so you can reconstruct any color you liked by feeding its seed back in increment mode. That reproducibility is the whole upgrade.

    Inputs and outputs

    Required: seed, bits (16/32), mode (increment/random), count (1–100). Optional: random_min, random_max (only meaningful in random mode, and random_min must be less than random_max or it errors).

    Outputs: hex_string and used_seed. With count > 1 both are comma-separated lists - a palette in one output, the recipe for it in the other.

    Why V2 over V1

    Three concrete wins. used_seed turns random mode from a black box into something you can log and replay. count makes it a one-shot palette generator instead of "wire up five copies of the node." And the input validation means bad ranges fail loudly ("random_min must be less than random_max") rather than silently producing garbage.

    Where it sits in a workflow: pick a seed, generate 5–8 colors, dump the hex list into a prompt builder or an image-generation node that takes colors, and keep the used_seed string around as your reproducibility log. It plays well with the rest of the DJZ text/color suite and with any ComfyUI node that accepts hex color strings.

    Install

    Part of DJZ-Nodes by Drift Johnson. ComfyUI Manager → "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. No extra deps for this node.

    Gotchas

    One quirk worth flagging: both outputs are typed INT/STRING in the schema, but with count > 1 they're comma-joined strings. If you wire used_seed straight into an INT input expecting a single number, a multi-count run can misbehave. Keep count at 1 when you want single-value outputs, or treat the outputs as strings once you batch. Also note the "bits" choice is about display width, not color depth - 32-bit just preserves more of the seed in the hex.

    Categorypainting

    Inputs (6)

    NameTypeDefaultDescription
    seedINT00–4294967295
    bitsCOMBO162 options: 16, 32
    modeCOMBOincrement2 options: increment, random
    countINT11–100
    random_minoptINT00–4294967295
    random_maxoptINT42949672950–4294967295

    Outputs (2)

    NameTypeDescription
    hex_stringSTRING
    used_seedINT