Nodes/Simple Video Effects/Video Splitter (ASS Subtitles)
ComfyUI Node

Video Splitter (ASS Subtitles)

Split a video at sentence boundaries using its ASS subtitles

By scofano·Created 10 months ago·Updated 19 days ago· 0
Video Splitter (ASS Subtitles)
    • output_folder
    video_path
    ass_path
    divider_chars.!?
    folder_prefixsplit_video
    min_audio_duration5
    end_padding0.2
    use_gpufalse

    Ever needed to cut a long narrated video into clips at natural sentence boundaries - and realized that's an hour of scrubbing a timeline? This node does it automatically, using the video's own ASS subtitle file as the guide. It reads the subtitle timings, finds the dialogue lines that end in punctuation, and splits the video into separate MP4 segments exactly there. It's niche, but when it fits your job it saves you a genuinely miserable afternoon.

    The typical use: you have a video with burned dialogue (or just a file plus its .ass subs), you want each line or sentence as its own clip - for dubbing, repurposing, training data, review cuts. The node handles the whole thing: parse subs, find split points, cut, re-encode, save.

    How it works

    The node parses the ASS file for dialogue entries with start/end times, strips formatting tags from the text, and looks for lines ending in your chosen divider_chars (default .!?). Each such line's end time becomes a candidate cut point. Then it filters: segments must clear min_audio_duration seconds (default 5) or it merges them with their neighbor, so you don't get 0.4-second slivers. It adds end_padding (default 0.2s) to the end of each segment except the last, keeps a 1-frame gap between segments for clean transitions, and re-encodes each segment as its own MP4 (H.264, HEVC/NVENC if you enable use_gpu) so audio stays in sync. Segments land in a timestamped folder as original_[000].mp4, [001].mp4, etc.

    Two subtitle quirks handled for you: an ellipsis is treated as a period, while sequences like .. or ... are ignored as invalid dividers.

    Inputs and output

    • video_path - the video file
    • ass_path - the .ass subtitle file (SubStation Alpha format, not SRT)
    • divider_chars - which end-punctuation triggers a split, default .!?
    • folder_prefix - prefix for the output folder name
    • min_audio_duration - minimum segment length in seconds (default 5)
    • end_padding - extra seconds added to segment ends (default 0.2)
    • use_gpu - optional NVENC encoding, off by default

    The output output_folder is a string path to the folder of split clips.

    Installing it

    Ships with the Simple Video Effects pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/scofano/ComfyUI-Simple-video-effects
    cd ComfyUI-Simple-video-effects
    pip install -r requirements.txt
    

    Restart ComfyUI, or install via ComfyUI Manager ("Simple Video Effects"). No models.

    Common issues

    The obvious one: you need an ASS file, not an SRT. This node specifically parses SubStation Alpha. If you only have .srt, convert it first (any subtitle tool or ffmpeg -i subs.srt subs.ass).

    Then there's the ffmpeg-on-PATH requirement that every file-based node in this pack has - the code hard-fails with "ffmpeg and ffprobe not found on PATH" if the binaries aren't installed. And tune divider_chars to your content: a fast-talker video with long rambling lines may produce segments longer than you want even with .!?, while a list-like narration with few punctuation marks may barely split at all. If min_audio_duration is too aggressive, short sentences get glued onto their neighbors - that's by design, and lowering it is the fix.

    CategorySimple Video Effects

    Inputs (7)

    NameTypeDefaultDescription
    video_pathSTRING
    ass_pathSTRING
    divider_charsSTRING.!?
    folder_prefixSTRINGsplit_video
    min_audio_durationINT5
    end_paddingFLOAT0.2
    use_gpuoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    output_folderSTRING