Nodes/ComfyUI-Beyond_nodes/🦾 UUID with date
ComfyUI Node

🦾 UUID with date

Unique, dated filenames for people who batch a lot

By beyondprompting·Created 9 months ago·Updated 7 months ago· 0
🦾 UUID with date
    • filename_prefix
    prefix
    include_datetrue
    uuid_len32

    If you've ever batch-run a couple hundred generations and then spent ten minutes trying to figure out which output file came from which run, 🦾 UUID with date is for you. It generates a unique, timestamped filename prefix that you wire into any Save Image–style node, so every run's files get names that can't collide and sort nicely by date. It's a small quality-of-life win, but a real one.

    How it works

    Three inputs, all simple:

    • prefix - a plain string, optional. Whatever you type here goes in front.
    • include_date - a boolean, default on. Adds a YYYYMMDD_HHMMSS timestamp.
    • uuid_len - an integer from 8 to 32, default 32. Controls how many hex characters of the UUID you keep.

    The mechanism, straight from the source: it generates a uuid4().hex (32 hex characters, no dashes), truncates it to uuid_len, prepends the date stamp if enabled, then prepends your prefix. So you get something like:

    myrun_20260816_143022_9f3ab1c2d4e5...
    

    The single filename_prefix output (a STRING) plugs into any node with a filename_prefix input - Save Image, Save Animated WEBP, video frame savers, whatever. That's the whole integration: one wire.

    Why you'd reach for it

    ComfyUI's default filename behavior appends a counter, but that counter is shared across all save nodes and all workflows on your machine. "Find the file from the run that used prompt X" quickly becomes a guessing game. A per-run UUID makes each run's outputs self-identifying, and the date stamp means your output folder is time-sorted without you doing anything. It's also handy when something downstream needs a guaranteed-unique name - an API loop, a batch script that ingests files, or any workflow where overwriting is the thing you're trying to avoid.

    The honest catches

    It generates a new value on every single execution. That's the point, but it has consequences: the node can never cache, and Save Image will write a fresh file every run even if nothing else changed. Your output folder grows without mercy. If you re-run the same workflow fifty times, you get fifty files, not fifty overwrites.

    And a warning about the truncated length: the default is the full 32 hex chars, but if you drop uuid_len to the 8 minimum, you're down to 32 bits of entropy. Fine for casual filename uniqueness, not for anything you'd call collision-proof. Keep the prefix too - a bare hex string is cryptic, and the prefix is what makes files recognizable in a file manager.

    There's also a pack-level quirk worth knowing: this node's class name is just UUID - no -beyond_nodes suffix, unlike nearly every other node in the pack. ComfyUI resolves duplicate class names by whichever pack loads last, so if another pack ever registers its own UUID node, one of them silently wins. It's a latent collision, not a live one, but it's why the other nodes bothered with suffixes.

    Installation

    Same pack, same one-time install:

    • ComfyUI Manager - search "ComfyUI-Beyond_nodes" (or "Beyond Nodes"), install.
    • Or manually:
      cd ComfyUI/custom_nodes
      git clone https://github.com/beyondprompting/ComfyUI-Beyond_nodes
      
      Restart after. No requirements.txt, no model downloads - it uses Python's stdlib uuid and datetime, nothing else.

    Common issues

    • "Save Image makes a new file every run." That's the design, not a bug. Every execution produces a fresh UUID by intent.
    • "I wanted a stable name that overwrites." Wrong tool. Use a fixed filename or a plain String node for that - UUID is the opposite philosophy.
    • "The filename prefix got rejected." Some consumer nodes expect a folder path or have their own naming rules. Check what the save node wants; the output here is a plain string, so if it complains, it's the consumer, not this node.

    For a pack that's mostly about compositing and logic, this is the quiet utility that earns its place. One wire and your batch runs stop eating each other's filenames.

    Categoryutils

    Inputs (3)

    NameTypeDefaultDescription
    prefixSTRING
    include_dateBOOLEANtrue
    uuid_lenINT328–32

    Outputs (1)

    NameTypeDescription
    filename_prefixSTRING