Cutting video
Extract the frame ranges Detecting videos mask found
- images
- segments_data
- audio_data
- Video_Batch
Cutting_video does exactly what the name says, but it's not a general-purpose video splitter - it's built to consume the specific output of its sibling node, Detecting_videos_mask. That node scans a video sequence and works out which stretches of frames form a continuous, valid segment (based on bounding-box tracking); this node then goes and actually pulls those frame ranges out of the full sequence, keeps the audio in sync, and can optionally crop each extracted segment down to its detected bounding-box size at the same time.
Both live in ComfyUI-WJNodes, a large personal utility pack from a GitHub user going by 807502278. It's a genuine grab-bag - crop pipelines, video slicing, color filtering, file operations - built, in the author's own words, as "a simple node package that I use myself."
How it works
Feed it your full image sequence plus the segments_data that Detecting_videos_mask produced upstream, and it slices out the frames belonging to each detected segment. If you connect an audio_data track, it extracts the matching audio alongside each video segment so the two stay synchronized rather than drifting out of alignment. You can pull multiple segments at once - either kept as separate batches, or combined into one via merge_segments - and if segment bounding-box data came through, each extracted segment gets cropped down to that box's size rather than staying full-frame.
The inputs and outputs that matter
images- your full frame sequence, the same one you ran throughDetecting_videos_mask.segments_data- the segment boundaries fromDetecting_videos_mask. This is a required, pack-specific type; you can't hand-build it, it has to come from that node.merge_segments(default off) - leave multiple detected segments as separate outputs, or combine them into one.audio_data(optional) - your source audio track, if you have one, to keep synced with the extracted frames.
Output is a single Video_Batch - another custom pack type carrying the cut (and possibly cropped) segments forward to whatever encodes or saves them next.
How to install it
Through ComfyUI Manager, search "ComfyUI-WJNodes." Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
Restart ComfyUI - you'll find it filed under WJNode/video/slicing alongside Detecting_videos_mask. No model downloads are needed for either node; this is pure frame-range extraction, not detection or inference.
Common issues & troubleshooting
Nothing comes out, or segments_data throws a type error. This node can't function on its own - it has to be paired with Detecting_videos_mask upstream. If you're feeding it hand-rolled segment data or output from a different node, it won't match the expected type.
Audio and video drift out of sync. Make sure the audio_data you're feeding in actually corresponds to the same full sequence you ran detection on - if the audio track and image sequence have different frame rates or start points going in, syncing them on the way out won't fix a mismatch that already existed upstream.
Segments come out full-frame when you expected them cropped. Cropping to the segment's bounding box only happens if bounding-box data made it through Detecting_videos_mask in the first place - if that node's bboxes input was left empty, there's nothing to crop against and you'll just get the raw frame range.
Very little outside reference for this pipeline. This is a specific, personal-project take on segment detection and cutting rather than a widely-adopted video tool - there's no broader community thread to check your setup against, so validate behavior on a short test clip before trusting it on something long.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| segments_data | segments_data | — | |
| merge_segments | BOOLEAN | false | — |
| audio_dataopt | AUDIO | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Video_Batch | Video_Batch | — |