Nodes/ComfyUI-LogicUtils/UUID Generator
ComfyUI Node

UUID Generator

A unique random string for filenames and IDs

By aria1th·Created 3 years ago·Updated 7 months ago· 116
UUID Generator
    • STRING
    length36

    Spits out a unique random string every time it runs - a UUID, the classic f47ac10b-58cc-4372-a567-0e02b2c3d479-shaped identifier. When you need a name that's guaranteed not to collide with anything, this is the cleanest way to get one. No counter to manage, no timestamp collisions, just a fresh unique value on demand.

    The bread-and-butter use is filenames. If you're generating a lot of images, or your outputs land in a shared folder, or you're pushing files to storage where two files with the same name would clobber each other, a UUID prefix makes every filename unique with effectively zero chance of a clash. It's also useful as a per-run job ID you can thread through a graph and into a log or metadata field so you can trace a specific output back later.

    How it works

    It generates a UUID - a 128-bit random identifier with so much entropy that collisions are, for practical purposes, impossible - and returns it as a string. It's an output node, so it runs whenever you queue the workflow, producing a new value each execution.

    The input that matters

    • length (default 36, range 1–36) - how many characters of the UUID to return. A full standard UUID including its dashes is 36 characters, which is why that's both the default and the max. Turn it down if you want a shorter tag and can accept a bit less uniqueness - say 8 or 12 characters for a compact filename suffix where a tiny collision risk is fine.

    The output is a single STRING, ready to drop into a filename prefix, a save node, a metadata string, or anywhere a unique token helps.

    The one caveat

    Shortening trades away uniqueness. The whole point of a UUID is that the full thing basically never repeats; slice it down to a handful of characters and you're back in territory where two runs could produce the same value, especially across a big batch. For guaranteed-unique filenames, leave length near the max. Use the short form only for human-friendly tags where the odd collision won't hurt.

    Installing ComfyUI-LogicUtils

    ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aria1th/ComfyUI-LogicUtils
    

    Restart ComfyUI. No dependencies - UUID generation is in Python's standard library.

    Worth knowing

    The pack is aria1th's (AngelBottomless) undocumented collection of small helpers. Between this, the counter, and the timestamp node, the pack gives you three flavors of "make it unique": UUID for guaranteed no-collisions, timestamp for human-readable when, counter for a clean running sequence. For filenames that must never overwrite, the UUID at full length is the safest of the three.

    CategoryLogic Gates

    Inputs (1)

    NameTypeDefaultDescription
    lengthINT361–36

    Outputs (1)

    NameTypeDescription
    STRINGSTRING