Nodes/fxai-toolkit/凤希AI - 音频分段器
ComfyUI Node

凤希AI - 音频分段器

The audio splitter that keeps your long video on the rails

By fxai666·Created 4 months ago·Updated 3 days ago· 35
凤希AI - 音频分段器
    • 音频
    • 分段列表
    • 循环数
    • 开始索引
    • 开始帧数
    • 开始秒数
    • 帧率
    • 最大长宽
    音频文件
    关键帧JSON[]
    跳过初始段false
    包含尾部段true
    是否平均分段true
    平均分段时长15.00
    开始分段索引0
    结束分段索引0
    帧率24
    最大长宽960
    刷新标记

    This is the flagship audio node in fxai-toolkit, the one the pack's long-video philosophy is built around: take a long soundtrack, decide exactly where the cuts go, and hand your video generator just the piece of audio it needs for the segment it's about to make. FxAiAudioSegmenter (凤希AI - 音频分段器) is a planning-plus-slicing hybrid - it figures out the segment boundaries and cuts the corresponding span of audio, then hands you all the frame math you need to keep picture and sound locked together.

    How it works

    Pick an audio file from the dropdown (it scans your whole ComfyUI input directory, subfolders included), and the node builds a timeline of segments. Three controls steer that timeline:

    • 关键帧JSON (keyframe JSON) - an optional list of timestamps like [5.2, 17.0, 33.5] that force cuts at those exact seconds, up to 64 markers. Leave it [] for a pure equal split.
    • 跳过初始段 / 包含尾部段 (skip initial / include tail) - trim the first and/or last segment. Handy when your audio starts with silence or a logo sting you don't want to generate against.
    • 是否平均分段 + 平均分段时长 (average split + segment length) - the default mode: chop the remaining audio into equal 平均分段时长 chunks, which is what you want when you're feeding a fixed-length video model.

    It then slices out the selected span of audio (音频 output) and - this is the useful part - computes a per-segment plan: 分段列表 gives each segment's length in seconds (one per line), 开始帧数/开始秒数 tell you where the current segment starts in the overall timeline, and 循环数 is how many segments you'll loop through. The 开始分段索引/结束分段索引 inputs let you skip ahead without re-planning - you can resume a batch from segment 4 without redoing 1–3.

    The outputs that matter

    • 音频 - the sliced AUDIO for the current segment span. This is what you generate against.
    • 分段列表 - one segment duration per line (as text), the master plan for your loop.
    • 循环数 (loop count) - how many segments the video loop should iterate.
    • 开始帧数 / 开始秒数 - where the segment starts, used to seed the video generator so it continues from the previous segment's last frame.

    There are also 帧率 and 最大长宽 pass-throughs (the pack's video generators read them), so one node effectively hands your whole segment config downstream.

    Install

    Part of fxai-toolkit (凤希全能节点包), MIT-licensed, by 凤希AI. Install via ComfyUI Manager (search "fxai") or:

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

    The pack auto-installs soundfile and psutil. For non-wav files (mp3, ogg...) the segmenter uses pydub; if you hit a "未安装pydub" error, run pip install pydub and make sure ffmpeg is on PATH. wav files work without pydub.

    Gotchas

    • The 音频文件 dropdown is populated at load time - if you just dropped files into the input folder, refresh the node (or use the 刷新标记 input) to see them.
    • Segments shorter than 0.1s get dropped, and a tiny final chunk merges into the previous one. If your average-split output has fewer segments than you expected, that's this tidying, not a bug.
    • The frame alignment assumes the pack's standard 8-frame grid (see FxAiFrameCalculator). If you changed the alignment base elsewhere, keep them consistent.
    • All labels are Chinese: 分段 = segment, 循环 = loop, 帧率 = fps, 最大长宽 = max dimension. You'll memorize them fast.
    Category凤希AI/音频

    Inputs (11)

    NameTypeDefaultDescription
    音频文件COMBO1 options:
    关键帧JSONSTRING[]
    跳过初始段BOOLEANfalse
    包含尾部段BOOLEANtrue
    是否平均分段BOOLEANtrue
    平均分段时长FLOAT15.00
    开始分段索引INT0
    结束分段索引INT0
    帧率INT24
    最大长宽INT960
    刷新标记optINT

    Outputs (8)

    NameTypeDescription
    音频AUDIO
    分段列表STRING
    循环数INT
    开始索引INT
    开始帧数INT
    开始秒数FLOAT
    帧率INT
    最大长宽INT