ComfyUI Node

Video Shot Cut

Stop opening a video editor just to split a clip into shots

By TAzandly·Created 22 days ago·Updated 21 days ago· 0
Video Shot Cut
  • video
  • file_paths
  • first_frame_paths
◄video_file▾►
◄split_points{"version":1,"fps":0,"total_frames":0,"points":[]}►
◄filename_prefixshotcut►
◄fps0.00►
◄export_first_framefalse►

What it actually is

You generated a 12-second clip in Wan or LTX and now you need individual shots out of it - one file per cut, audio intact, no hand-editing in Shotcut or Resolve. ComfyUI's native video nodes load a clip and write one out; what they don't give you is a timeline you can mark cuts on, or a per-shot export.

That's the whole pitch of Video Shot Cut. It's a single node with a scrubbable timeline embedded in it: you pick a video, double-click to drop cut markers, and when you hit Queue it writes every segment into its own numbered folder under output/videoshotcut/. There's a scene-detection right-click menu if you'd rather not place cuts by hand.

The pack is small - TAzandly/comfyui-videoshotcut, v0.1.0, single maintainer. Young code, doing something the core node set just doesn't.

How it works

The timeline is a custom JavaScript widget (js/videoshotcut.js, shipped via WEB_DIRECTORY) talking to aiohttp routes the pack registers on PromptServer at import. That's where the preview comes from - each frame is its own ffmpeg call decoding an exact source frame, which is why the timeline feels slightly sticky on a slow disk.

The cut points live in an ordinary string input called split_points, holding JSON the widget maintains for you (version, fps, total_frames, points). You're not meant to type in it.

On Queue the node probes the file with ffprobe for fps, duration, frame count and whether there's audio. Then, per segment, it decodes the frame range to a folder of PNGs and hands those PNGs plus a seeked copy of the source audio to ffmpeg for a final libx264 / yuv420p / aac encode. Two command-line passes and a temporary pile of PNGs per segment. That's what "frame-accurate" buys you, and it's why export gets slow - the README warns about it and it's telling the truth.

The inputs you'll touch

Practically, three things matter:

  • video_file - the combo listing videos in ComfyUI/input/, with upload built in. This is what the timeline previews.
  • filename_prefix - default shotcut; letters, digits, _, - only. Put a slash in it (jobs/clip) and the run folder moves to output/jobs/clip_00001/. The counter increments each run, so you never overwrite the last batch.
  • export_first_frame - off by default; flip it on and each shot also gets a _000, _001… PNG next to its MP4. Nice if the stills feed back into an I2V or upscale pass.

The rest: fps is 0 for "use the source rate", or set something like 24 to edit on a 24fps timeline - the code maps your timeline frames back onto source frames and duplicates or drops as needed. split_points you leave alone. There's also an optional video socket: a connected VIDEO beats video_file, so you can pipe generated clips straight in - but the timeline preview still reads video_file.

Outputs are two strings: file_paths (one MP4 path per line) and first_frame_paths (same for the PNGs, empty when the toggle's off). They wire into anything that takes a STRING. What they won't do is feed a node wanting a single path - you get a newline-joined list the moment your clip has two shots.

Install

You need ffmpeg and ffprobe on your PATH. That's it - requirements.txt in the repo contains a comment and nothing else, no Python packages, no models, no GPU work.

cd ComfyUI/custom_nodes
git clone https://github.com/TAzandly/comfyui-videoshotcut.git

Restart ComfyUI fully, then look under video → shotcut → Video Shot Cut. On Windows, winget install Gyan.FFmpeg is the least painful route. It's Registry-ready (publisher tazandly), so a Manager search for VideoShotCut may find it; if not, clone it.

Where people get burned

"Please add at least one cut point." Not a bug - the node has nothing to export without a marker. Double-click the track.

Stale cuts after you swap the video. The frame indices live in the saved widget; the frame count is re-probed at run time. Drop a 30-second clip's cut list onto a 4-second clip and every point past the new end is silently discarded - if they all fall outside, you're back at the "add a cut point" error. Changing fps shifts your cuts in time without moving the numbers, so re-detect after that too.

ffmpeg "not found" is the classic. It's the most common video-node support question on r/comfyui, and it usually means ffmpeg landed where your PATH doesn't look. Use the escape hatch this pack leaves undocumented: find_bin checks FFMPEG_PATH and FFPROBE_PATH env vars before falling back to shutil.which. Point those at the binaries in your launch script and skip the PATH surgery.

Routes failed to register. If the console warns videoshotcut: failed to register routes, the timeline goes dead - no preview, no scene detection - while Queue still works. Full restart, not a reload.

One last framing note: this is the mirror image of the VACE Video Joiner everyone passed around for stitching clips together. That tool joins, this one splits, and both sit at the same post-generation stage people used to leave to a real NLE.

Categoryvideo/shotcut

Inputs (6)

NameTypeDefaultDescription
video_fileCOMBO1 options: none
split_pointsSTRING{"version":1,"fps":0,"total_frames":0,"points":[]}—
filename_prefixSTRINGshotcutRun folder under output/videoshotcut/{prefix}_#####/ (or use sub/path).
fpsFLOAT0.000–2400 = use source fps. Set e.g. 24 to edit/export on a 24fps timeline.
export_first_frameBOOLEANfalseAlso save each shot's first frame as PNG in the same folder.
videooptVIDEO—

Outputs (2)

NameTypeDescription
file_pathsSTRING—
first_frame_pathsSTRING—