Nodes/ComfyUI-SRT-subtitles-VoxCPM/VoxCPM SRT Auto-Dubber (Line-by-Line Ref)
ComfyUI Node

VoxCPM SRT Auto-Dubber (Line-by-Line Ref)

Translate the subtitles, and it teaches itself the voice line by line

By judian17·Created 11 months ago·Updated 11 months ago· 7
VoxCPM SRT Auto-Dubber (Line-by-Line Ref)
  • model
  • original_audio
  • AUDIO
◄source_srt_textSource Language SRT (Transcript)...►
◄target_srt_textTarget Language SRT (Translation)...►
◄normalize_texttrue►
◄stretch_methodlibrosa►
◄keep_model_loadedtrue►
◄stretch_n_fft320►
◄stretch_hop_length8►
◄cfg_value2.0►
◄inference_timesteps30►
◄seed-1►
◄retry_max_attempts3►
◄retry_threshold6.00►

This is the node that does the "dub this video into another language" party trick. Unlike the regular Dubber - which needs you to build a voiceprint cache for each speaker beforehand - the Auto-Dubber learns the voice from the source audio itself, one line at a time. You hand it the original recording plus two SRT files (the transcript and its translation), and it re-speaks the whole thing in the target language while keeping the original timing. The pack's third example workflow, SRT_VoxCPM_transfer.json, is built entirely around it.

How it works

For each line in the target SRT, it:

  1. Finds the matching line in the source SRT by index number, and cuts that segment out of the original audio as a reference clip.
  2. Builds a fresh voiceprint cache from that clip on the fly (the code comments call this the soul of the node - every line gets its own reference, so the voice tracks the original speaker closely, emotion and all).
  3. Generates the translated text with VoxCPM, time-stretches it to fit the target line's duration, and places it on a fresh timeline.

Because each line clones from its own source segment, you don't need any Cache Builder or Cache Combiner nodes at all. Inputs are model, original_audio, source_srt_text (the transcript), target_srt_text (the translation), plus the usual normalize_text, stretch_method, cfg_value, inference_timesteps, seed, retry_max_attempts/retry_threshold and keep_model_loaded. Output is a mono AUDIO at the original file's sample rate.

The gotcha nobody warns you about

The Auto-Dubber writes to a fully silent canvas - the output is only the new voice. No music, no ambience, no original background. The code comment is blunt about it: the node assumes you can't cleanly separate background from voice, so it gives you clean speech and lets you mix it back yourself in ComfyUI. If your source has background music, plan on an audio-mix step (and accepting that the parts you replaced lost their bed).

Line matching is by index: a target line numbered 7 looks for a source line numbered 7, and if it's missing, that line is silently skipped. Also note the per-line cache build means the model is invoked twice per line (once to clone, once to speak), so this node is noticeably slower than the Processor. It's the cost of not needing any upfront voiceprint work.

Installing it

One of eight nodes in judian17/ComfyUI-SRT-subtitles-VoxCPM:

cd ComfyUI/custom_nodes
git clone https://github.com/judian17/ComfyUI-SRT-subtitles-VoxCPM

Restart, or install via ComfyUI Manager (search "SRT subtitles VoxCPM"). The model auto-downloads to models/TTS on first run; the pack needs librosa (for the default stretch method and resampling), and pydub if you switch to its stretch mode, which also demands FFmpeg in PATH. It's not covered in the README's node list, but it ships in the code and the transfer workflow - a sign the author added it after the docs were written.

Categoryaudio/tts

Inputs (14)

NameTypeDefaultDescription
modelVOXCPM_MODEL—
original_audioAUDIO—
source_srt_textSTRINGSource Language SRT (Transcript)...—
target_srt_textSTRINGTarget Language SRT (Translation)...—
normalize_textBOOLEANtrue—
stretch_methodCOMBOlibrosa3 options: none, librosa, pydub
keep_model_loadedBOOLEANtrue—
stretch_n_fftINT320128–8192—
stretch_hop_lengthINT88–2048—
cfg_valueFLOAT2.01–10—
inference_timestepsINT301–100—
seedINT-1-1–9223372036854776000—
retry_max_attemptsINT30–10—
retry_thresholdFLOAT6.002–20—

Outputs (1)

NameTypeDescription
AUDIOAUDIO—