Nodes/comfyui-huyl2-nodes/Video Cut to 8s Segments
ComfyUI Node

Video Cut to 8s Segments

Video Cut to 8s Segments

By huyl3-cpu·Created 9 months ago·Updated 4 months ago· 1
Video Cut to 8s Segments
    • videos_list
    • output_directory
    video_url
    segment_duration8
    output_prefixa
    resolutionoriginal
    use_gputrue
    accurate_cuttrue
    parallel_workers4
    fps_override0.00

    This is the one node in the entire comfyui-sortlist pack the author actually wrote documentation for, and it shows - it's also the best-behaved node here. It does exactly what the name says: feed it a video, it chops it into fixed-length segments (8 seconds by default), and hands you back the list of resulting files.

    Why you'd reach for it. Video generation models have short native context windows - Wan and LTX-family models both cap out well under a minute of generation before quality degrades or the model refuses outright. A common real workflow is to take a long source clip, split it into uniform chunks, run each chunk through a per-segment pipeline (upscale, restyle, whatever), then stitch the results back together. This node is the "chop" half of that - it's not going to reassemble anything for you, but it'll get you clean, consistent pieces to feed the rest of the pipeline.

    How it works, straight from the author's README. It auto-detects the source FPS rather than assuming one, cuts frame-accurately rather than approximating, and guarantees the output format regardless of what codec the source used - H.264, MP4 container, YUV420P color. It tries GPU (NVENC) encoding first and falls back to CPU automatically if that fails, and it can encode multiple segments in parallel. The README gives a concrete example: a 268.2-second, 25fps source cut at 8-second segments produces 34 segments - 33 full 8.0-second pieces plus one leftover 4.2-second piece. That's the shape to expect: the tail segment is whatever's left, not padded out to match the rest.

    Inputs worth setting. video_url is the path to your source file. segment_duration controls chunk length in seconds (default 8, range 1–3600). output_prefix names the output files (default "a"). resolution lets you force the output down or up to 480p/720p/1080p instead of keeping the source's native resolution - leave it on original unless you specifically want a resize baked into the cut. use_gpu tries NVENC first with automatic CPU fallback, so there's little reason to turn it off. accurate_cut controls frame-accurate seeking versus rougher, faster cutting - leave it on unless you're in a hurry and don't care about exact boundaries. parallel_workers sets how many segments encode simultaneously (default 4). The optional fps_override defaults to 0, which means "auto-detect" - matching the README's stated auto-FPS feature - and you'd only set it explicitly if the source's FPS metadata is wrong or missing.

    Outputs. videos_list gives you the resulting file paths, and output_directory points at the folder they landed in (a videos_cut/ directory, per the README).

    Installing it. The README documents the Google Colab path specifically:

    cd /content/ComfyUI/custom_nodes
    git clone https://github.com/huyl3-cpu/comfyui-sortlist.git
    

    On a normal desktop install it's the same idea without the Colab-specific path - cd ComfyUI/custom_nodes && git clone https://github.com/huyl3-cpu/comfyui-sortlist, then restart. Or search comfyui-huyl2-nodes in ComfyUI Manager.

    Troubleshooting. The pack's own changelog exists partly because of this node: version 1.1 (2026-01-26) specifically fixed NVENC compatibility problems on Google Colab, alongside adding the GPU-to-CPU auto-fallback and better error logging. If you're hitting GPU encode failures on Colab, make sure you're actually on an updated copy - git pull origin main inside the pack's folder, or the update_colab.sh script it ships, followed by a Colab runtime restart - rather than assuming the node is broken outright.

    Since use_gpu already falls back to CPU automatically, an outright segment failure (not just a slow one) points past what that fallback can save you - a bad or unusual source codec, a corrupted file, or a path the executor can't actually read. And if you're seeing out-of-memory errors rather than failed encodes, parallel_workers defaulting to 4 is a reasonable first thing to turn down - Colab's free tier is stingy with both RAM and VRAM, and this setting is exactly the dial for trading speed against resource pressure.

    Categoryvideo

    Inputs (8)

    NameTypeDefaultDescription
    video_urlSTRING
    segment_durationINT81–3600
    output_prefixSTRINGa
    resolutionCOMBOoriginal4 options: original, 480p, 720p, 1080p
    use_gpuBOOLEANtrue
    accurate_cutBOOLEANtrue
    parallel_workersINT41–16
    fps_overrideoptFLOAT0.000–120

    Outputs (2)

    NameTypeDescription
    videos_listSTRING
    output_directorySTRING