Nodes/ComfyUI-Audio-Srt-Aligner/Audio SRT Aligner (文稿校对字幕)
ComfyUI Node

Audio SRT Aligner (文稿校对字幕)

Feed it audio and a transcript — get a timed SRT out

By ahkimkoo·Created 4 months ago·Updated 4 months ago· 1
Audio SRT Aligner (文稿校对字幕)
  • audio
  • srt_string
  • detected_language
  • srt_entries
  • coverage
  • audio_out
reference_text
model_sizesmall
languagezh
engine_modestable-ts
beam_size5
max_chars12
compute_typefloat16
uvr5_moderoformer

AudioSrtAligner is the node that turns an audio clip into a real, timestamped SRT subtitle file - and it has a party trick most transcription tools don't: you can hand it the transcript you already wrote, and it will align the transcript to the audio instead of making you fix Whisper's garbage yourself.

It's the "proofread subtitles" half of a two-node pack, with its sibling VideoSrtOverlay handling the rendering. Wire it up as LoadAudio → AudioSrtAligner → VideoSrtOverlay → VideoCombine and you've got subtitled video with zero manual timestamp work.

How it works

At the core is faster-whisper with word-level timestamps. That gets you rough timing; the interesting part is what happens if you fill in reference_text. The node aligns your script to Whisper's transcript using a pure-text algorithm - no Wav2Vec2 phoneme model, no 1GB forced-alignment download. It finds unique tokens that appear in both texts, uses a longest-increasing-subsequence pass to keep those anchors in order (so matches can't cross), then diff-matches the gaps with SequenceMatcher. Matched words get real timestamps; unmatched words get linearly interpolated ones. A custom RMS-energy VAD then snaps each subtitle's start/end to actual speech boundaries, and anything running longer than ~5.8s gets auto-split at punctuation. Clever, and it runs on pure Python string ops.

Leave reference_text empty and it just transcribes with Whisper, splitting on punctuation - a quick subtitle burn if you have no script.

The inputs that matter

Most fields you'll leave alone. The ones worth touching:

  • audio (AUDIO, required) - from LoadAudio or any audio node. This is the only non-optional input.
  • reference_text - the transcript. Empty = raw Whisper transcription; filled = proofread alignment. This one choice changes what the node does.
  • engine_mode - pick your alignment backend. Default is stable-ts (cross-attention forced alignment); Whisper+LIS is the classic LIS algorithm from the README; the two Qwen3 modes swap in Qwen3-ASR, which the changelog says gives better coverage on music-backed audio. Note the README still only documents Whisper+LIS - the code's ahead of the docs here.
  • model_size - tiny→large-v3, default small. Accuracy scales with size, so does first-run download (small ~244MB, large-v3 ~1.5GB).
  • language - defaults to zh. Set it explicitly; auto-detect is a coin flip on Chinese.
  • max_chars - max characters per subtitle line (default 12). Too small → dozens of flickering entries; too big → wall-of-text lines.

Outputs

srt_string is the main event - standard SRT text you can save or feed straight into VideoSrtOverlay. detected_language and srt_entries are informational. coverage (0.0–1.0) is the useful diagnostic: in proofread mode it's how much of your transcript actually matched the audio, so a low number means your script and the recording disagree. audio_out is the UVR5-separated vocal track - a nice freebie if you enabled vocal separation.

Installing

Via ComfyUI Manager (search "ComfyUI-Audio-Srt-Aligner"), or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ahkimkoo/ComfyUI-Audio-Srt-Aligner
cd ComfyUI-Audio-Srt-Aligner
pip install -r requirements.txt
# restart ComfyUI

Don't believe the README when it implies you can skip audio-separator - the actual requirements.txt unconditionally installs audio-separator, stable-ts, qwen-asr and modelscope alongside faster-whisper. It's a heavy install, and that's the usual story for audio nodes in ComfyUI: real capability bolted on top of a dependency pile. First runs also auto-download the Whisper model to ComfyUI/models/stt/whisper/ and the UVR5 Roformer model (~1.8GB) to models/uvr5/ if you leave uvr5_mode on its default roformer.

Where people get burned

  • Apple Silicon: float16 may just not work - switch compute_type to int8.
  • Chinese audio: explicitly set language=zh, or auto-detect guesses wrong surprisingly often.
  • The first run looks frozen - it's downloading models. Watch the console.
  • jieba is imported by the node but missing from requirements.txt. It usually comes in transitively; if you hit an import error, pip install jieba fixes it.
  • Music-heavy audio where Whisper mumbles over the backing track? That's what the Qwen3 engine modes are for.
Categoryaudio/srt

Inputs (9)

NameTypeDefaultDescription
audioAUDIO
reference_textSTRING
model_sizeCOMBOsmall5 options: tiny, base, small, medium, large-v3
languageSTRINGzh
engine_modeCOMBOstable-ts4 options: Whisper+LIS, stable-ts, Qwen3 ASR+ForcedAligner, Qwen3 ASR+LIS
beam_sizeoptINT51–10
max_charsoptINT121–100
compute_typeoptCOMBOfloat164 options: int8, int8_float16, float16, float32
uvr5_modeoptCOMBOroformer3 options: roformer, mdxnet, none

Outputs (5)

NameTypeDescription
srt_stringSTRING
detected_languageSTRING
srt_entriesINT
coverageFLOAT
audio_outAUDIO