Nodes/comfyui-mixlab-nodes/Load Video And Segment
ComfyUI Node Runs on cloud

Load Video And Segment

Split a clip into scenes

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Load Video And Segment
    • scenes_video
    • scenes_count
    • frame_count
    • fps
    video
    video_segment_frames10
    transition_frames0

    This one loads a video and chops it into scenes for you - instead of getting one long frame stream, you get the clip broken into segments you can process one at a time. Handy when you're doing per-scene work: a different prompt per shot, batching, or feeding chunks into a downstream video pass without holding the whole thing in memory at once.

    Before you wire it in, though, read the troubleshooting section. This node has a known habit of freezing the ComfyUI canvas, and it's better to know that going in than to discover it after your graph locks up.

    How it works

    You point it at an uploaded video and tell it how big each segment should be. It walks the video and cuts it into chunks of video_segment_frames frames each, optionally with a few overlapping transition_frames between neighbours so a downstream blend has something to work with. What comes back is a list of scene clips plus some counts, so anything you connect downstream can iterate over the segments automatically.

    Note the name is a little grander than the mechanism. Despite "Segment," this is fixed-length chunking by frame count, not smart shot-boundary detection - you're deciding the cut size, not asking it to find where the camera cut.

    Inputs and outputs

    The three inputs that matter:

    • video - the source clip. It's a picker of videos you've uploaded, so upload first, then select.
    • video_segment_frames (INT, default 10) - how many frames per segment. This is your main dial. Bigger chunks = fewer, longer scenes; smaller = more, shorter ones. The min is -1, which is the node's way of saying "don't split, give me the whole thing as one segment."
    • transition_frames (INT, default 0) - overlap frames carried between adjacent segments. Leave it at 0 for clean cuts; bump it if a downstream node needs a crossfade region.

    Outputs, four of them: scenes_video (a list of scene clips - the main thing you consume), scenes_count (how many segments it made), frame_count (total frames in the source), and fps. The counts are useful for driving loops or sanity-checking that the split did what you expected. The scenes_video output is a Mixlab-specific type, so it's happiest feeding other Mixlab video nodes rather than a generic video-combine from another pack.

    How to install it

    Comes with the Mixlab pack - install the pack once, get the node.

    • ComfyUI Manager: search comfyui-mixlab-nodes, install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, then install requirements (install.bat on Windows, or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt), and restart.

    Common issues

    Here's the one you need to know about. There are real reports of the ComfyUI interface freezing right after you add this node - canvas stuck, can't pan, can't zoom, the whole editor wedged. It's been posted more than once. If it hits you, the culprit is Mixlab's front-end JavaScript choking on the node's custom video widget, not your video file. Practical recovery: reload the browser tab first; if the graph is still wedged, remove the node, and if it keeps happening, disabling the pack's front-end (or updating the pack - the maintainer patches these UI bugs over time) is the blunt fix. Save often before you add it.

    Second thing: because scenes_video is a Mixlab type, don't expect it to plug cleanly into VHS or other third-party video nodes - keep the segment processing inside the Mixlab video nodes, or extract frames to a plain IMAGE list first. And if you set video_segment_frames tiny on a long clip, you'll generate a huge number of segments; watch that the downstream loop isn't doing something expensive per segment before you kick it off.

    Category♾️Mixlab/Video

    Inputs (3)

    NameTypeDefaultDescription
    videoCOMBO0 options:
    video_segment_framesINT10
    transition_framesINT0

    Outputs (4)

    NameTypeDescription
    scenes_videoSCENE_VIDEO
    scenes_countINT
    frame_countINT
    fpsINT