Nodes/ComfyUI Video Segmentation Node/🐾MiaoshouAI Select Video
ComfyUI Node

🐾MiaoshouAI Select Video

Grab one scene out of your auto-cut list

By miaoshouaiĀ·Created about a year agoĀ·Updated about a year agoĀ· 40
🐾MiaoshouAI Select Video
  • segment_paths
  • selected_path
ā—„index0ā–ŗ

Once "🐾MiaoshouAI Segment Video" has split your footage into 47 shots, you usually want exactly one of them - the shot where the subject turns to camera, the clip you'll feed into an image-to-video chain, the single scene that's actually usable for a training set. That's the entire job of SelectVideo: it takes the list of segment paths and returns the one at the index you choose.

Inputs

The whole interface is two fields:

  • index (default 0, range 0–999) - the position in the list you want. Zero-based, so the first segment is 0, the second is 1, and so on.
  • segment_paths - the LIST output from the Segment Video node, wired straight across.

That's it. There's no dropdown of previews, no thumbnails - it's an integer. If you're browsing 47 segments, you'll be dragging the index slider back and forth and glancing at whatever downstream node is consuming the path to see which shot you landed on. Not the most elegant way to browse, but perfectly fine for the common case of "give me the nth scene."

Output

A single selected_path STRING, which you can hand to any node that takes a video file path. In the pack's example workflows it's used to pick a scene for further processing, and "🐾MiaoshouAI Zip Compress" will happily archive whichever segment you land on.

Behavior worth knowing

Two small things keep this node from crashing your workflow. If segment_paths is missing or empty, you get "" back - no crash, just an empty string and a warning in the console. And out-of-range indexes are clamped rather than errored: negative indexes snap to 0, and anything past the end of the list snaps to the last segment. That's genuinely handy when your cut count varies run to run - ask for index 5 on a video that only produced 3 scenes and you get the last one instead of a failure.

Install

It ships in the MiaoshouAI video segmentation pack, so the install is the pack's:

cd ComfyUI/custom_nodes
git clone https://github.com/miaoshouai/ComfyUI-Video-Segmentation
cd ComfyUI-Video-Segmentation
pip install -r requirements.txt

…then restart ComfyUI - or use ComfyUI Manager and search "MiaoshouAI". SelectVideo itself has no model and no dependencies beyond the pack's; you'll still absorb the pack's requirements.txt, which includes TensorFlow that the shipped code never actually imports. For the full picture of what the pack loads and where the weights come from, see the Segment Video and Load TransNet Model articles - those are the nodes doing the real work, and this one just points at the result.

CategoryMiaoshouAI Video Segmentation

Inputs (2)

NameTypeDefaultDescription
indexINT00–999—
segment_pathsoptLIST—

Outputs (1)

NameTypeDescription
selected_pathSTRING—