凤希AI - 多音频分片获取
This node fetches the right file for the current chunk
- 文件索引列表
- 分段数据
- 原始音频
- 分段时长
- 分段索引
If you're building a video where different scenes need different voice lines or different music beds, you don't want one long soundtrack - you want a folder of audio files, one per scene, and you want the workflow to hand the video generator the right file at the right time. FxAiAudioDurationGetSeg (凤希AI - 多音频分片获取) is the node that does the "right file at the right time" part. It's the consumer end of the pack's multi-audio chain, and it only makes sense when paired with FxAiAudioDurationSeg upstream.
Where it sits in the chain
The pairing works like this. FxAiAudioDurationSeg scans a folder of audio files and produces three things: a flat list of segment durations, a list that says which original file each segment came from, and a dict mapping file index → its segment durations. FxAiAudioDurationGetSeg takes those three outputs plus a "which chunk am I on" index, and resolves them into: the actual audio you should play for this chunk, the list of segment durations for that file, and the segment's position inside its own file.
In other words: one node plans the whole multi-file timeline, the other walks it chunk by chunk as your video loop iterates.
How it works
It resolves the file index at 分片索引 (chunk index) from the 文件索引列表, loads that file from 音频文件夹 (audio folder) with the pack's own loader, and looks up the file's segment list in 分段数据. If the chunk index runs past the list, it logs a warning and returns a silent placeholder instead of crashing the graph - which is a deliberate choice, because in a loop the last chunk index is easy to overshoot. It also prints a timestamped line each time it fires, which makes it genuinely nice for watching an overnight batch do its thing.
Inputs
音频文件夹(audio folder) - string path, can be absolute or relative.文件索引列表- the LIST fromFxAiAudioDurationSegmapping every chunk to its source file.分片索引(chunk index) - int, defaults to 0. This is what your loop increments.分段数据- the DICT of per-file segment durations fromFxAiAudioDurationSeg.
Outputs
原始音频(raw audio) - the full un-cut audio for the current source file.分段时长(segment durations) - that file's segment list, ready to feedFxAIAudioSegmentLoadso it can cut the exact slice and compute the frame count.分段索引(segment index) - which segment inside the file the current chunk maps to.
Install & shared context
It's part of fxai-toolkit (凤希全能节点包), a Chinese-language, MIT-licensed utility pack from author 凤希AI - the whole suite is built around segmenting long video work so it fits on modest VRAM. 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 on first boot; the duration probing upstream uses ffprobe, so have ffmpeg on PATH. No model files.
Gotchas
- The names are Chinese - 分片 = chunk/slice, 分段 = segment. Get them mixed up and the wiring still "works" but feeds wrong data; the only symptom is audio that's a beat off.
- If you don't need multiple source files, this node is overkill. Single-file projects should just use
FxAiAudioSegmenter+FxAIAudioSegmentLoad. - Because an out-of-range chunk returns silence rather than an error, a buggy loop count produces silent segments, not a loud failure. Keep an eye on the console log - it tells you when an index overshoots.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| 音频文件夹 | STRING | — | |
| 文件索引列表 | LIST | — | |
| 分片索引 | INT | 0 | — |
| 分段数据 | DICT | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 原始音频 | AUDIO | — |
| 分段时长 | LIST | — |
| 分段索引 | INT | — |