ComfyUI Node

Split Video

Split Video cuts on breaths, not timestamps — and it's a demucs-powered party trick

By z2661326707-sudo·Created 4 months ago·Updated 4 months ago· 1
Split Video
  • scene_list
  • VHS_FILENAMES
output_dir/tmp/ComfyUI/custom_nodes/output/scene_videos
filename_prefix
max_scene_len0.0
breath_threshold-40
min_silence_duration150
max_lookback2.0
min_segment_len2.0

Split Video is the second half of the ComfyUI-pyscenedetect pack and the part that's actually interesting. Feed it the SCENE_LIST from Scene Detect and it cuts the video at those boundaries with ffmpeg, producing one .mp4 clip per scene. That alone is useful. But its headline feature is intelligent sub-splitting: when a single scene runs too long, it re-splits it at speech pauses - breath points - so your dialogue clips don't land mid-word. It's the node you reach for when the footage is people talking: interviews, podcasts, lectures, voiceover, streamer highlights.

How the breath-point splitting works

The flow for any scene longer than max_scene_len:

  1. ffmpeg extracts that scene's audio to a temp WAV.
  2. demucs runs in --two-stems=vocals mode to strip background music and noise, leaving vocals only. This is the clever part: silence detection on raw audio is useless when there's a beat underneath, but on the vocal stem, gaps between sentences stand out.
  3. pydub's detect_silence finds quiet stretches in the vocal track.
  4. For each ideal cut position, the node looks back up to max_lookback seconds for the nearest silence and cuts there. No silence in the window? It force-cuts at the ideal position anyway.

Set max_scene_len to 0 and all of this disappears - you get exact scene-boundary splits, no audio analysis, no demucs. Worth remembering, because it's also the escape hatch for everything that makes this node heavy.

Inputs that matter

  • scene_list (required) - the SCENE_LIST output from Scene Detect. It carries the video path, FPS, and timecodes.
  • max_scene_len - maximum scene length in seconds before sub-splitting kicks in. 0 disables it. For dialogue, 10–30s is the sweet spot; start at 15.
  • breath_threshold - silence cutoff in dBFS, default -40.0. Lower (e.g. -50) counts quieter gaps as "breath"; higher only catches loud pauses.
  • min_silence_duration - how long a silence must last to count, in ms, default 150. Raise it if cuts feel twitchy.
  • max_lookback - seconds to search backward for a breath point, default 2.0.
  • min_segment_len - minimum clip length, default 2.0s. Short segments get merged into neighbors, so you don't get 0.8-second slivers.

output_dir and filename_prefix control where clips land and what they're called ({prefix}-Scene-001.mp4 …); the prefix defaults to the source video's name. The default output directory is an output/scene_videos folder relative to the pack - you'll probably want to set output_dir to something you can actually find.

Outputs

VHS_FILENAMES - the same list format VideoHelperSuite uses. Because the node declares OUTPUT_IS_LIST, ComfyUI automatically iterates any downstream node over every clip. That's the advertised integration: wire it into an OSS/cloud video uploader and each split clip gets uploaded on its own. It's a clean way to hand a big file to an uploader as many small pieces.

Where people get burned

  • No audio track + max_scene_len > 0 → hard error, because breath-point splitting needs audio to exist. Set max_scene_len = 0 to skip it entirely.
  • ffmpeg not on your PATH → the node refuses to run, and no amount of pip installs fixes that. Install ffmpeg (the README links it) and make sure it resolves from the terminal.
  • First run downloads a demucs model (~2GB per the README) and demucs itself pulls PyTorch in via requirements.txt. If your ComfyUI venv already has torch, pip usually reuses it, but this is a heavyweight install - expect a long first pip install, and a slow, CPU-hungry run if demucs ends up on CPU.
  • It's slow - demucs runs per long scene. A two-hour video with max_scene_len=15 will churn for a while. If you just want scene-accurate cuts, leave max_scene_len = 0 and it's nearly instant.

Installing

ComfyUI Manager → search ComfyUI-pyscenedetect, or:

cd ComfyUI/custom_nodes
git clone https://github.com/z2661326707-sudo/ComfyUI-pyscenedetect
cd ComfyUI-pyscenedetect
pip install -r requirements.txt

then restart ComfyUI. The requirements.txt pulls demucs, pydub, and scenedetect[opencv]; make sure ffmpeg is installed separately. The demucs model downloads on first use of the sub-split path, not at install time - so the first "real" run is the slow one. Honest take: the breath-point splitting is a genuinely thoughtful feature for dialogue work, but it's the whole reason this pack has the footprint it does. Knowing you can switch it off is half the battle.

CategoryVideo/SceneDetect

Inputs (8)

NameTypeDefaultDescription
scene_listSCENE_LIST
output_diroptSTRING/tmp/ComfyUI/custom_nodes/output/scene_videos
filename_prefixoptSTRING
max_scene_lenoptFLOAT0.00–600
breath_thresholdoptFLOAT-40-80–0
min_silence_durationoptINT15050–1000
max_lookbackoptFLOAT2.00.5–10
min_segment_lenoptFLOAT2.00.5–60

Outputs (1)

NameTypeDescription
VHS_FILENAMESVHS_FILENAMES