FolderBatch Video Queue
Work through a folder of videos one clip at a time — without rebuilding the graph
- video_path
- file_name
- video_count
Video work in ComfyUI is where batch tooling stops being a luxury and becomes the whole job. You don't process one clip and call it done - you've got a folder of source footage to upscale, a batch of clips to run through frame interpolation, or a stack of renders to convert. FolderBatch Video Queue is the iterator for exactly that: it scans a folder for videos, hands you one video_path per execution, and auto-advances through the list so your graph runs once and then just... keeps going.
It works identically to its image sibling, and that's a feature. On first run it globs the folder, sorts the results, and caches the list. Each execution returns the clip at start_at. The frontend then bumps start_at and, with auto_queue on, queues the next prompt - land on the final clip and it resets to zero. Run, advance, re-queue, repeat, until the folder's done.
Inputs that matter: folder takes an absolute path (paste it; there's no picker). extension defaults to *.mp4 and takes glob patterns - separate several with semicolons if you have mixed containers. start_at is your resume point. sort_by (Name / Date / Random) with order_by (A-Z / Z-A) controls the order, and Date is your friend for "process newest first." The video_count and progress optional inputs are UI display only, updated by the node's own frontend.
Outputs: video_path (full path of the current file), file_name (base name without extension - ideal for deriving output filenames), and video_count (total matches). The canonical wiring is video_path into FolderBatch Load Video Frames, whose images batch then feeds whatever per-frame processing you're doing.
Installing is the pack-level story, so it's short: ComfyUI Manager, search "ComfyUI-FolderBatch", restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/aiai-r/ComfyUI-FolderBatch
No model downloads, no extra Python deps declared - the pack leans on PyAV, which ComfyUI already ships.
The gotchas are the queue-family ones. The file list is cached per node instance keyed on folder + extension + sort order, so clips added mid-run won't appear until the cache resets. auto_queue requires the web UI - it's literally the frontend calling queuePrompt(), so pure API/headless runs won't self-advance unless you drive start_at. And if the folder's empty you get an empty string and a zero count rather than a crash. One video-specific note: this node only hands you paths; the actual frame decoding happens downstream in the loader, so a long clip's memory cost lands there, not here.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | — | |
| extension | STRING | *.mp4 | — |
| start_at | INT | 0 | — |
| auto_queue | BOOLEAN | true | — |
| sort_by | COMBO | Name | 3 options: Name, Date, Random |
| order_by | COMBO | A-Z | 2 options: A-Z, Z-A |
| video_countopt | INT | 0 | — |
| progressopt | FLOAT | 0.0000–1 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |
| file_name | STRING | — |
| video_count | INT | — |