Nodes/ComfyUI-QuasimondoNodes/Video Queue Manager
ComfyUI Node

Video Queue Manager

Process every frame of every video in a folder, unattended

By Quasimondo·Created 2 years ago·Updated about a year ago· 15
Video Queue Manager
    • full_path
    • filename
    • current_frame
    • current_frame_string
    • total_frames
    index0
    path
    batch_size1
    string_decimals4

    The video sibling of Folder Queue Manager, and the one that makes genuinely large batch video work possible in ComfyUI. Video Queue Manager scans a folder of video files, walks them frame by frame (or in batches) using a single global index, and tells you which file and which frame you're on. Pair it with auto-queue and an incrementing index, and one workflow can chew through every frame of every video in a folder while you're doing literally anything else.

    It's a bridge node for the plumbing layer: it doesn't touch pixels, it converts an ever-increasing index into "current file + current frame," and lets the rest of your graph load exactly that frame, process it, and save it out. The batch video-processing use case - process each frame through an upscaler, an interpolation model, a filter - is exactly what this enables.

    How it works

    On each execution it lists the files in path, sorts them naturally (numeric-aware, so clip2 sorts before clip10), and filters to video suffixes (mp4, avi, mov, wmv, gif, webm, flv, mkv, mpg, avchd). For each video it opens it with OpenCV (cv2.VideoCapture) just long enough to read the total frame count, then works out which video and which frame your global index lands on.

    The batch_size input changes the unit of indexing: with batch_size 1, index counts single frames; with batch_size 10, each index value refers to a starting frame of a 10-frame batch. So a folder with two 100-frame videos gives you indices 0–99 in the first and 100–199 in the second (single-frame mode) - the node tracks boundaries across files automatically.

    Outputs tell your graph everything it needs to build a filename and load the right frame:

    • full_path - path to the current video.
    • filename - just the file name.
    • current_frame - the frame index (or batch start) within this video.
    • current_frame_string - the same, zero-padded to string_decimals digits (default 4) for tidy filenames.
    • total_frames - total frame count of the current video.

    When index exceeds everything available, it returns empty strings and -1 for the frame numbers - a clean "done" signal.

    The inputs that matter

    • index - the global position. Drive it with auto-queue plus control_after_generate: increment on the widget.
    • path - the folder of videos.
    • batch_size - frames per index step (default 1).
    • string_decimals - zero-padding width for current_frame_string (default 4).

    Install

    From the Quasimondo pack. ComfyUI Manager → search ComfyUI-QuasimondoNodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Quasimondo/ComfyUI-QuasimondoNodes
    cd ComfyUI-QuasimondoNodes
    pip install -r requirements.txt
    

    This node does use OpenCV (for VideoCapture frame counts), so the pack's opencv-contrib-python dependency matters here - and your environment needs the right codecs to open the video formats you feed it. No model downloads.

    Where people get burned

    Same trap as its folder sibling: forget control_after_generate: increment on index and auto-queue just re-processes frame 0 forever. The increment widget is the whole mechanism.

    Second, "can't open" videos are handled by printing to the console and skipping - so a corrupt or codec-less file silently vanishes from the queue rather than failing loudly. If your run seems to skip files, check the console output. And note that index counts across all videos as one sequence: if you add or remove a video mid-run, every later index shifts. Finish a batch, then change the folder contents.

    One more: current_frame is a starting frame when batch_size > 1 - you'll want to load batch_size frames from that offset, and total_frames tells you when you're near the end of a file. It's a queue manager, not a loader; the frame-loading is on your graph.

    Categoryqueue

    Inputs (4)

    NameTypeDefaultDescription
    indexINT00–9007199254740991
    pathSTRING
    batch_sizeINT1
    string_decimalsINT40–16

    Outputs (5)

    NameTypeDescription
    full_pathSTRING
    filenameSTRING
    current_frameINT
    current_frame_stringSTRING
    total_framesINT