Nodes/fxai-toolkit/凤希AI - 多音频分片
ComfyUI Node

凤希AI - 多音频分片

Point it at a folder of audio and it plans every cut for you

By fxai666·Created 4 months ago·Updated 3 days ago· 35
凤希AI - 多音频分片
    • 分段时长
    • 文件索引
    • 分段数据
    文件夹路径
    分片秒数15.0

    Somewhere between "one audio file, cut it evenly" and "a full soundtrack you've hand-timed" sits the multi-audio workflow: a folder full of voice lines or music beds, each one becoming several video segments. FxAiAudioDurationSeg (凤希AI - 多音频分片) is the planner for exactly that. It scans a folder, figures out how long every file is, and works out how many segments each one splits into. No audio moves through it - it's pure measurement and planning, and its outputs are the coordinates the rest of the pack navigates by.

    How it works

    It lists every audio file in 文件夹路径 (folder path) - mp3, wav, ogg, flac, m4a, case-insensitive, sorted by name - then runs ffprobe on each to get its real duration. Then the split logic kicks in:

    • Files under 20 seconds stay as a single segment. No point shredding a 6-second clip.
    • Anything longer gets chopped into 分片秒数 (slice seconds) pieces - default 15s - with the remainder kept as its own final chunk.

    The 20-second threshold is worth knowing, because it means this node is opinionated: it refuses to split files that are shorter than what you asked for. If you set 分片秒数 to 30 but the file is 25 seconds, you get one 25-second segment, not a 25 + nothing pair. That's a feature (no micro-segments), but it's the kind of thing that surprises you the first time you see a "25s" where you asked for 30s chunks.

    Inputs

    • 文件夹路径 (folder path) - where your audio files live. Absolute path works fine.
    • 分片秒数 (slice seconds) - float, default 15, min 1, step 0.5.

    Outputs - the three coordinates

    • 分段时长 (segment durations) - a flat LIST of every segment's duration across all files, in file order. This is the master timeline.
    • 文件索引 (file index) - a parallel LIST mapping each segment back to which file it came from. Segment 0,1,2 → file 0; segment 3,4 → file 1, and so on.
    • 分段数据 (segment data) - a DICT keyed by file index, each value the list of that file's segment durations.

    The output trio is designed to feed straight into FxAiAudioDurationGetSeg, which resolves them per-chunk inside your generation loop. You could consume them manually too, but the pack's own chain is the path of least resistance.

    Install

    One node in fxai-toolkit (凤希全能节点包), the Chinese MIT-licensed utility pack by 凤希AI that's built around chopping long video work into low-VRAM chunks. ComfyUI Manager (search "fxai") or:

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

    It relies on ffprobe for durations, so ffmpeg must be on your PATH - this is the node most likely to throw "ffprobe not found"-style errors if your ffmpeg install is broken or absent. The pack auto-installs soundfile and psutil; no model downloads.

    Gotchas

    • It plans, it doesn't play. The 分段时长 list describes cuts; the actual slicing is done by FxAIAudioSegmentLoad once you know which chunk you're on.
    • Sorting is by filename string, so name files 01_, 02_, 03_ if order matters. 10_ sorts before 2_.
    • A file that fails to probe (corrupt or zero-length) silently reports 0.0s duration and becomes a 0-second segment. Worth a quick look at the folder before you queue an overnight run.
    Category凤希AI/音频

    Inputs (2)

    NameTypeDefaultDescription
    文件夹路径STRING
    分片秒数FLOAT15.0

    Outputs (3)

    NameTypeDescription
    分段时长LIST
    文件索引LIST
    分段数据DICT