凤希AI - 音频分段器
The audio splitter that keeps your long video on the rails
- 音频
- 分段列表
- 循环数
- 开始索引
- 开始帧数
- 开始秒数
- 帧率
- 最大长宽
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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| 音频文件 | COMBO | 1 options: | |
| 关键帧JSON | STRING | [] | — |
| 跳过初始段 | BOOLEAN | false | — |
| 包含尾部段 | BOOLEAN | true | — |
| 是否平均分段 | BOOLEAN | true | — |
| 平均分段时长 | FLOAT | 15.00 | — |
| 开始分段索引 | INT | 0 | — |
| 结束分段索引 | INT | 0 | — |
| 帧率 | INT | 24 | — |
| 最大长宽 | INT | 960 | — |
| 刷新标记opt | INT | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| 音频 | AUDIO | — |
| 分段列表 | STRING | — |
| 循环数 | INT | — |
| 开始索引 | INT | — |
| 开始帧数 | INT | — |
| 开始秒数 | FLOAT | — |
| 帧率 | INT | — |
| 最大长宽 | INT | — |