Next Video Filename Ovum
Know VHS VideoCombine's next filename before it saves — no file guessing
- Filename
Next Video Filename is a small fortune-teller for anyone using Video Helper Suite (VHS). It computes the exact auto-numbered output path that VHS_VideoCombine is about to use - without writing a single file - so you can plan downstream file operations deterministically instead of guessing.
The use case that makes this node shine: cleanup. VHS often renders a batch as a pile of intermediate PNG frames before muxing them into an MP4. If you know the output path in advance, you can wire it into the pack's VhsPngDeletingOvum (which strips .png entries from a filename list and deletes them from disk) or into OpenOutputViaShell so the finished video pops open the moment it lands. You're composing a deterministic file pipeline instead of hoping the naming lines up. The author built this pack around exactly these kinds of "I just couldn't live without it" conveniences.
How it works
The logic mirrors VideoCombine's own counter. Given a filename_prefix, it resolves the output folder with folder_paths.get_save_image_path (the same call ComfyUI's savers use), lists the files there, and matches anything shaped like prefix_NNNNN.<ext> - the regex is {filename}_(\d+)\D*\..+ - tracking the highest counter. The answer is that counter plus one, zero-padded to five digits, joined to the full output folder. If you supply a filename_extension, it's appended; otherwise you get the bare base path. It does create the output folder if it doesn't exist (via os.makedirs), so that's the one visible side effect.
The inputs and outputs that matter
- filename_prefix (required, STRING, default
"AnimateDiff") - the same prefix you'd give VHS VideoCombine. Match them exactly or the prediction is wrong. - filename_extension (optional, STRING, default empty) - e.g.
mp4orwebm, if you want the extension included in the output. - Filename (output, STRING) - the full predicted path, like
C:\ComfyUI\output\AnimateDiff_00042.mp4.
Installing it
Ships in comfy-ovum (sfinktah). Via ComfyUI Manager, search "comfy-ovum" and install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart ComfyUI either way. No models to download. Note this node predicts VHS behavior but doesn't bundle VHS itself - you still need Video Helper Suite installed separately for the video side of things.
Common issues
The prediction assumes VHS's save_output is on, so if you've disabled that, the real file never appears. And the counter logic is VHS's own - if other files with the same prefix already exist (or something else creates files mid-run), the prediction can be off by one; it's a peek at the folder state, not a reservation. One genuinely surprising note: a prefix like AnimateDiff will also match AnimateDiff_00001 from other extensions, which is exactly right for VHS but worth knowing if you share a prefix across video and image saves.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| filename_prefix | STRING | AnimateDiff | — |
| filename_extensionopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Filename | STRING | — |