Nodes/ComfyUI_OmniShotCut/OmniShotCut VideoSplitter
ComfyUI Node

OmniShotCut VideoSplitter

Cut the shot you actually want out of a detected video

By GG-A9·Created 3 months ago·Updated 3 months ago· 4
OmniShotCut VideoSplitter
  • video
  • video
shots_json
index0

OmniShotCutVideoSplitter is the payoff half of the pack. The Detector tells you where the shots are; this node cuts one of them out. You give it the original video, the shots_json from the Detector, and a number, and out comes a VIDEO that's just that one shot - no re-encode to a file, no guesswork about frame numbers.

This is the node that makes the whole pack a workflow instead of a report. Typical graph: load model → Detector → feed the same source video into the Splitter with shots_json in between → drop the trimmed clip on a save node (or feed it onward into your next pass). Want a different shot? Add a second Splitter with a different index. If you're cutting a generated video down to its one good take, or slicing an interview into usable bites, this is the whole ballgame.

How it works

Unlike the Detector, which defensively accepts videos in a dozen shapes, the Splitter is picky: it expects ComfyUI's native VIDEO object (VideoFromFile from ComfyUI's own video I/O). It reads the clip's real frame rate and frame count from that object, looks up your index in the pred_ranges array, converts the frame range to start_time/duration in seconds, and calls as_trimmed() to produce a new trimmed video object. The math handles the closed-interval thing correctly (an inclusive [start, end] range becomes end - start + 1 frames), and it clamps the index so you can't ask for shot #47 of a 3-shot video and get an error - you get the last real shot instead.

Inputs and outputs

  • video (VIDEO) - the source video, ideally the same object you fed the Detector. Use ComfyUI's native video input or another pack's VIDEO output. Don't hand it a raw path string - see below.
  • shots_json (STRING, forced input) - the shots_json output of OmniShotCutDetector. Same requirement as ShortCount: it must be wired, not typed.
  • index (INT, default 0, range 0–10000) - which shot to cut. 0 is the first detected shot.

Output: video (VIDEO) - the trimmed clip, ready to wire into a save/preview node.

Install

The pack's standard install, shared with the other nodes:

# ffmpeg must be installed system-wide first
# then, in ComfyUI/custom_nodes:
git clone https://github.com/GG-A9/ComfyUI_OmniShotCut
cd ComfyUI_OmniShotCut
pip install -r requirements.txt

And remember the checkpoint in checkpoints/OmniShotCut_ckpt.pth - without it the Detector upstream never runs, so there's no shots_json to split on. ComfyUI Manager works: search "ComfyUI_OmniShotCut".

Common issues

  • You get the whole video back, not a clip. That's this node's silent failure mode. If video isn't a native VIDEO object, or shots_json is empty of pred_ranges, or something else throws, the code catches it and returns the input video untouched. If your output is full-length, check the video input is a real VIDEO (not a string) and that the Detector's JSON has a non-empty pred_ranges.
  • "This node needs a newer ComfyUI." The Splitter imports comfy_api.latest._input_impl.video_types - it's built against ComfyUI's modern video I/O. On an older install this pack won't even register properly. Update ComfyUI if the node is missing from your node list.
  • Wrong clip at the edge. Shot boundaries are model predictions, so the first or last frame of a shot can be a couple frames off. It's cosmetic for most uses; if you need frame-accurate cuts, split a bit conservatively and trim in your editor.
Categorycomfyui_OmniShotCut

Inputs (3)

NameTypeDefaultDescription
videoVIDEO
shots_jsonSTRING
indexINT00–10000

Outputs (1)

NameTypeDescription
videoVIDEO