FireRedAudio 字幕时长适配 · T8star-Aix
Making the audio fit the subtitle timecode without talking at chipmunk speed
- audio_batch
- 适配后 AudioBatch
- 适配 Manifest 路径
- 建议重新生成的 line ID
- 时长适配报告
Your line is 5.6 seconds long and the subtitle slot is 5.185 seconds. Classic dubbing problem, three bad solutions: cut the take, stretch the whole thing, or regenerate and pray. This node exists because the obvious fix - time-stretch the whole clip by 8% - is also the bad one, since it turns a natural pause into a rushed blur. T8_FireRedAudio_DurationFit does the version a human editor would do: trim the dead air, then only speed up the actual speech, leaving your meaningful pauses intact.
What it does
Feed it the audio_batch (from BatchDubbing), and it compares each WAV against its subtitle time slot (the batch carries start_seconds/end_seconds from the script). The default speech_aware strategy is where the care went:
- Detect silence with FFmpeg, using the
edge_silence_threshold_db(−40 dB default) and minimum-length knobs. - Trim leading/trailing dead air first, keeping a small
edge_padding_secondsbuffer (0.12s) so the take doesn't start on a razor edge. - If still over: find internal pauses ≥
internal_pause_min_seconds(0.18s) and splice them back in unmodified - a dramatic beat stays a beat. - Speed up only the speech segments with pitch-preserving
atempo, up tomaximum_speech_speed(1.12×). That's a deliberately conservative cap; beyond it, the node won't mangle the line into sounding rushed. It flags the line for regeneration instead.
That last point is the design philosophy in one sentence: it would rather tell you "this line can't fit naturally, redo it" than hand you a 1.5× chipmunk. It never stretches beyond what sounds human, and it never touches your source files - output is a new fitted batch plus a manifest.
The other strategies
safe_stretch is the old blunt behavior - fit the whole take, no speech-aware pause preservation - for when you explicitly want it. report_only generates the fit report without changing anything, which is useful for auditing before you commit. The fit_underrun toggle (off) also stretches clearly-too-short lines up toward the slot if you want everything on-time; leave it off unless you have a reason, since stretching up can sound just as weird as rushing.
Inputs and outputs that matter
audio_batch- required.strategy,tolerance_seconds(0.1s),maximum_speed(1.15×) - the three you'll actually touch.- Everything else (silence thresholds, pause minimums) is advanced and sane by default.
- Outputs: the fitted
audio_batch,manifest_path, theretry_line_idslist (lines that couldn't fit naturally), and thefit_reportwith per-line speed factors and source hashes.
Install
Pack install:
cd ComfyUI\custom_nodes
git clone https://github.com/T8mars/comfyui-fireredaudio-T8.git
cd comfyui-fireredaudio-T8
python scripts\setup_runtime.py
No model needed - this is pure FFmpeg + bookkeeping.
Gotchas
The fit report is the part people skip and shouldn't: it records protected pauses, speech duration, target, actual speed factor, and source SHA-256 for every line - that's your proof the take wasn't butchered. And a retry_line_ids output that's not empty isn't an error; it's the node correctly refusing to degrade. Feed those IDs to BatchRetry, then run DurationFit again. That loop - fit, flag, retry - is the workflow this node was built to power.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_batch | T8_FIREREDAUDIO_AUDIO_BATCH | — | |
| strategy | COMBO | speech_aware | 3 options: speech_aware, safe_stretch, report_only |
| tolerance_seconds | FLOAT | 0.100–5 | — |
| maximum_speed | FLOAT | 1.151–2 | — |
| fit_underrun | BOOLEAN | false | — |
| minimum_speed | FLOAT | 0.900.5–1 | — |
| project_name | STRING | subtitle-fit | — |
| subfolder | STRING | fireredaudio/duration-fit | — |
| edge_silence_threshold_db | FLOAT | -40-80–-20 | — |
| edge_silence_min_seconds | FLOAT | 0.050.01–2 | — |
| edge_padding_seconds | FLOAT | 0.120–2 | — |
| internal_pause_min_seconds | FLOAT | 0.180.05–2 | — |
| maximum_speech_speed | FLOAT | 1.121–2 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| 适配后 AudioBatch | T8_FIREREDAUDIO_AUDIO_BATCH | — |
| 适配 Manifest 路径 | STRING | — |
| 建议重新生成的 line ID | STRING | — |
| 时长适配报告 | STRING | — |