Nodes/FireRedAudio · T8star-Aix/FireRedAudio 字幕时长适配 · T8star-Aix
ComfyUI Node

FireRedAudio 字幕时长适配 · T8star-Aix

Making the audio fit the subtitle timecode without talking at chipmunk speed

By T8mars·Created 19 days ago·Updated 15 days ago· 21
FireRedAudio 字幕时长适配 · T8star-Aix
  • audio_batch
  • 适配后 AudioBatch
  • 适配 Manifest 路径
  • 建议重新生成的 line ID
  • 时长适配报告
strategyspeech_aware
tolerance_seconds0.10
maximum_speed1.15
fit_underrunfalse
minimum_speed0.90
project_namesubtitle-fit
subfolderfireredaudio/duration-fit
edge_silence_threshold_db-40
edge_silence_min_seconds0.05
edge_padding_seconds0.12
internal_pause_min_seconds0.18
maximum_speech_speed1.12

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:

  1. Detect silence with FFmpeg, using the edge_silence_threshold_db (−40 dB default) and minimum-length knobs.
  2. Trim leading/trailing dead air first, keeping a small edge_padding_seconds buffer (0.12s) so the take doesn't start on a razor edge.
  3. If still over: find internal pauses ≥ internal_pause_min_seconds (0.18s) and splice them back in unmodified - a dramatic beat stays a beat.
  4. Speed up only the speech segments with pitch-preserving atempo, up to maximum_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, the retry_line_ids list (lines that couldn't fit naturally), and the fit_report with 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.

CategoryT8star-Aix/Audio/FireRedAudio

Inputs (13)

NameTypeDefaultDescription
audio_batchT8_FIREREDAUDIO_AUDIO_BATCH
strategyCOMBOspeech_aware3 options: speech_aware, safe_stretch, report_only
tolerance_secondsFLOAT0.100–5
maximum_speedFLOAT1.151–2
fit_underrunBOOLEANfalse
minimum_speedFLOAT0.900.5–1
project_nameSTRINGsubtitle-fit
subfolderSTRINGfireredaudio/duration-fit
edge_silence_threshold_dbFLOAT-40-80–-20
edge_silence_min_secondsFLOAT0.050.01–2
edge_padding_secondsFLOAT0.120–2
internal_pause_min_secondsFLOAT0.180.05–2
maximum_speech_speedFLOAT1.121–2

Outputs (4)

NameTypeDescription
适配后 AudioBatchT8_FIREREDAUDIO_AUDIO_BATCH
适配 Manifest 路径STRING
建议重新生成的 line IDSTRING
时长适配报告STRING