Nodes/ComfyUI Video BC/Video Sequence Processor
ComfyUI Node

Video Sequence Processor

Turn a folder of videos into frames (and audio) for img2vid

By JioJe·Created about a year ago·Updated 5 months ago· 14
Video Sequence Processor
    • frames
    • current_index
    • total_videos
    • filename_text
    • audio
    • frame_count
    directory/tmp/ComfyUI/input
    modesingle_video
    video_index0
    frames_per_video8
    custom_width0
    custom_height0
    target_fps30

    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 number video_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 returns float("NaN") from IS_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:

    1. The default frames_per_video of 8 with target_fps 30 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? Set frames_per_video to 16 (or 60 at 30fps). Set it to 0 to read the entire video at target_fps. This is the #1 "why is my clip three frames long" trap.
    2. The audio output usually comes back empty. It's extracted with PyAV, and av is not in the pack's requirements - so unless you've run pip install av yourself, 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.
    3. next_video state 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.

    CategoryBC/Video

    Inputs (7)

    NameTypeDefaultDescription
    directorySTRING/tmp/ComfyUI/input
    modeCOMBOsingle_video3 options: single_video, next_video, random_video
    video_indexINT00–9999999
    frames_per_videoINT80–9999999
    custom_widthINT00–8192
    custom_heightINT00–8192
    target_fpsINT301–60

    Outputs (6)

    NameTypeDescription
    framesIMAGE
    current_indexINT
    total_videosINT
    filename_textSTRING
    audioAUDIO
    frame_countINT