Folder Watcher ποΈ
Process the next file, every run
- next_file_path
- next_file_name
- remaining_count
- total_count
- summary
Drop files into a folder, run your workflow, pick up the next unprocessed one each time. That's Folder Watcher, and it's the cheapest queue system in ComfyUI - no database, no job server, just a folder plus a small JSON manifest that remembers what's been handled. It turns a ComfyUI install into a simple batch processor for "this folder keeps getting new images and I want each queue run to handle one of them."
How it works: point folder_path at a directory, and the node scans it for files matching extensions (comma-separated, png,jpg,jpeg,webp by default), sorted alphabetically for a stable order. It compares against a manifest - a JSON file listing processed filenames - and returns the first file not in it. The manifest lives at manifest_path if you set one, otherwise .tensorvizion_processed.json inside the folder itself. If nothing's left, it tells you.
The two modes are where the design gets interesting:
scan_and_return- find and return the next unprocessed file. Ifmark_processed_immediatelyisTrue(default), it's added to the manifest the moment it's returned.mark_only- don't scan at all; just record a specific filename (mark_filename) as processed.
That second mode exists so you can do the correct thing instead of the convenient thing. If downstream processing can fail - and in ComfyUI it absolutely can - marking a file processed the instant you read it means a failure silently skips it forever. The robust pattern: run with mark_processed_immediately=False, do your actual processing, and only then hit a second Folder Watcher call in mark_only mode to mark that file done after it succeeded. The README calls this pattern out explicitly, and it's the difference between a batch processor that's trustworthy and one that eats files.
Outputs: next_file_path, next_file_name, remaining_count, total_count, and a summary. Wire the path into a Load Image node (or a path-based loader) and you have a loop: each queue run grabs the next file, processes it, marks it, done.
It's worth noting what it isn't. The name says "watcher" but it doesn't watch - no background thread, no filesystem events, no auto-trigger. Each run just looks at the folder state at that moment. That's a feature (simple, predictable, no state to lose) but if you want "new file appears β workflow starts automatically," this isn't that node. Also, the folder path is just a string; there's no ComfyUI-managed browser, so give it an absolute path.
The one real dependency note is a pleasant one: unlike the rest of the pack's Web API category, this node uses only the Python standard library - no requests, no extra install. It's the safest node in that category from a "what did I just install" perspective.
Install
Part of OmniNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart ComfyUI, or install "OmniNodes" via ComfyUI Manager. No extra dependencies.
Troubleshooting
- "Folder not found" - the path isn't visible from ComfyUI's process. Use an absolute path.
- Files skipped without processing -
mark_processed_immediatelyisTrueand something downstream failed. Switch to the scan +mark_onlypattern above. - Order seems wrong - files are sorted alphabetically, not by modification time. Name files with zero-padded numbers (
frame_001,frame_002) for a meaningful order.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | β | |
| mode | COMBO | 2 options: scan_and_return, mark_only | |
| extensions | STRING | png,jpg,jpeg,webp | β |
| manifest_path | STRING | β | |
| mark_processed_immediately | BOOLEAN | true | β |
| mark_filenameopt | STRING | β |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| next_file_path | STRING | β |
| next_file_name | STRING | β |
| remaining_count | INT | β |
| total_count | INT | β |
| summary | STRING | β |