Nodes/ComfyUI_Fill-Nodes/FL Video Cut Detector
ComfyUI Node

FL Video Cut Detector

FL_VideoCut — detect scene cuts and split a clip into separate MP4s

By filliptm·Created 3 years ago·Updated about 22 hours ago· 630
FL Video Cut Detector
  • images
  • video_paths
  • output_folder
output_folder./output/scene_cuts
fps24
threshold30.0
min_scene_length12
output_quality85
detection_methodhybrid
max_workers4
downsample_detectiontrue
use_gpu_accelerationtrue

Got a long video that's really several shots strung together, and you want each shot as its own file? FL_VideoCut watches a sequence of frames, finds the points where the picture changes enough to count as a scene cut, and writes each detected scene out as a separate MP4. It's automatic shot detection plus splitting, in one node.

This is the useful inverse of everything else in the video-editing corner. Other nodes join and crossfade clips together; this one takes a stitched-together clip apart. Handy when you've generated or imported a montage and want to grab individual scenes, or when you're building a dataset and need each shot isolated.

How it works

It compares consecutive frames looking for big jumps. You pick the detection method: intensity (overall brightness change), histogram (color-distribution change), or hybrid (both, and the default). When the difference between two frames crosses your threshold, that's a cut. It then hands off to FFmpeg - running several encodes in parallel - to write each scene to disk, piping frames straight through for speed.

The inputs and outputs

  • images - the frame batch to analyze.
  • threshold (1–100, default 30) - sensitivity. Lower = more sensitive = more cuts detected. This is the knob you'll actually tune.
  • min_scene_length (default 12 frames) - ignore scenes shorter than this, so a single flickery frame doesn't spawn its own file.
  • detection_method - intensity, histogram, or hybrid.
  • fps - frame rate for the output MP4s.
  • output_folder - where the split files land (default ./output/scene_cuts).
  • output_quality, max_workers, downsample_detection, use_gpu_acceleration - encode quality and performance tuning.

Outputs: video_paths (the paths to the files it wrote) and output_folder (where they went).

How to install it

Part of filliptm's Fill-Nodes pack. ComfyUI Manager → search ComfyUI_Fill-Nodes → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
pip install -r ComfyUI_Fill-Nodes/requirements.txt

It shells out to FFmpeg for the encoding, so you need FFmpeg installed and on your PATH. Most ComfyUI setups already have it (plenty of video nodes need it), but if the split step errors, that's the first thing to check.

Common issues & troubleshooting

Too many cuts, or not enough. This is entirely a threshold game and it's content-dependent. A high-motion clip trips intensity detection constantly, so raise the threshold; a subtle documentary-style edit needs it lowered. Try histogram if intensity is fooled by lighting flicker, or hybrid to split the difference. Expect a couple of trial runs to dial it in.

Files aren't where I expected. The MP4s go to output_folder, which is relative to ComfyUI's working directory unless you give an absolute path. On a hosted or headless runner, that folder lives on the server, not your local machine - the video_paths output tells you exactly where they landed.

The split step fails. Almost always FFmpeg - missing, or not on PATH. Confirm ffmpeg -version works in the same environment ComfyUI runs in.

A hard cut got missed. If two shots happen to have similar brightness and color, even hybrid can miss the boundary. There's no perfect threshold for mixed content; for anything you care about, treat the auto-detection as a first pass and spot-check the results.

Category🏵️Fill Nodes/Video

Inputs (10)

NameTypeDefaultDescription
imagesIMAGE
output_folderSTRING./output/scene_cuts
fpsINT241–120
thresholdFLOAT30.01–100
min_scene_lengthINT122–1000
output_qualityINT851–100
detection_methodCOMBOhybrid3 options: intensity, histogram, hybrid
max_workersINT41–16
downsample_detectionBOOLEANtrue
use_gpu_accelerationBOOLEANtrue

Outputs (2)

NameTypeDescription
video_pathsSTRING
output_folderSTRING