AV Speech Timestamp
Already have the transcript? Align it to the audio — AV Speech Timestamp
- audio
- text
- json_result
- asr_result
Most ASR nodes make you transcribe first and hope the model heard what you actually said. This one flips the question: you give it the text, and it tells you when each word happens in the audio. If you already have the words - a script, a lyric sheet, a better transcript from another tool - AV Speech Timestamp is the node that turns that text into timed subtitles without re-running recognition.
It's the sibling of AV ASR Timestamp in the ComfyUI-AV-FunASR pack, and the two cover different cases. AV ASR Timestamp transcribes and timestamps in one pass. This node doesn't transcribe at all: it takes your audio plus your text, and predicts where the words land.
How it works
The node loads a dedicated model - speech_timestamp_prediction-v1-16k-offline - which is exactly what its name says: a timestamp predictor, not a recognizer. It saves your audio as a 16kHz mono WAV, then calls FunASR's generate with the pair (audio, text) and a ("sound", "text") data type. The model aligns the supplied text to the audio and returns per-word start/end timestamps.
Two details from the source are worth knowing. First, it only needs the timestamp-prediction model - the big Paraformer ASR model and the VAD model that AV ASR Timestamp loads are not used here, so it's lighter on first-run setup if that's all you need. Second, the model is cached after the first call, and unload_model lets you free it from VRAM when you're done.
The inputs
- audio - a ComfyUI AUDIO output, from a LoadAudio node or any video node that emits audio.
- text - your transcript, as a string. This is the whole point of the node. It should match what's actually said in the audio; the model is aligning, not forgiving.
- unload_model - default
false. Flip it totrueif you want the model evicted from VRAM after the run.
The outputs mirror AV ASR Timestamp: text (the transcript, echoed back), json_result (full JSON with the timestamp array), and asr_result (the ASRRESULT object that feeds AV Format to Subtitle). The chain continues exactly as usual: AV Format to Subtitle → AV Save Subtitles.
When to reach for it
- Karaoke or lyric timing - you have the words; you just need the sync.
- Correcting a bad transcript - the pack's ASR is Chinese-first and makes mistakes on noisy audio. Run AV ASR Timestamp once, fix the transcript by hand or with a better recognizer, then re-align the corrected text here. You keep the good timestamps and fix the words.
- Scripted voiceovers - in the author's wider AV (audio-visual) workflow, timed text is the input for things like lip-sync and talking-head animation. If that's your endgame, you feed this node the script you already wrote.
The caveat is the flip side of its trick: if your text drifts from what's actually said, the alignment drifts too. It's an aligner, not a translator. Give it the right words and it's the most useful node in the pack; give it a paraphrase and you'll get timestamps that don't quite sit on the speech.
Installing and first run
cd ComfyUI/custom_nodes
git clone https://github.com/avenstack/ComfyUI-AV-FunASR.git
cd ComfyUI-AV-FunASR
pip install -r requirements.txt
restart, or grab it via ComfyUI Manager ("ComfyUI-AV-FunASR"). Then download speech_timestamp_prediction-v1-16k-offline from modelscope.cn and drop it under ComfyUI/models/ASR/FunASR/iic/ exactly as the README's tree shows - the node creates the folder but never fetches the model. And since the code imports funasr and torchaudio while requirements.txt doesn't list them, pip install funasr torchaudio if the node dies on import.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| text | STRING | — | |
| unload_model | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| json_result | STRING | — |
| asr_result | ASRRESULT | — |