Nodes/ComfyUI-fast-whisper/STT: AUDIO → WAV Filepath
ComfyUI Node

STT: AUDIO → WAV Filepath

Your audio is already in the graph — this node is how it gets to Whisper

By ai-joe-git·Created 7 months ago·Updated 7 months ago· 0
STT: AUDIO → WAV Filepath
  • audio
  • filepath
prefixstt_audio

The faster-whisper pipeline inside ComfyUI is picky in one specific way: its transcription node (FasterWhisperTranscription) wants a file path, not audio. The audio you actually care about, though, is usually already inside your graph as native AUDIO - loaded with VHS_LoadAudioUpload, pulled out of a video, or generated by a TTS node. AudioToWavFilepath is the adapter that bridges the two. It takes an AUDIO socket, writes the audio to a temporary WAV file, and hands you back the path so Whisper can read it.

This is a glue node, pure and simple. The upstream ComfyUI-faster-whisper pack had InputFilePath, which just validates a path you type by hand - fine if you're transcribing files on disk, useless if you want transcription to live inside a larger workflow. This fork (ai-joe-git/ComfyUI-faster-whisper) added AudioToWavFilepath as part of the audio-in/audio-out loop. In the included ARENA_VOICE_CLONING workflow it's the exact midpoint of a voice-clone roundtrip: load a reference clip → transcribe it → feed the text to a TTS clone node. The display name "STT: AUDIO → WAV Filepath" is honest about what it does - no API, no key, no magic.

How it works

Read the source and it's a small, careful bit of plumbing. The node takes the standard ComfyUI AUDIO dict (a waveform tensor plus a sample_rate), converts it to numpy, and squeezes it to handle the usual shapes: mono (samples,), stereo (channels, samples), or a batched (batch, channels, samples). It clamps the float waveform to [-1.0, 1.0], scales it to 16-bit PCM (multiply by 32767), and writes a real WAV to the system temp directory (comfyui_stt/) using Python's stdlib wave module - no ffmpeg, no extra deps. The filename is your prefix plus a millisecond timestamp, so repeated runs won't clobber each other. Then it returns that path as a FILEPATH string.

The inputs that matter

There are only two, and honestly only the first one needs your attention:

  • audio (AUDIO) - plug anything that outputs native audio here. VHS_LoadAudioUpload is the usual source; any TTS node's audio output works too.
  • prefix (STRING, default stt_audio) - the base name of the temp WAV. Change it only if you're trying to eyeball the temp file or avoid collisions with something else writing there.

Output: filepath (FILEPATH) - the string path of the WAV it just wrote. Wire this straight into FasterWhisperTranscription's audio input.

Where it sits in the workflow

VHS_LoadAudioUpload → AudioToWavFilepath → FasterWhisperTranscription → ...
                                                     └─ LoadFasterWhisperModel

That's the whole trick: the transcription node sees a plain path like /tmp/comfyui_stt/stt_audio_1756...wav, which is exactly what it expects. Downstream you can go two ways - FasterWhisperToSubtitle + SaveSubtitle for .srt/.vtt files, or TranscriptionsToText for a plain string.

Installing it

The pack installs like any custom node. ComfyUI Manager users: search ComfyUI-faster-whisper. Manual install:

cd ComfyUI/custom_nodes
git clone https://github.com/ai-joe-git/ComfyUI-faster-whisper
cd ComfyUI-faster-whisper
pip install -r requirements.txt

Portable installs use python_embeded\python.exe -m pip install -r ... instead. The real dependencies are faster-whisper==1.0.3, soundfile, and numpy - note that faster-whisper drags in CTranslate2, a chunky native package, so the first install can feel heavy. Models download automatically on first run into ComfyUI/models/faster-whisper (Systran's HuggingFace models; tiny.en is the CPU-friendly default).

Gotchas worth knowing

  • The WAV lives in your system temp dir, not ComfyUI's output. It's ephemeral by design. If you need to keep the audio, save it separately (or transcribe, then write your own copy) - this node is a bridge, not a storage solution.
  • The README is the upstream's. This fork's README still points at the original jhj0517/ComfyUI-faster-whisper repo and its subtitle workflow, so clone from ai-joe-git's URL if you want these two glue nodes - the original repo doesn't have them.
  • KMP_DUPLICATE_LIB_OK is set for you. The pack ships a fix for a known crash from the Whisper-WebUI line (issue #144); if you hit a duplicate-lib error elsewhere, don't fight it.

Transcription itself can hallucinate on music and silent stretches - that's a Whisper property, not this node's. For the wrapper that turns TRANSCRIPTIONS into readable text, see the sibling node TranscriptionsToText.

CategoryFasterWhisper

Inputs (2)

NameTypeDefaultDescription
audioAUDIO
prefixSTRINGstt_audio

Outputs (1)

NameTypeDescription
filepathFILEPATH