Nodes/OmniNodes/Video Scene Detect 🎬
ComfyUI Node

Video Scene Detect 🎬

Find the hard cuts before you feed footage to an I2V model

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Video Scene Detect 🎬
  • images
  • cut_frame_indices
  • cut_timestamps
  • scene_count
  • report
β—„fps24.0β–Ί
β—„threshold0.15β–Ί
β—„min_scene_frames6β–Ί
β—„downsample32β–Ί

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 threshold and/or raise min_scene_frames.
  • Missing obvious cuts - threshold too high, or the downsample is so aggressive that a subtle scene change gets averaged away. Lower it.
  • Timestamps look off - check fps matches 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.

CategoryTensorVizion/Video

Inputs (5)

NameTypeDefaultDescription
imagesIMAGEβ€”
fpsFLOAT24.01–240β€”
thresholdFLOAT0.150.01–1β€”
min_scene_framesINT61–1000β€”
downsampleINT324–256β€”

Outputs (4)

NameTypeDescription
cut_frame_indicesSTRINGβ€”
cut_timestampsSTRINGβ€”
scene_countINTβ€”
reportSTRINGβ€”