Nodes/XB_ToolBox/XB-BOX - 🎵 音频切片V3(高级)
ComfyUI Node

XB-BOX - 🎵 音频切片V3(高级)

The audio slicer for when two voices actually talk over each other

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-BOX - 🎵 音频切片V3(高级)
    • combined_audio
    • total_frames
    • fps
    • audio1
    • frames1
    • audio2
    • frames2
    audio1
    fps24
    start10.00
    end110.00
    mute_count10
    mutes1_data
    audio2
    start20.00
    end210.00
    mute_count20
    mutes2_data
    merge_mode接力
    total_display0 / 0帧

    V2 handles clean A-then-B dialogue, but real conversations are messier: someone cuts in, a line has a word you want muted, or two people talk over each other. XB_AudioSlicerV3 is the "高级" (advanced) two-track slicer that adds the two things V2 lacks - mute regions inside each clip and an overlap merge mode - so you can build the kind of layered dialogue track a natural conversation needs.

    It's the most capable node in XB_ToolBox's audio-slicer family, and also the one with the most moving parts. If your scene is two clean sequential lines, V2 is simpler and does the job. If you need surgical control over what's audible, this is it.

    How it works

    Both tracks go through the same pipeline as the rest of the family: decode from ComfyUI/input, mono downmix, time-clamp, and the ever-important 4N+1 frame snap so the output stays aligned to what video models expect. On top of that:

    • Mute regions. For each track you set mute_count and then a mutesN_data string like 2.5,3.8;5.0,5.6 - semicolon-separated start/end pairs in seconds. Those sections are zeroed out (silenced) in the slice. This is how you cut a cough out of a line without re-editing the file, or create a pause inside speech.
    • Two merge modes. 接力 (relay) concatenates A then B, like V2. 重叠 (overlap) actually mixes the tracks so both can be heard at once - the interjection case.
    • Per-track outputs. You get the combined track and each speaker's slice separately, each with its own frame count.

    One detail the source is careful about: mute times are interpreted relative to the original file's timeline and then shifted into the slice, so a mute of 10.0,10.5 in a file cut from 8s to 12s mutes 2–2.5s of the output. Confusing until you know it - the node deliberately subtracts the cut's start offset for you.

    The inputs that matter

    • audio1 / audio2, start1/end1, start2/end2 - the two files and their cuts.
    • mute_count1 / mute_count2 (0–20) and mutes1_data / mutes2_data - number and definition of the silent regions. Format: start,end;start,end in seconds.
    • merge_mode - 接力 (relay, default) or 重叠 (overlap/mix).
    • fps - default 24 here (note: the base and V1/V2 default to 25). Set it to match your pipeline.

    Outputs: combined_audio, total_frames (INT, the thing to feed segment_length), fps, plus audio1/frames1 and audio2/frames2.

    Installing

    Same pack, same story: ComfyUI Manager → search XB_ToolBox, or

    cd ComfyUI/custom_nodes
    git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
    

    then restart. Needs av (PyAV) for decoding, listed in requirements.txt.

    Common issues

    • Mutes not applying - check the format: commas between start/end, semicolons between regions, no stray spaces. A bad region is silently skipped.
    • Muted the wrong part - remember mute times are absolute to the source file, then offset into the slice. If you cut from 8s, a mute written as 8.0,8.5 is silence at the very start of the clip.
    • Overlap mode sounds clipped - two mono tracks mixed can peak; it's a mix, not a mastered stem, so don't expect dynamic range management.

    If all this is more firepower than you need, V2's relay mode with a gap_frames pause is the lighter option for plain two-line dialogue.

    CategoryXB_ToolBox/Audio

    Inputs (13)

    NameTypeDefaultDescription
    audio1COMBO1 options: none
    fpsFLOAT241–120
    start1FLOAT0.000–3600
    end1FLOAT10.000–3600
    mute_count1INT00–20
    mutes1_dataSTRING
    audio2COMBO1 options: none
    start2FLOAT0.000–3600
    end2FLOAT10.000–3600
    mute_count2INT00–20
    mutes2_dataSTRING
    merge_modeCOMBO接力2 options: 接力, 重叠
    total_displaySTRING0 / 0帧

    Outputs (7)

    NameTypeDescription
    combined_audioAUDIO
    total_framesINT
    fpsFLOAT
    audio1AUDIO
    frames1INT
    audio2AUDIO
    frames2INT