ComfyUI Node

Generate SRT

Turn a raw transcript into timed subtitles

By YanTianlong-01·Created 7 months ago·Updated 2 months ago· 11
Generate SRT
  • forced_aligns
  • srt_string
text
language
save_srttrue
filename_prefixVoiceBridge_subtitle

A transcript is a wall of text with no clock. An SRT file is that same text chopped into subtitle-sized chunks, each stamped with a start and end time. This node is the machine that does the chopping and stamping - it sits at the very end of VoiceBridge's transcription chain and produces the subtitle file you actually want to ship.

What it actually does

Wire it after VoiceBridge ASR Transcribe and it turns three things - the word-level forced alignment list, the full transcribed text, and a language name - into a properly formatted SRT string. It does this in three passes you can watch happen in the console (the pack logs everything with a [VoiceBridge] prefix):

  1. Segmentation. The raw text is split into subtitle-sized segments using punctuation as the break points. Which punctuation depends on the language input: "Chinese" splits on ,。!?;:, everything else splits on ,.!?;:. The splitter is polite about numbers, so 3.5 and times like 10:30 don't get ripped apart mid-value.
  2. Timing. Each segment is mapped to a start/end time by walking through the word-level timestamps in forced_aligns - that's why this node needs the forced aligner hooked up on the ASR loader side (see VoiceBridge ASR Loader). No word timestamps, no subtitle timing; they're the same thing here.
  3. Cleanup and output. Overlapping or stray segments get adjusted, tiny filler words like "hi" and "hey" get merged into the previous line, and the result is emitted as a standard N\n00:00:01,000 --> 00:00:03,200\nText SRT string.

The inputs that matter

  • forced_aligns (LIST) - comes straight from the forced_aligns output of VoiceBridge ASR Transcribe. This is the timing source; don't skip it.
  • text (STRING) - the transcript, usually the text output of the transcribe node.
  • language (STRING) - mostly a segmentation switch here, so get it right: "Chinese" uses Chinese punctuation rules, anything else uses English ones.

The two optional inputs are less interesting: save_srt defaults to True, which means the node writes a .srt file into ComfyUI/output/ as a side effect, and filename_prefix (default VoiceBridge_subtitle) is the base name - if the file already exists it gets _1, _2, and so on appended rather than overwritten. Set save_srt to False if you only want the string, for example when you're going to edit it before saving.

The single output is srt_string, and it feeds anything that eats SRT text: SRT To Audio for the legacy pipeline, VoiceBridge SRT Splitter for the decoupled one, Save SRT From String if you want the file saved somewhere specific, or just a text preview node.

Installing and running it

This node ships in the comfyui_voicebridge pack. Install via ComfyUI Manager (search "VoiceBridge") or:

cd ComfyUI/custom_nodes
git clone https://github.com/YanTianlong-01/comfyui_voicebridge.git
cd comfyui_voicebridge
pip install -r requirements.txt

Restart ComfyUI after installing. The heavy lifting here is upstream: you need the ASR model (auto-downloaded into ComfyUI/models/Qwen3-ASR/ on first use) and the Qwen3-ForcedAligner-0.6B model selected on the loader, or Generate SRT has no timestamps to work with.

Where people get burned

The most common failure is wiring a plain text output into Generate SRT and expecting timing out of nowhere - it doesn't work that way. If your SRT comes out as one giant untimed block, check that return_timestamps is enabled on the transcribe node and that a forced aligner is loaded. The language mismatch is the other classic: transcribe in Chinese but leave language at its default, and the segmentation will be looking for English punctuation that isn't there. And remember this pack is young - 0 impressions and basically no community write-ups yet, so the console logs are your friend.

CategoryVoiceBridge

Inputs (5)

NameTypeDefaultDescription
forced_alignsLIST
textSTRING
languageSTRING
save_srtoptBOOLEANtrue
filename_prefixoptSTRINGVoiceBridge_subtitle

Outputs (1)

NameTypeDescription
srt_stringSTRING