ComfyUI Node

Date Timestamp

Date Timestamp — stop overwriting your own outputs

By aesethtics·Created about a year ago·Updated about a year ago· 1
Date Timestamp
    • datetime_string
    pre_text
    include_yeartrue
    include_monthtrue
    include_daytrue
    include_hourfalse
    include_minutefalse
    include_secondfalse
    post_text
    separator-
    time_separator-

    Every ComfyUI user eventually has the same moment: you run a workflow, save the output, run it again with a tweak, and the second image silently clobbers the first because Save Image reused the filename. This node is the fix. It generates a date/time string at the moment the workflow runs, so you can bake a timestamp into every saved file and never overwrite anything again.

    It's from the ComfyUI Utilitools pack, and it's about as simple as a node can get: no required inputs at all, one STRING output called datetime_string. You wire that into the filename_prefix of a Save Image node, and your outputs start looking like 2026-08-16_flowers instead of flowers_00001_ (well, the latter's still there - but now it's unique per run, which is the point).

    What you actually set

    Everything is optional, which means the node is a big bag of toggles. The defaults give you YYYY-MM-DD - year, month, and day are on, time is off. The fields you'll actually touch:

    • include_year / include_month / include_day - the date part, on by default
    • include_hour / include_minute / include_second - the time part, off by default
    • pre_text / post_text - text glued onto the front and back of the string, so you can label runs without another text node
    • separator - what joins the date pieces (default -, so 2026-08-16)
    • time_separator - what joins the time pieces if you enable them

    Turn on hour/minute and you can distinguish two runs within the same day. That's the setting most people flip once and then never again.

    The mechanism, and the trap

    Internally it's datetime.now() with the parts assembled in order: date parts joined by separator, time parts joined by time_separator, then pre_text and post_text wrapped around the lot. If you somehow disable every component it falls back to the literal string "timestamp" so it still returns something rather than an empty string.

    The trap: the timestamp is stamped when the node executes, which is when you click Queue. A workflow saved last Tuesday but run today gets today's date - that's what you want for filenames, but if you were hoping for a "created on" date that survives sharing, this isn't it. Second, if you run a batch in one queue, the node executes once, so every image in that run shares the same prefix. For per-image uniqueness you'll still want ComfyUI's built-in counter to append. And one more: it's local time, so if you share workflows with someone in another timezone, the same run stamps differently - irrelevant for filenames, just don't treat it as UTC.

    Installing

    Search "Utilitools" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aesethtics/ComfyUI-Utilitools
    

    Restart, and it's under Utilitools → Workflow. No dependencies, no models, no requirements.txt - the whole pack is stdlib Python. This node in particular is one of the more genuinely useful things in it, and it's the first thing I'd grab from the pack if you save a lot of outputs.

    CategoryUtilitools/Workflow

    Inputs (10)

    NameTypeDefaultDescription
    pre_textoptSTRING
    include_yearoptBOOLEANtrue
    include_monthoptBOOLEANtrue
    include_dayoptBOOLEANtrue
    include_houroptBOOLEANfalse
    include_minuteoptBOOLEANfalse
    include_secondoptBOOLEANfalse
    post_textoptSTRING
    separatoroptSTRING-
    time_separatoroptSTRING-

    Outputs (1)

    NameTypeDescription
    datetime_stringSTRING