Video Sequence Processor
Turn a folder of videos into frames (and audio) for img2vid
- frames
- current_index
- total_videos
- filename_text
- audio
- frame_count
The heavyweight of this pack. Where the text nodes manage batches of prompts, Video Sequence Processor manages batches of videos: point it at a folder and it pulls frames out as an IMAGE batch ready for a vid2vid or img2vid workflow, plus the source audio when it can get it, plus a few bookkeeping outputs so you know exactly what you're looking at.
On the first run (or whenever the directory changes) it scans the folder once and caches a sorted list of video files - mp4, avi, mov, mkv, webm. Then per run it picks a video and reads frames, resampled to target_fps from the source's native rate. custom_width/custom_height resize the output (0 = keep native, and the widgets step by 8, as ComfyUI's latent-friendly resolutions do). It returns a standard IMAGE tensor - RGB, 0–1 float - which is exactly what a sampler or an image-to-video model expects to eat.
The mode dropdown is where the "processor" in the name lives:
single_video- always video numbervideo_index, clamped to the last one if you overshoot.next_video- walks forward through the folder one video per run, wrapping around. Under the hood this returnsfloat("NaN")fromIS_CHANGED, the ComfyUI idiom for "always rerun me" - so it fires every queue, which is what you want for batch-rendering a folder. It's also a cache-buster: it forces re-execution of everything downstream of it, so don't leave it in a workflow that's otherwise cached.random_video- random pick per run.
Gotchas, from reading the code rather than trusting the README:
- The default
frames_per_videoof 8 withtarget_fps30 gives you only the first ~0.27 seconds. The node samples at target_fps cadence and stops at the frame cap. Want a full 2-second clip at 8fps? Setframes_per_videoto 16 (or 60 at 30fps). Set it to0to read the entire video attarget_fps. This is the #1 "why is my clip three frames long" trap. - The
audiooutput usually comes back empty. It's extracted with PyAV, andavis not in the pack's requirements - so unless you've runpip install avyourself, the node quietly prints "Audio extraction failed" in the console and returns None. Harmless for frame work; a real gap if you were counting on the soundtrack. next_videostate is shared across every instance of the node. The index counter is class-level, not per-node, so two of these in one graph advance each other's position and it gets confusing fast. Keep one per workflow.
Outputs: frames (IMAGE), current_index (INT), total_videos (INT), filename_text (STRING), audio (AUDIO), frame_count (INT). Wire filename_text and the counters into your filename or note nodes and a folder of videos becomes a self-labeling batch render.
Install: ComfyUI Manager → search "ComfyUI Video BC", or cd ComfyUI/custom_nodes && git clone https://github.com/JioJe/comfyui_video_BC and restart. The real dependency here is opencv-python (video reading), which Manager installs from the pack's requirements automatically; add av by hand only if you want the audio path. No model files to download.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | /tmp/ComfyUI/input | — |
| mode | COMBO | single_video | 3 options: single_video, next_video, random_video |
| video_index | INT | 00–9999999 | — |
| frames_per_video | INT | 80–9999999 | — |
| custom_width | INT | 00–8192 | — |
| custom_height | INT | 00–8192 | — |
| target_fps | INT | 301–60 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| frames | IMAGE | — |
| current_index | INT | — |
| total_videos | INT | — |
| filename_text | STRING | — |
| audio | AUDIO | — |
| frame_count | INT | — |