Nodes/ComfyTV/Scene Detect
ComfyUI Node

Scene Detect

Cut Detection That Skips the NLE

By jtydhr88·Created 3 months ago·Updated about 15 hours ago· 725
Scene Detect
  • video
  • images
  • clips
force_run_token0
project_id
parent_output_id0
threshold0.40
min_gap_s1.0
outputframes
cut_modefast
selected_index1

If you've ever hand-cut a montage from raw footage, you know the pain this node removes. Scene Detect scans a video, finds every hard cut, and hands you two usable things: the keyframes and the cut clips. It's the auto-editor's opening move - the "watch 40 minutes of B-roll and mark the shots" chore - reduced to one stage under ComfyTV/Video, and it's a genuinely good advertisement for why people are building video pipelines inside ComfyUI in the first place.

The engine is straightforward content-difference detection: it compares consecutive frames and flags jumps above a threshold as cuts. Where it gets useful is the parameters you can use to steer it:

  • threshold (0.05–1, default 0.4) - how big a frame difference counts as a cut. Lower it and you catch fades and flash cuts; raise it and you skip the soft transitions.
  • min_gap_s (0–30, default 1) - the minimum gap between detected cuts, in seconds. This is your de-noiser: set it to skip the rapid-fire jump cuts in an action sequence if you only want real scene changes.
  • output - frames (default, a grid of keyframe images) or clips (actually cut video segments).
  • cut_mode - fast (default) or precise. Precise does exact-frame trimming on the cut segments; fast is, well, fast.

Both outputs fire: images (a COMFYTV_IMAGES batch of keyframes - the first frame plus one per detected cut) and clips (a COMFYTV_VIDEO - the footage split at each cut, ready for a Sequence stage to reassemble with transitions).

The workflow shape

The classic flow: run Scene Detect on your source → pick keyframes in the images grid (the selected_index field is the internal 1-indexed pick, driven by clicking a thumbnail) → feed the good shots into a Sequence/Compose stage. It pairs especially well with ComfyTV's Director console for shot-by-shot assembly. It's not magic - a dissolve isn't a cut, and with min_gap_s at 0 you'll get a dozen false positives from camera flashes - but as a first pass it's dramatically faster than scrubbing.

Install

Ships with ComfyTV:

cd ComfyUI/custom_nodes
git clone https://github.com/jtydhr88/ComfyTV

Restart ComfyUI and it's under ComfyTV → Video; or search "ComfyTV" in ComfyUI Manager. Desktop/macOS: clone into the running instance's absolute custom_nodes path (from the startup log) and do a full backend restart - and check for a nested ComfyTV/ComfyTV/ folder after cloning. Pure torch/numpy/ffmpeg work, no extra dependencies, no model files.

Troubleshooting

  • "Scene Detect: no cuts found - lower the threshold and try again." The node's own error and the fix is in the message. Slow pans and talking heads genuinely may produce no detected cut at 0.4; try 0.2.
  • Clips come out too long or short. cut_mode controls trim precision - switch to precise if your edits feel sloppy.
  • Fake cuts everywhere. Raise min_gap_s; flashes and quick camera moves get merged into the surrounding shot instead of spawning clips.
CategoryComfyTV/Video

Inputs (9)

NameTypeDefaultDescription
force_run_tokenINT00–2147483647Internal — bumped on Run to invalidate ComfyUI's input cache.
project_idSTRINGInternal — populated by the projectStore on the frontend.
parent_output_idINT00–2147483647Internal — lineage parent set by spawn handlers on the frontend.
thresholdFLOAT0.400.05–1
min_gap_sFLOAT1.00–30
outputCOMBOframes2 options: frames, clips
cut_modeCOMBOfast2 options: fast, precise
selected_indexINT11–999Internal — 1-indexed cell pick for image-batch stages. Driven by clicking a thumbnail in the node's output grid.
videooptCOMFYTV_VIDEO

Outputs (2)

NameTypeDescription
imagesCOMFYTV_IMAGES
clipsCOMFYTV_VIDEO