Nodes/Story JSON Nodes/Collect Run Outputs
ComfyUI Node

Collect Run Outputs

Auto-archive every run into dated folders so you never lose a render

By stepan-bogatorjov·Created 5 months ago·Updated about a month ago· 0
Collect Run Outputs
  • trigger
  • folder_path
date_format%d.%m.%Y
index_padding3
dry_runfalse

CollectRunOutputs is the janitor node of the Story JSON Nodes pack (stepan-bogatorjov/comfy_scenes_json_node). It's an output node whose one job is to sweep everything loose out of ComfyUI's output/ directory and tuck it into a dated subfolder - output/28.08.2026 003/, say - so a multi-run story project doesn't end up as 200 loose files in one flat folder.

Here's why you want it: a single run of this pack's pipeline deposits scene videos, voiceover WAVs, a music file, the story JSON and a final final_00001.mp4 - all in output/. Run it a few times a day and output/ becomes a landfill where final_00001.mp4 means nothing. CollectRunOutputs runs at the end of the run and moves every loose item (files and subfolders like scenes/ or voiceover/) into <date> <NNN>/, so each finished story owns its own folder.

How it works

It stamps the current local date using date_format (default %d.%m.%Y), finds the next free NNN by scanning for existing <date> <NNN> folders, and moves everything that isn't one of those archive folders into the new one. Past run folders are never touched, so running it twice doesn't re-archive anything. It returns the folder it created, and it runs every execution by design (IS_CHANGED forces it), so it's safe to leave in the graph.

The inputs that matter

  • trigger - any socket, used only for execution order. The intended pattern: wire StoryFinalCompile's output_path into it, so the archive happens after the final cut exists.
  • date_format - a strftime pattern that becomes the folder prefix.
  • index_padding - 1–6 digits for the NNN counter (default 3).
  • dry_run - on, it prints exactly what it would move without touching anything. Turn this on for your first run.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/stepan-bogatorjov/comfy_scenes_json_node

Restart ComfyUI (or install via Manager under "Story JSON Nodes"). No extra dependencies.

Troubleshooting

The big one: it moves everything loose in output/. If you keep unrelated render files in output/ and don't want them archived, this node will happily sweep them up - that's by design, so scope your runs accordingly (and use dry_run the first time to see the list). The output is the archive folder path, a STRING you can display or log. And don't wire it before the compile node - it's the cleanup step, so it should run last in the chain, after every save node has written its files.

Categoryvideo

Inputs (4)

NameTypeDefaultDescription
trigger*
date_formatoptSTRING%d.%m.%Y
index_paddingoptINT31–6
dry_runoptBOOLEANfalse

Outputs (1)

NameTypeDescription
folder_pathSTRING