Nodes/PromptModels Studio/Grok Speech to Text (PMS)
ComfyUI Node

Grok Speech to Text (PMS)

The transcription half of the voice pipeline

By cdanielp·Created 9 months ago·Updated 2 months ago· 28
Grok Speech to Text (PMS)
  • audio
  • transcripcion
  • idioma_detectado
languagees
api_key

If you've got audio in a ComfyUI graph, eventually you'll want words out of it. That's this node: feed it an AUDIO tensor, get a transcription string. It's the speech-to-text sibling of the pack's Grok TTS node, hitting xAI's transcription API over REST and returning the text - plus the language it thinks was spoken.

Where does this actually live in a workflow? ComfyUI has no native audio loading in the default node set, so you'll typically pair it with a node that can produce an AUDIO tensor - a VHS/VL node loading an audio track, or the pack's own TTS nodes feeding it their own output (a genuinely fun loop: Grok speaks, Grok listens). Once you have transcripcion as a string, the classic move is feeding it into a Gemini or Grok chat node for summarization, keyword extraction, or caption generation. The whole pipeline stays inside one graph.

The inputs that matter

  • audio - a ComfyUI AUDIO tensor ({waveform, sample_rate}). This is a required wire input, not a text field.
  • language - ISO 639-1 code, default es. Set it to what you expect to hear; it also influences which transcription model path gets used.
  • api_key - leave blank; resolved from .env as XAI_API_KEY.

Outputs

transcripcion (STRING) - the transcribed text. idioma_detectado (STRING) - the language code xAI identified. On error, transcripcion carries the error text and idioma_detectado falls back to whatever you set in language.

Installing it

ComfyUI Manager → search "COMFYUI_PROMPTMODELS" → install → restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/cdanielp/COMFYUI_PROMPTMODELS

Create a .env in the pack folder with XAI_API_KEY=xai-... and restart ComfyUI. Requires ComfyUI >= 0.26.0; dependencies are requests and Pillow only. No ffmpeg needed here - the node converts the tensor to WAV in-memory before sending.

The gotchas

The billing reality applies double here: transcription costs per minute of audio, so transcribing a long file is a real spend, and there's no free tier to hide in. Test on a ten-second clip before committing an hour of audio.

Second, the input is a tensor, and ComfyUI's audio handling is genuinely inconsistent across node packs - different packs emit slightly different AUDIO dicts. If the node chokes on an audio source, check that the upstream node is producing a standard {waveform, sample_rate} structure. And as with the whole pack: XAI_API_KEY in .env, not in the node field, or your key rides along in every saved workflow and PNG.

CategoryPromptModels/Grok

Inputs (3)

NameTypeDefaultDescription
audioAUDIOTensor AUDIO de ComfyUI {waveform, sample_rate}.
languageoptSTRINGesCódigo ISO 639-1. ej: es, en, fr.
api_keyoptSTRING

Outputs (2)

NameTypeDescription
transcripcionSTRING
idioma_detectadoSTRING