Nodes/ComfyUI-Transformers/Speech Recognition (ASR)
ComfyUI Node

Speech Recognition (ASR)

Whisper ASR

By kadirnar·Created 3 years ago·Updated 7 months ago· 25
Speech Recognition (ASR)
    • transcribed_text
    audio_path
    model_nameopenai/whisper-tiny
    languageenglish

    Speech Recognition (ASR) turns spoken audio into text, and this node does it with Whisper. Point it at an audio file, get back a transcript. If you're building anything in ComfyUI that involves people talking - analyzing a video's dialogue, generating subtitles, captioning narration for a pipeline - this is the node that gets the words out of the sound.

    It wraps Hugging Face's automatic-speech-recognition pipeline, defaulting to openai/whisper-tiny. Whisper needs no introduction by now: OpenAI's speech-to-text model, robust across languages and accents, and tiny is the smallest, fastest variant (~39M parameters). The node loads the model from the Hub with trust_remote_code=True, runs it on your file, and passes along a language hint to the generation step.

    The inputs that matter

    • audio_path - a string pointing to an audio file on disk. This is the input to get right: like the rest of this pack's audio nodes, it's a file path, not an audio signal. You need something upstream that saved audio to disk, or a file-path string you already have.
    • model_name - the Hub model ID. Default openai/whisper-tiny; swap to openai/whisper-base or -small for noticeably better accuracy at the cost of speed and VRAM.
    • language - a language hint, default english. Pass the language to keep Whisper from guessing; it maps onto Whisper's generation kwargs. Leave it blank to let the model auto-detect.

    The single output, transcribed_text, is a STRING - display it, save it, or feed it onward.

    How to install it

    Same pack install as every node here: ComfyUI Manager (search "ComfyUI-Transformers") or

    cd ComfyUI/custom_nodes
    git clone https://github.com/kadirnar/ComfyUI-Transformers
    

    Restart ComfyUI. The pack's requirements.txt pulls in transformers>=4.42, torch, numpy, and - importantly for audio - scipy and soundfile. Whisper-tiny is only ~75MB, so the first-run download is one of the quicker ones.

    Where people get burned

    The path-string input is the recurring trap across the audio nodes in this pack: users expect to wire an audio output from a generation node straight in, and it won't connect. You need a node that produces a path on disk, or you feed in a path you already have. The other common complaint is transcript quality at the tiny end - whisper-tiny mangles accents and quiet speech. If accuracy matters, go up to base or small rather than debugging the prompt. And remember the first run after a restart loads the model fresh (per-session cache), so the first transcription is always the slow one.

    CategoryTransformers/Audio/SpeechRecognition

    Inputs (3)

    NameTypeDefaultDescription
    audio_pathSTRING
    model_nameSTRINGopenai/whisper-tiny
    languageSTRINGenglish

    Outputs (1)

    NameTypeDescription
    transcribed_textSTRING