VHS PNG deleter
Clean up the frame dump after Video Helper Suite renders
- filenames
- filenames
- first_filename
If you've ever generated a video with Video Helper Suite (VHS), you know the mess: the sampler writes out hundreds of PNG frames, VHS stitches them into an mp4, and your output folder is suddenly a graveyard of intermediate frames. VHS PNG deleter exists to clean that up - it takes the filename list from a VHS node, strips every .png out of it, and deletes those frames from disk, so you're left with just the assembled video.
It's from sfinktah's comfy-ovum pack, and it's one of the more thoughtfully-built nodes in there: it doesn't just blindly delete. It only removes PNGs, only when they're genuinely files, and - the important part - only when they live inside ComfyUI's output directory. Anything outside that boundary gets a "refusing to delete" log message instead. That's a nice safety rail for a node whose whole job is erasing files.
How it works
The node accepts a VHS_FILENAMES input - the same type some VHS nodes emit - in any of three shapes: a plain string, a list of paths, or a tuple like (True, [list of paths]) where the boolean flag is carried along untouched. For each entry it checks the extension (case-insensitive); if it's .png, it resolves the real path and verifies it exists, is a file, and sits under the output directory. Only then does it os.remove it. The .png entries are dropped from the returned list either way - deletion failures are logged and skipped, never fatal.
The tuple handling matters in real workflows: VHS filenames often arrive as (bool, [filenames]), and this node preserves that structure, so anything downstream expecting the same shape keeps working.
Inputs and output
filenames- required, typeVHS_FILENAMES. Wire it to a VHS node's filename output.- Output
filenames- typeVHS_FILENAMES, the filtered list (or tuple) with PNGs gone. - Output
first_filename- typeSTRING, the first remaining filename, handy for wiring into a preview or a path formatter.
Install
Manager: search comfy-ovum, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart. No model downloads. One note: this is a VHS_FILENAMES-typed node, so you need the Video Helper Suite pack installed and upstream for the input socket to connect naturally.
Where people get burned
The output-directory guard is the thing to know about: if your VHS node writes frames somewhere outside Comfy's configured output folder (say, a custom path), this node will silently refuse to delete them - you'll see warnings in the console, and the frames will still be filtered out of the list, so you might think cleanup happened when it didn't. Second gotcha: it deletes by extension only. If a non-frame PNG you care about shares that folder and made it into the filename list, it's a candidate for removal. For the standard VHS frame-dump flow it's exactly right; just know what the guard does.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| filenames | VHS_FILENAMES | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| filenames | VHS_FILENAMES | — |
| first_filename | STRING | — |