ComfyUI Node

speech2text

Speech2text

By ForeignGods·Created 2 years ago·Updated 2 years ago· 248
speech2text
    • transcription
    • raw_string
    • framestamps_string
    • timestamps_string
    audio_file
    wav2vec2_modelailegends/xlsr-jonatasgrosman-wav2vec2-large-xlsr-53-english
    spell_check_languageEnglish
    framestamps_max_chars25
    fps

    speech2text is Mana Nodes' audio-to-transcript node - the older name for what the pack now labels Speech Recognition. Point it at an audio file and it returns the spoken words plus timing, shaped so the pack's text renderer can turn them into synced captions. Same job, older label; if you've got a workflow that references speech2text, this is the node it wants.

    Why you'd reach for it

    It's the transcription step in an all-in-Comfy captioning pipeline. Instead of exporting audio to some other transcription tool and copying timings back, you keep it in the graph: audio in, timed text out, straight into a font2img / Text to Image Generator node to draw the captions. Handy for lyric videos, captioned shorts, or any clip where you want words on screen when they're spoken.

    How it works

    It runs a Wav2Vec2 speech-recognition model from HuggingFace. Fair warning on the model family: Wav2Vec2 is capable but it's the older-school pick these days - a lot of newer caption setups use Whisper - and it typically emits ALL CAPS with no punctuation. For bold kinetic captions that's honestly fine; for clean subtitles you'll want the built-in spell-check pass and probably a manual cleanup.

    The inputs that matter

    • audio_file - path or URL to the audio; usually the audio track a video2audio / Split Video node pulled out of your clip.
    • wav2vec2_model - which checkpoint to run. The dropdown carries a thousand Wav2Vec2 models from HuggingFace. The default is an xlsr English model; swap it for a matching-language checkpoint (Italian, Persian, Mongolian, and many more are listed) if your audio isn't English.
    • spell_check_language - language for the cleanup pass; eleven options. Match it to the audio.
    • framestamps_max_chars - default 25. How many characters build up on screen before the caption line resets. This is your "how much text shows at once" dial.
    • fps (optional here) - frame rate for converting times into frame numbers. Set it to your video's fps or the captions will drift.

    Outputs match Speech Recognition: transcription (the TRANSCRIPTION type that feeds the generator), raw_string (plain sentence), framestamps_string (frame-keyed text), and timestamps_string (per-word start/end times as JSON).

    Installing it

    It's part of Mana Nodes. ComfyUI Manager → search Mana Nodes → install → restart. Or clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ForeignGods/ComfyUI-Mana-Nodes.git
    

    Install requirements and restart. First run of any transcription downloads the chosen Wav2Vec2 model from HuggingFace - the default is north of a gigabyte - so expect a wait the first time; it's caching the model, not stuck.

    Common issues

    Naming first: if a fresh install doesn't show a node literally called speech2text, look for Speech Recognition - the pack renamed it. They're the same node; a downloaded workflow using the old name may need rewiring to the current one.

    Then the usual caption traps. fps mismatch is the big one - the timing is stored as frame numbers, so the node's fps has to equal your video's fps or the words slide out of sync as the clip runs. Accuracy is the other: Wav2Vec2 flubs words on noisy or musical audio. The pack's intended remedy is to save the framestamps_string (via string2file / Save/Preview Text), fix the errors by hand, and paste the corrected framestamps directly into the renderer's text field with the transcription input removed. And for non-English audio, change both the model checkpoint and the spell-check language.

    CategoryMana Nodes

    Inputs (5)

    NameTypeDefaultDescription
    audio_fileSTRING
    wav2vec2_modelCOMBOailegends/xlsr-jonatasgrosman-wav2vec2-large-xlsr-53-english1000 options: jonatasgrosman/wav2vec2-large-xlsr-53-english, ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition, facebook/wav2vec2-base-960h, m3hrdadfi/wav2vec2-base-100k-gtzan-music-genres, Lajavaness/wav2vec2-lg-xlsr-fr-speech-emotion-recognition, facebook/wav2vec2-lv-60-espeak-cv-ft, +994
    spell_check_languageCOMBOEnglish11 options: English, Spanish, French, Portuguese, German, Italian, +5
    framestamps_max_charsINT25
    fpsoptINT

    Outputs (4)

    NameTypeDescription
    transcriptionTRANSCRIPTION
    raw_stringSTRING
    framestamps_stringSTRING
    timestamps_stringSTRING