feat: add timestamp to output filenames for cache-busting #12200
+140
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add
get_timestamp()andformat_output_filename()utilities tofolder_paths.pythat generate unique filenames with UTC timestamps. This eliminates the need for client-side cache-busting query parameters.Old format:
ComfyUI_00001_.pngNew format:
ComfyUI_00001_20260131-220945-123456_.pngChanges
get_timestamp()- returns UTC timestamp in formatYYYYMMDD-HHMMSS-ffffff(filesystem-safe)format_output_filename()- centralizes filename generation with counter and timestampnodes.py(SaveImage, SaveLatent, SaveImageWebsocket)comfy_api/latest/_ui.py(UILatent)comfy_extras/nodes_video.py(SaveWEBM, SaveAnimatedPNG, SaveAnimatedWEBP)comfy_extras/nodes_images.py(SaveSVG)comfy_extras/nodes_hunyuan3d.py(Save3D)comfy_extras/nodes_model_merging.py(SaveCheckpointSimple)comfy_extras/nodes_lora_extract.py(LoraSave)comfy_extras/nodes_train.py(SaveEmbedding)tests-unit/folder_paths_test/output_filename_test.pyRelated
Companion frontend PR: Comfy-Org/ComfyUI_frontend#TBD (removes client-side cache-busting)