Nodes/comfyui-sequential-batcher/🎬 Video Analyzer Scene detector
ComfyUI Node

🎬 Video Analyzer Scene detector

Find the cuts, count the frames, grab the audio — in one node

By Meisoftcoltd·Created 7 months ago·Updated 18 days ago· 3
🎬 Video Analyzer Scene detector
    • video_path
    • total_frames
    • source_fps
    • source_audio
    • scene_cuts_list
    • reference_frame
    • log
    video
    reference_frame_idx0
    scene_threshold25.00
    current_loop_index0

    Before you can chunk a long video into GPU-sized loops, you need to know three things: how many frames it has, how many frames per second it runs at, and - if you want the cuts to land somewhere sensible - where the scene changes are. VideoAnalyzerSceneDetector is the pack's "explorer" node for exactly that. It scans an uploaded video, finds hard cuts, extracts the audio track, and hands you a reference frame, all in one pass.

    It's the scene-detection sibling of the pack's VideoAnalyzerFaceDetector. The face detector is the fancier one (it can hand face scanning off to a GPU YOLO model via the Impact Pack); this one is lighter - pure OpenCV, no model download, and it answers "where do the camera cuts land" instead of "where are the faces."

    How it works

    OpenCV reads the file frame by frame, downsizes each frame to 128×128, converts to grayscale, and compares it to the previous frame. When the mean absolute difference crosses scene_threshold, that frame index gets recorded as a cut. It's coarse but fast, and the source carefully caches the result per file - so in a loop workflow, only cycle 0 pays for the scan; later cycles pull total_frames, source_fps, and the cut list straight from a cache.

    Audio comes out standardized to 44.1kHz stereo, which is what the rest of the pack expects. If your source has audio above 44.1kHz or more than 2 channels, the node shells out to FFmpeg to remux a _std_audio.mp4 clone first - which is why FFmpeg is the pack's one hard system requirement.

    The inputs that matter

    • video - a dropdown of video files in your input folder, with an upload option. Same trick VHS_LoadVideo uses, so it feels familiar.
    • scene_threshold (FLOAT, default 25, range 5–150) - higher means fewer, stronger cuts; lower means it trips on subtle lighting shifts. Start at the default and nudge up if you're getting noise.
    • reference_frame_idx (INT, default 0) - which frame gets pulled out as the reference_frame image, for continuity/keyframing.

    What comes out

    • total_frames (INT) and source_fps (FLOAT) - feed these to an Auto Loop Calculator to plan the chunks.
    • scene_cuts_list (SCENE_CUTS) - the cut indices; plug into the calculator's optional scene_cuts_list port and it'll try to make each loop land on a scene boundary.
    • source_audio (AUDIO) - the clean track; route it straight to the stitcher's audio port per the pack's wiring guide.
    • reference_frame (IMAGE) and video_path (*) - the keyframe and the resolved file path.

    Gotchas

    It needs opencv-python (installed automatically with the pack) and FFmpeg. The 128×128 downscale is what keeps it fast, but it also means gentle transitions or slow zooms won't register as cuts - that's fine, scene detection here is about chunk boundaries, not film school. Also note the threshold is part of the cache key: change it and the node re-scans, which you want when you're tuning.

    Install

    ComfyUI Manager → "comfyui-sequential-batcher", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Meisoftcoltd/comfyui-sequential-batcher
    

    Restart, then make sure FFmpeg is on your PATH (sudo apt install ffmpeg on Ubuntu/WSL; add the bin folder on Windows). And per the README, skip --highvram when launching - the memory-management nodes this suite pairs with are blocked under it.

    Category🔁 Sequential Batcher/Video

    Inputs (4)

    NameTypeDefaultDescription
    videoCOMBO0 options:
    reference_frame_idxINT00–100000
    scene_thresholdFLOAT25.005–150
    current_loop_indexoptINT0

    Outputs (7)

    NameTypeDescription
    video_path*
    total_framesINT
    source_fpsFLOAT
    source_audioAUDIO
    scene_cuts_listSCENE_CUTS
    reference_frameIMAGE
    logSTRING