ComfyUI Node

Scene Detect

Scene Detect hands you every shot boundary

By z2661326707-sudo·Created 4 months ago·Updated 4 months ago· 1
Scene Detect
    • SCENE_LIST
    • TEXT
    video_path
    detectorContent
    threshold27.0
    min_scene_len1.0

    You've got a long video and you want clips - per-shot upscaling, a V2V pass, feeding each scene into a model, prepping footage for an uploader. Blindly slicing on time intervals is dumb: you'll cut mid-action and get clips that start in a blur. Scene Detect is the analysis half of the ComfyUI-pyscenedetect pack, and it exists to answer one question: where are the actual scene changes? Feed it a video, it hands you a list of every cut point. No ffmpeg, no model download, no GPU - it's pure frame analysis, so it's fast and free to run.

    How it works

    It's a thin wrapper around PySceneDetect, the standard Python scene-detection library. The node runs PySceneDetect's SceneManager over the video, counts frames against the file's FPS, and returns each detected scene with its start/end timecode.

    The dropdown gives you five algorithms, each a classic way of spotting a cut:

    • Content (default) - compares color differences between consecutive frames in HSV space. The reliable generalist; start here.
    • Adaptive - the same idea but the threshold rolls with a running average, so it handles footage where the look changes over time (gradual lighting shifts, slow zooms) better than a fixed bar.
    • Threshold - compares each frame's intensity against a background-derived threshold. Good for very controlled footage like screen recordings.
    • Histogram - compares color histograms between frames; more forgiving of motion within a shot.
    • Hash - perceptual hashes between frames. Fast, tolerant of small changes.

    For 90% of footage you'll never leave Content. The others exist because PySceneDetect ships them and some content types misbehave on the default.

    Inputs that matter

    • video_path - a local path or a remote URL. The pack's README promises URL support, so you can point it at a hosted file and let PySceneDetect pull it.
    • threshold - sensitivity, default 27.0. Lower = more eager to call something a cut (more scenes, including false ones); higher = only obvious cuts. This is the knob you'll actually turn.
    • min_scene_len - minimum scene length in seconds, default 1.0. This filters out flicker-level noise so a blinking light or a quick flash doesn't spawn a "scene."

    Outputs

    • SCENE_LIST - the internal dict: per-scene start/end timecodes, seconds, frame numbers, plus the video's FPS and duration. Wire this straight into Split Video, the pack's other node.
    • TEXT - a human-readable summary ("Detected 14 scenes … Scene 1: 00:00:00 → 00:00:03.2"). Stick a Preview Text node on it if you want to sanity-check before splitting.

    Where people get burned

    The common complaint with PySceneDetect-style tools is over-segmentation - it fires on small visual differences and chops footage into so many shots it destroys continuity. If you see that, raise threshold and min_scene_len; if you're under-splitting (two clearly different shots merged), lower the threshold. For variable lighting, switch to Adaptive before you start fighting the threshold. And note this node needs no audio track at all - that matters downstream, not here.

    Installing

    It comes from the ComfyUI-pyscenedetect pack (two nodes, this one plus Split Video). The easy route is ComfyUI Manager → search ComfyUI-pyscenedetect. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/z2661326707-sudo/ComfyUI-pyscenedetect
    cd ComfyUI-pyscenedetect
    pip install -r requirements.txt
    

    then restart ComfyUI. Note that this single pack installs scenedetect[opencv], pydub, and - the heavy one - demucs, which drags PyTorch along and downloads a model on first use. If you only ever run Scene Detect, that weight is sitting there unused, which is mildly annoying. The analysis node itself is otherwise dependency-light: no API keys, no services, just a well-tested library under a familiar node wrapper.

    CategoryVideo/SceneDetect

    Inputs (4)

    NameTypeDefaultDescription
    video_pathSTRING
    detectorCOMBOContent5 options: Content, Adaptive, Threshold, Histogram, Hash
    thresholdFLOAT27.00–100
    min_scene_lenFLOAT1.00–60

    Outputs (2)

    NameTypeDescription
    SCENE_LISTSCENE_LIST
    TEXTSTRING