Skip to content

Conversation

@christian-byrne
Copy link
Contributor

Summary

Add get_timestamp() and format_output_filename() utilities to folder_paths.py that generate unique filenames with UTC timestamps. This eliminates the need for client-side cache-busting query parameters.

Old format: ComfyUI_00001_.png
New format: ComfyUI_00001_20260131-220945-123456_.png

Changes

  • Added get_timestamp() - returns UTC timestamp in format YYYYMMDD-HHMMSS-ffffff (filesystem-safe)
  • Added format_output_filename() - centralizes filename generation with counter and timestamp
  • Updated all save nodes to use the new format:
    • nodes.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)
  • Added unit tests in tests-unit/folder_paths_test/output_filename_test.py

Related

Companion frontend PR: Comfy-Org/ComfyUI_frontend#TBD (removes client-side cache-busting)

Add get_timestamp() and format_output_filename() utilities to folder_paths.py
that generate unique filenames with UTC timestamps. This eliminates the need
for client-side cache-busting query parameters.

New filename format: prefix_00001_20260131-220945-123456_.ext

Updated all save nodes to use the new format:
- nodes.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)

Amp-Thread-ID: https://ampcode.com/threads/T-019c17e5-1c0a-736f-970d-e411aae222fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants