凤希AI - 音频与帧数获取器
Cut the exact slice of audio your current loop iteration needs
- 分段时长列表
- 原始音频
- 剪切音频
- 生成帧数
If the pack's audio story is "plan the cuts once, then generate segment by segment," FxAIAudioSegmentLoad (凤希AI - 音频与帧数获取器) is the node that lives inside the loop. Every iteration you tell it "I'm on segment 3" and it cuts the matching slice out of your original audio and tells you exactly how many frames to generate for it. It's the bridge between the audio timeline and the video generator, and it's where the pack's frame-alignment logic actually does its work.
How it works
You hand it the full audio, a LIST of segment durations (the plan from FxAiAudioSegmenter, FxAiAudioAvgSplit, or FxAiAudioDurationGetSeg), and a 当前索引 (current index). It then:
- Converts each segment duration to frames at
帧率. - Rounds each segment down to the nearest
帧数对齐基数(default 8) multiple - the safe frame count for the video model. - Adds up all the frames lost to rounding and dumps them onto the last segment (rounded up), so the total timeline stays true to the original audio. This is the anti-drift fix: nobody loses frames, they just get concentrated at the end.
- Works out where segment
当前索引starts in the overall timeline, cuts the audio from there (plus the过渡帧数overlap), and returns it.
The frame bookkeeping is the part that matters. If you just multiplied seconds by fps and fed the video model, every segment would end on a non-grid frame count and the model would fudge it - a frame here, a frame there, and by the end your "perfectly synced" long video is off by half a second. The aligned frame count in the output is the number your sampler should actually target.
Inputs
原始音频- the full AUDIO.分段时长列表- the LIST of segment durations.当前索引- which segment to cut. Your loop increments this.帧率,帧数对齐基数,过渡帧数- defaults 24, 8, 1. Keep them matching the pack's frame calculators.
Outputs
剪切音频(cut audio) - the AUDIO slice for the current segment, with a touch of transition overlap on the end.生成帧数(frames to generate) - the INT your video generator should use, aligned to the grid plus transition frames.
Install
One node in fxai-toolkit (凤希全能节点包), the Chinese MIT-licensed suite from 凤希AI for low-VRAM segmented video. ComfyUI Manager (search "fxai") or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
# restart ComfyUI
Pack auto-installs soundfile and psutil; no model downloads.
Gotchas
- Index out of range is a hard
ValueError, not a silent skip - the pack's philosophy differs fromFxAiAudioDurationGetSeghere (that one returns silence; this one refuses to run). If your loop overshoots, you'll see the error in the console with the valid range printed. - The last segment absorbs all the rounding losses, so it's typically a bit longer than the others in frame terms. That's by design, not a bug - don't "fix" it.
分段时长列表must be a LIST, and the原始音频is assumed to be the whole track. Feeding it a pre-cut audio will double-cut.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| 帧率 | INT | 24 | — |
| 当前索引 | INT | 0 | — |
| 帧数对齐基数 | INT | 8 | — |
| 过渡帧数 | INT | 1 | — |
| 分段时长列表 | LIST | — | |
| 原始音频 | AUDIO | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 剪切音频 | AUDIO | — |
| 生成帧数 | INT | — |