FolderCleaner🐶
Delete files by type between loop iterations
- any
- any
Run an agent loop enough times and your output/temp folder fills up with junk from every past iteration. FolderCleaner is the housekeeping node for that - point it at a folder, tell it what kind of file to delete, and it clears the folder out. It lives in this pack's "workflow" category alongside its batch/iterator nodes (json_iterator, json_writing), which is the tell for what it's actually for: clearing a working directory before or between runs of a loop, so old files don't get picked up by mistake on the next pass.
Read this before you run it: it deletes files, and there's no undo. Double-check folder_path before you execute the node, especially the first time - point it at the wrong folder and you've just deleted whatever was in it, not just your intended temp files.
How it works
It's a straightforward delete-by-extension operation, not a smart cleanup - you give it a folder and a category, it removes matching files from that folder.
The inputs and outputs that matter
folder_path- the folder to clean. No default, so you have to set this deliberately.file_type- what to delete:image,audio,video,all_files, orall. The schema doesn't spell out the exact difference betweenall_filesandall(subfolders included vs. not, is a reasonable guess but untested here) - if that distinction matters for your setup, test on a throwaway folder first rather than trusting it on data you care about.any(required, wildcard type) and the matchinganyoutput - this isn't real data flowing through the node, it's a pure ordering trigger. Wiring something intoanyand taking the same wildcard back out is how ComfyUI graphs force execution order between nodes that don't otherwise share data - it guaranteesFolderCleanerruns before whatever consumes its output, without needing a real dependency between them.is_enable- standard bypass toggle.
How to install it
Via ComfyUI Manager: search comfyui_LLM_party, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/heshengtao/comfyui_LLM_party.git
Then pip install -r requirements.txt from inside the pack folder using ComfyUI's own Python, and restart. No models or API keys needed for this specific node - it's pure filesystem plumbing.
Common issues & troubleshooting
It deleted more than you expected. Almost always a wrong folder_path or the wrong file_type choice (picking all when you meant one category). There's no recovery built into the node - if this is a real risk in your setup, point it at a dedicated scratch folder you never store anything valuable in, rather than a shared output directory.
Running on a hosted/cloud executor and the folder doesn't behave the way it does locally. The path has to exist on whatever filesystem the node actually executes on. On a cloud worker that filesystem is the container's own ephemeral storage, not your local machine - make sure folder_path points somewhere inside the run's own working area, not a path that only made sense on your desktop.
Nothing gets deleted at all. Check is_enable is actually on, and that folder_path doesn't have a typo or trailing slash mismatch that's silently pointing at an empty or nonexistent directory.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| any | * | — | |
| folder_path | STRING | — | |
| file_type | COMBO | image | 5 options: image, audio, video, all_files, all |
| is_enable | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | — |