Video Scene Detect π¬
Find the hard cuts before you feed footage to an I2V model
- images
- cut_frame_indices
- cut_timestamps
- scene_count
- report
Raw footage almost never arrives as one clean shot. It's cuts: scene A, hard cut, scene B, hard cut, scene C. And if you're about to feed that footage into an image-to-video pipeline, the cuts are a problem - an I2V model will happily treat a hard cut as motion and produce warping or mush where the cut lands. The Video Scene Detect node from TensorVizion/OmniNodes finds those boundaries for you, before you commit the footage to a per-scene processing pass.
The mechanism is old-school frame differencing: for each frame, it computes a mean absolute pixel difference against the previous frame (downsampled first, so it's fast), and flags a cut wherever that score exceeds a threshold. The min_scene_frames guard suppresses cuts that would create a scene shorter than N frames - the classic defense against false positives from motion blur or a flash frame. Nothing fancy, but hard cuts are exactly what this is for.
Inputs and outputs
Four inputs:
images- the frame batch.fps(default 24) - needed to convert frame indices into timestamps.threshold(0.01β1, default 0.15) - how big a difference counts as a cut. Lower = more cuts (and more false positives); higher = only obvious cuts.min_scene_frames(default 6) - the minimum scene length in frames; suppresses cuts that would make a too-short scene.downsample(4β256, default 32) - how much each frame is shrunk before differencing. Higher = faster but less sensitive.
Outputs are the report: cut_frame_indices (a comma-separated string of frame indices where a new scene starts - frame 0 is always included), cut_timestamps (the same, in seconds), scene_count (an INT - the number of detected scenes), and report (a formatted summary string).
Install
Part of OmniNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Or ComfyUI Manager β OmniNodes β restart. Pure PyTorch/NumPy, no extra dependencies. Under TensorVizion/Video.
Troubleshooting
- Too many cuts - the threshold is too low (or motion blur is tripping it). Raise
thresholdand/or raisemin_scene_frames. - Missing obvious cuts - threshold too high, or the
downsampleis so aggressive that a subtle scene change gets averaged away. Lower it. - Timestamps look off - check
fpsmatches the source. A wrong FPS shifts every timestamp; frame indices are always exact. - Node missing - restart ComfyUI and check the
[OmniNodes]terminal log.
Reach for it at the front of a video-pipeline: detect the scenes, cut them into segments (the pack's Video Trim / Extract is the natural partner), process each as its own consistent shot, then re-join with Video Concat / Splice. Hard cuts in, clean per-scene generation out.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| fps | FLOAT | 24.01β240 | β |
| threshold | FLOAT | 0.150.01β1 | β |
| min_scene_frames | INT | 61β1000 | β |
| downsample | INT | 324β256 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| cut_frame_indices | STRING | β |
| cut_timestamps | STRING | β |
| scene_count | INT | β |
| report | STRING | β |