Nodes/MKRShift_Nodes/Scene Cut Detector
ComfyUI Node

Scene Cut Detector

Find every cut in a video and get the scene list as JSON

By criskb·Created 7 months ago·Updated 5 months ago· 0
Scene Cut Detector
  • video
  • cut_times_json
  • scene_ranges_json
  • scene_count
  • summary
threshold0.320
min_scene_length_sec0.35
fallback_fps12

If you've ever needed to work on just the good parts of a longer video - the shot that matches a reference, the scene you want to re-render - you've probably sat there scrubbing the timeline by eye. MKRSceneCutDetector automates the boring part: it finds where the scene changes happen in a video and hands you the cut list and scene ranges as JSON you can feed straight into the rest of the MKRShift media lane.

What it's for

It's the upstream of the pack's scene-based workflow. Its scene_ranges_json output plugs directly into MKRSelectSceneRange (pick scene #3 and get its start/end/duration) and into MKRProjectManifest (record the scenes in your project manifest). So the flow becomes: import a clip → detect cuts → pick a scene → do something with just that range. No manual timecodes.

How it works

Two paths. The good one uses ffmpeg's built-in scene-detection filter - select=gt(scene\,threshold) plus showinfo - which scores every frame for how much it differs from the last and reports frames above the threshold as cut points. It then filters out anything shorter than min_scene_length_sec so a flash-frame doesn't count as a scene. If ffmpeg isn't available, it falls back to decoding frames and doing a simple difference-based comparison at fallback_fps - a solid approximation, but coarser.

The threshold (default 0.32, range 0–1) is the sensitivity knob: lower catches more cuts (including subtle ones), higher ignores gradual changes. min_scene_length_sec (default 0.35) merges tiny scenes away. fallback_fps only matters on the no-ffmpeg path.

Outputs

  • cut_times_json - every cut time in seconds.
  • scene_ranges_json - the scene list as ranges (each with start/end), ready for the selector or the manifest.
  • scene_count - how many scenes you got, handy as a quick sanity check.
  • summary - human-readable recap plus any warnings.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

restart ComfyUI, or Manager → MKRShift_Nodes. For the real detection path, install ffmpeg (README step 3) - without it you get the frame-difference fallback, which is noticeably less precise.

Common issues

The threshold is the thing people fiddle with first and blame second. Too many phantom cuts? Raise it. Missing transitions? Lower it. Also remember min_scene_length_sec is your noise filter - if your "scene" count is inflated by flicker, bump it up. And on the no-ffmpeg path, fallback_fps caps how finely you can measure cut times, so a 12 fps fallback finds cuts to within ~83ms - fine for most work, wrong for frame-accurate editing.

CategoryMKRShift Nodes/Media/Analysis

Inputs (4)

NameTypeDefaultDescription
video*
thresholdFLOAT0.3200–1
min_scene_length_secFLOAT0.350–30
fallback_fpsINT121–240

Outputs (4)

NameTypeDescription
cut_times_jsonSTRING
scene_ranges_jsonSTRING
scene_countINT
summarySTRING