Delete Folder (Any Input)
The delete node that comes with a safety check (read this first)
- any_input
- success
- message
Somewhere between the video exporter and the memory cleaner, the kmlbdh/ComfyUI-kmlbdh-VideoCombine pack ships a node that deletes files. It's called Delete Folder (Any Input), and it's the most dangerous thing in the pack by a wide margin - so let's get the honest version up front: this is a node that removes files and folders from your input, output, or temp directories, and there is no confirmation dialog in ComfyUI. You click, it deletes.
That doesn't make it useless. In automation-heavy workflows it's genuinely handy - clearing temp before a long batch run, cleaning output so you don't ship yesterday's garbage with a shared workflow, freeing space after a render marathon. Just respect it.
How it works
You point it at one of ComfyUI's three standard folders via target_directory (output, input, or temp), and give it a path relative to that folder. Then two actions:
delete_path- removes the specific file or folder you named. Folders go viashutil.rmtree, so a whole tree disappears.clear_directory- empties everything in the chosen base folder. Note thepathfield is ignored here; it's a wipe-the-whole-dir button.
The one thing the author got right: there's a real safety check in the code. It resolves your path, takes an absolute path, and verifies via os.path.commonpath that you can't escape the base directory. Path traversal like .. gets bounced with an "Access denied" message instead of nuking your whole disk. That's the difference between "dangerous" and "terrifying", and I'd call it a reasonable boundary - it can't reach outside the three ComfyUI folders, which is exactly the blast radius you'd want for a node like this.
Inputs and outputs
The required inputs are the three you've seen: path, target_directory, action. There's also an optional any_input that accepts anything and does nothing with it - its whole job is to let you wire the node into a graph so it runs at a specific point without breaking a connection. The class even bypasses input validation entirely (VALIDATE_INPUTS just returns True), so it'll take whatever you hand it.
Outputs are success (BOOLEAN) and message (STRING). Wire message into a log or Text node if you want to see what it did; on a delete, the string will tell you exactly what went or didn't.
How to not regret installing it
Installation is the same as the rest of the pack: ComfyUI Manager → search "kmlbdh Video Combine (Smart + Tiled)", or clone https://github.com/kmlbdh/ComfyUI-kmlbdh-VideoCombine.git into ComfyUI/custom_nodes and restart. No requirements, no models.
Then use it like a power tool, not a toy:
- Start with
delete_path, notclear_directory. "Clear all of output" as a first experiment is how you lose a week of renders in one click. - Test on a folder you can afford to lose before pointing it at anything real.
- Gate it. Keep it bypassed/muted until your workflow is ready to actually clean, so a stray queue run doesn't wipe things mid-experiment. A delete node that fires while you're debugging is a delete node that fired by accident.
It's a tiny single-author pack with essentially no community footprint, so you're not getting a vetted ecosystem tool here - you're getting a pragmatic little utility with a sensible safety check. That's fine. Just read the action dropdown before you click, the same way you'd read a label before drinking.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| target_directory | COMBO | output | 3 options: output, input, temp |
| action | COMBO | delete_path | 2 options: delete_path, clear_directory |
| any_inputopt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| success | BOOLEAN | — |
| message | STRING | — |