Nodes/XB_ToolBox/XB-BOX - 🎵 音频切片V1(单人)
ComfyUI Node

XB-BOX - 🎵 音频切片V1(单人)

The audio slicer with a waveform you can actually click on

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-BOX - 🎵 音频切片V1(单人)
    • audio
    • frame_count
    • fps
    audio
    fps25
    start_time0.00
    end_time10.00
    duration_display0 帧

    The base XB_AudioSlicer works great but it's blind - you type a start time and an end time and hope you got the numbers right. XB_AudioSlicerV1 is the same node with eyes: a waveform window where you drag the split lines to mark your in and out points instead of guessing. If you're cutting a character's line out of a longer recording, this is the one you actually reach for.

    "V1(单人)" in the display name is the pack's way of saying single speaker. It's the single-track visual variant; the two-speaker version (V2) and the advanced multi-track one (V3) build on the same idea. If you only ever slice one voice at a time, this is your sweet spot.

    How it works

    Underneath, the mechanism is identical to the base node: it decodes your file from ComfyUI/input, downmixes to mono, and - the part that matters - snaps the output frame count to the 4N+1 rule that video models expect, then pads or trims the actual audio samples so the waveform physically matches the frame count it reports. The frame_count output is deterministic, not approximate, which is the whole point of slicing audio for video here.

    The one real difference is the UI: a waveform render plus draggable split lines, so start_time and end_time update as you drag instead of being typed blind. There's also a read-only duration_display label that shows you the resulting frame count live, so you can see "81 帧" before you ever hit queue.

    The inputs that matter

    • audio - dropdown of audio files in ComfyUI/input (mp3, wav, flac, ogg, m4a, aac, opus, wma, webm). Pick your recording.
    • fps - default 25. Must match the video side of your pipeline, since the frame count is computed from it.
    • start_time / end_time - seconds, step 0.01. With the waveform you'll mostly set these by dragging.

    Outputs: audio (the cropped AUDIO), frame_count (the 4N+1-snapped INT, ideal for wiring into a segment_length input), and fps (passthrough FLOAT).

    Installing

    Part of XB_ToolBox, so it installs with the pack. In ComfyUI Manager search XB_ToolBox, or:

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

    then restart ComfyUI. PyAV (av) is required for audio decoding - the pack lists it in requirements.txt, and it's almost always already present in a ComfyUI env.

    Common issues

    • Waveform doesn't appear - the preview is drawn by the pack's frontend JS; a hard cache-bust refresh (Ctrl+Shift+R) usually wakes it up. Old ComfyUI versions may not render it at all.
    • Frame count looks "rounded" - that's the 4N+1 snap doing its job, not a bug. Check the console log; the node prints something like 帧数 80 → 81 (对齐 4N+1) when it adjusts.
    • Wrong segment - remember the slider is absolute seconds from the file start, not from the start of your cut.

    The trade-off versus the base node is purely cosmetic workflow: same math, better targeting. And if you need two voices stitched with a gap between them, skip ahead to V2.

    CategoryXB_ToolBox/Audio

    Inputs (5)

    NameTypeDefaultDescription
    audioCOMBO1 options: none
    fpsFLOAT251–120
    start_timeFLOAT0.000–99999
    end_timeFLOAT10.000–99999
    duration_displaySTRING0 帧

    Outputs (3)

    NameTypeDescription
    audioAUDIO
    frame_countINT
    fpsFLOAT