Time String Generator (Image Saver)
Sharing a Fresh Timestamp
- STRING
A node that just returns the current time sounds like filler. It stops being filler the moment you run a workflow with two or three ComfyUI Image Saver output nodes in it - save the base image here, the upscaled pass there, a variant somewhere else - and you want every file from one queue run to carry the same timestamp so they're obviously a set. Type %time into each filename pattern and every saver stamps itself independently. Do that long enough and one of them eventually catches a second boundary and you get ...183350 next to ...183351. Mildly maddening, and this node exists so you don't have to care.
The reason people run Image Saver nodes at all is worth a sentence of context: ComfyUI's default SaveImage writes the workflow into the PNG but not the flat, A1111-style parameters string that Civitai's uploader keys on for auto-detecting your model and LoRAs. This pack writes both, with resource hashes - it's the "post to Civitai and have your resources link themselves" swap. Its savers accept a label input (a plain string, separate from the metadata's custom field) that you can interpolate into filenames as %label. Time String Generator is what feeds that label one shared, always-fresh value.
How it works
The node has exactly one input, time_format - a Python strftime format string, default %Y-%m-%d-%H%M%S (renders as 2026-09-07-183351). It outputs a single STRING with the current timestamp. That's the whole interface; the magic is in the timing.
ComfyUI caches aggressively and only re-runs nodes whose inputs look changed. To opt out, a node implements IS_CHANGED, and the author does the classic trick: return float("NaN"). NaN is never equal to anything, not even itself, so the cache comparison always fails and the node re-executes on every queue run, calling datetime.now() at execution time. That's the entire difference between this and a plain String Literal: a literal is cached, so it evaluates once and then feeds every later run the same frozen timestamp. If you want "now," not "the moment you first queued it," you need the always-dirty variant.
Using it
Wire the STRING output into the label input of each of your Image Saver / Image Saver Simple nodes, and put %label somewhere in their filename patterns. One source, N savers, identical stamp per run.
A couple of things that bite:
- It always re-runs, and so does anything downstream of it. Here the downstream is saver nodes - output nodes that run every time anyway - so it's free in practice. The footgun would be wiring this into the middle of a heavy graph, where an always-dirty node defeats the cache for everything behind it and your workflow quietly slows down.
- It's the Python strftime dialect, not the built-in SaveImage template. Built-in
SaveImageuses%date:%Y%m%d%H%M%S%-style tokens; this node uses raw Python codes like%Y-%m-%d-%H%M%S. Same symbols at a glance, different parser. - A bad code won't necessarily error. On Linux, an unknown code like
%Qjust passes through literally, so a filename carrying a stray%Qmeans you typo'd the format rather than that strftime broke. - It stamps per execution, not per image. Two separate queue runs a second apart get different strings. That's the point, but don't rely on it as a stable ID across runs.
Installing it
It ships inside ComfyUI Image Saver, so you install the pack, not the node. The lightest way is ComfyUI Manager: search "ComfyUI Image Saver" and install. Without Manager:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
Then restart ComfyUI. The only Python dependency is piexif (for JPEG/WebP EXIF metadata), so there's nothing heavy and no model files to download. The node shows up under ImageSaver/utils in the node menu.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| time_format | STRING | %Y-%m-%d-%H%M%S | strftime format string |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | current timestamp (STRING) |