Nodes/fxai-toolkit/凤希AI - 视频分割
ComfyUI Node

凤希AI - 视频分割

Chop a long video at exact seconds — with an optional title-card head

By fxai666·Created 4 months ago·Updated 4 days ago· 35
凤希AI - 视频分割
    • 输出文件夹路径
    视频路径
    分割秒数列表600,900
    封面图片路径
    前置帧数片头1

    FxAiVideoSplitFFmpeg ("凤希AI - 视频分割") splits a video into pieces at exact second marks, and optionally prepends a cover image as a title-card head to every segment after the first. It's the reverse of the merger - and it's the node you reach for when you have one long finished video and want it cut into chapters, or when you want to turn a long source into the segments a generation workflow can work from.

    What it does

    You give it a video file path and a comma-separated list of cut points, and it produces one video per interval. The author's own tooltip on 分割秒数列表 says it best: 600,900 means three segments - 0–600s, 600–900s, and 900s-to-end. Values past the video's total length are automatically dropped, so 600,999999 on a 10-minute video still works without erroring.

    The distinctive feature is the cover-image head. Give 封面图片路径 a single image file and, from the second segment onward, that image gets played for 前置帧数片头 (default 1) frames at the start - centered, at the source video's resolution - before the cut footage plays. The head is even synthesized with silent audio matching the source's sample rate and channel layout, so the segments stay A/V-consistent. This is built for the classic short-drama/YouTube format: every chapter opens with a title card, and you don't want to hand-cut those in an editor.

    The inputs and outputs that matter

    • 视频路径 - STRING. The full absolute path to the source file (the tooltip: "视频文件完整地址"). Local files only.
    • 分割秒数列表 - STRING, default "600,900". Comma-separated floats/ints.
    • 封面图片路径 - STRING, optional, default empty. Single image file; empty = pure split with no title cards.
    • 前置帧数片头 - INT, default 1. Frames (not seconds) of title-card at the start of segments 2+.

    Output: 输出文件夹路径 (STRING). Note this node is an output node (OUTPUT_NODE = True), so it terminates the graph - the folder path appears in its UI and you can preview the segments by pointing FxAiVideoLoad at it.

    How it works

    ffprobe reads the source's duration, frame rate, and resolution; then ffmpeg runs -ss/-to cuts for each interval. It re-encodes during the split (necessary for the title-card head), and it's careful about timebases - the head-building code reads the source video's actual time_base rather than guessing, which is the kind of detail that shows the author got bitten by sync drift before. Segments land in a per-run output folder.

    The honest caveats

    • Keyframe accuracy: cuts use -ss with re-encoding, so you get frame-accurate cuts, but re-encoding the whole thing takes longer than stream-copy splitting. Fine for short-to-medium files; for a 2-hour video this isn't a quick op.
    • The title-card head uses frames, not seconds - at 24fps, a 1 head is one 24th of a second, basically a flicker. If you want a visible title card you'll be raising 前置帧数片头 well above the default. The default is a "technical minimum," not a design recommendation.
    • Feed it a path that exists - a missing file just prints an error and returns an empty path string.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxai666/fxai-toolkit
    

    Restart ComfyUI, or use ComfyUI Manager and search "fxai-toolkit". Needs system ffmpeg/ffprobe on PATH. No model files.

    Category凤希AI/视频

    Inputs (4)

    NameTypeDefaultDescription
    视频路径STRING视频文件完整地址
    分割秒数列表STRING600,900逗号分隔浮点数/整数秒数,如600,900,代表0~600、600~900、900至结尾三段视频;超过视频总时长的数值会自动丢弃
    封面图片路径optSTRING仅支持单张图片文件;为空则不开启片头,维持纯分割
    前置帧数片头optINT1第2段及往后片段开头追加图片片头,图片等比例居中;先播放图片再播放视频

    Outputs (1)

    NameTypeDescription
    输出文件夹路径STRING