Nodes/ComfyUI_MooER/MooER_Sampler
ComfyUI Node

MooER_Sampler

Where the Audio Actually Becomes Text

By smthemex·Created 2 years ago·Updated about a year ago· 5
MooER_Sampler
  • audio
  • model
  • tokenizer
  • cmvn
  • ASR_text
  • AST_text
asr_promptTranscribe speech to text.
ast_promptTranslate speech to english text.
audio_dir
adapter_downsample_rate2
prompt_key

The first node in this pack dragged a 7B LLM into your graph. This one does something with it. MooER_Sampler is where the actual transcribing happens: feed it an AUDIO clip plus the model, tokenizer, and cmvn from MooER_LoadModel, and it hands you two strings - a transcript and, when you ask for it, an English translation.

Inside it's a mini audio-LLM inference pipeline that mirrors MooER's official demo. The audio gets resampled to 16kHz and flattened to mono, converted to a filter-bank (fbank) spectrogram, run through LFR (m=7, n=6) and CMVN normalization using the stats from LoadModel, then downsampled by adapter_downsample_rate and packed into the Qwen chat prompt before model.generate(). When the model is the ASR_AST multitask version, the decoded text comes back as two lines - transcript first, translation second - and the node splits them into the two outputs.

The inputs that matter:

  • audio - AUDIO, straight out of ComfyUI's core LoadAudio node. That's your whole front end.
  • model, tokenizer, cmvn - all three come from MooER_LoadModel. There's no way around loading the big model first.
  • asr_prompt / ast_prompt - the LLM instruction. Defaults are "Transcribe speech to text." and "Translate speech to english text." You can edit them, and prompt_key (asr or ast) decides which one actually gets sent.
  • adapter_downsample_rate - divides the encoder output sequence. Leave it at 2; the README itself says this one's untested.
  • audio_dir - batch transcription from a folder of wavs you drop into ComfyUI/input/mooer_files/. Also flagged "not tested" by the author, so single-file mode is the reliable path.

Both outputs, ASR_text and AST_text, are STRING. Wire them into ShowText or SaveText - that's the point, text is data in ComfyUI. One gotcha: if you're running an ASR-only mode, AST_text comes back as the placeholder "need ast or asr_ast." instead of a translation. That's expected behavior, not a bug.

Install is the same pack as MooER_LoadModel - grab ComfyUI_MooER via Manager or git clone https://github.com/smthemex/ComfyUI_MooER.git, run pip install -r requirements.txt (just modelscope and fire), and let LoadModel handle the downloads. Beyond that, three things tend to bite:

  • It's a 7B model. A few seconds of audio means a few seconds of generation on a decent GPU, and fp16 weights alone are ~14-15GB - plan on a 16GB+ card. The first run after load also has to merge the LoRA, so the first generate is the slowest.
  • Non-wav audio needs ffmpeg. The pack checks for it at startup and adds FFMPEG_PATH to your PATH. If mp3s won't load, that's the first thing to verify.
  • Everything stalls upstream. If the graph hangs forever, it's usually LoadModel's giant first download, not this node.

Bottom line: if you want local, in-graph speech-to-text with a real LLM doing the decoding, this is one of the few options that works as advertised - for ASR, anyway. Keep expectations realistic for translation and batch mode and it'll treat you right.

CategoryMooER

Inputs (9)

NameTypeDefaultDescription
audioAUDIO
modelMODEL
tokenizerMODEL
cmvnMODEL
asr_promptSTRINGTranscribe speech to text.
ast_promptSTRINGTranslate speech to english text.
audio_dirCOMBO1 options: none
adapter_downsample_rateINT20–10
prompt_keyCOMBO2 options: asr, ast

Outputs (2)

NameTypeDescription
ASR_textSTRING
AST_textSTRING