Nodes/Eden.art nodesuite/Eden_StringHash
ComfyUI Node Runs on cloud

Eden_StringHash

Turn any string into a stable, short ID — prompt hashes for filenames and seeds

By edenartlab·Created 3 years ago·Updated 6 months ago· 119
Eden_StringHash
    • hash_int
    • hash_string
    input_string
    hash_length8

    Eden_StringHash answers a deceptively simple question: how do you turn a prompt - or any text - into a short, stable identifier you can put in a filename? Same input string, same hash, every time, on every machine. That's the whole deal, and it's more useful than it sounds.

    The node's own description: "Generates a deterministic hash from an input string with configurable length." It's part of eden_comfy_pipelines, Eden.art's 70+ node suite, under Eden 🌱/general.

    What you set

    • input_string - the text to hash. Multiline, so a whole prompt works.
    • hash_length - 4 to 64 characters, default 8. This controls how long the string hash is. Shorter is easier to read, longer is safer against collisions.

    Two outputs:

    • hash_int (INT) - the hash as a number. Small enough to feed a seed node or a random picker.
    • hash_string (STRING) - the hex string, truncated to your hash_length.

    How it works

    Under the hood it's an MD5 of the UTF-8 bytes, which is the same hash algorithm your browser uses to verify downloads - deterministic by construction. The hash_int output is built from the first bytes of the digest, and hash_string is the hex digest cut down to your requested length. Because MD5 is a fixed algorithm, the output is reproducible across runs and across machines: hash "a cat in a hat" and you'll always get the same string. That reproducibility is the entire point.

    Two honest caveats. First, MD5 is a content hash, not a semantic one: "a cat" and "a cat" (double space) hash completely differently, so if you're hashing prompts, the hash changes with every whitespace or comma edit. That's correct behavior, but it surprises people who expect "similar prompt → similar hash." Second, don't use this for anything security-adjacent - MD5 is cryptographically broken for that purpose and this node isn't trying to be. It's an ID generator, not a signature.

    Where you'll actually use it

    The filename pattern is the big one. prompt_hash_<hash>_<seed>.png gives you an archive where identical prompts sort together even when you never saved the full text. It's also a clean way to derive a stable seed from text: wire hash_int into any seed input and the same prompt always produces the same random draw - a poor-man's "prompt-seeded" workflow with no extra machinery.

    And in batch pipelines, it's the glue that lets you dedupe: generate a hash per prompt, skip any output whose hash you've already processed. Content-addressed caching in twenty lines of graph.

    Installing it

    Standard pack install - ComfyUI Manager (search "eden"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/edenartlab/eden_comfy_pipelines.git
    cd eden_comfy_pipelines
    pip install -r requirements.txt
    

    Restart ComfyUI. Pure Python hashing - no models, no keys, no GPU, nothing to download. Five seconds to install, and it'll save you from typing "v2_final_actual_REAL.png" ever again.

    CategoryEden 🌱/general

    Inputs (2)

    NameTypeDefaultDescription
    input_stringSTRING
    hash_lengthINT84–64

    Outputs (2)

    NameTypeDescription
    hash_intINT
    hash_stringSTRING