Nodes/ComfyUI DMOSpeech2 Node/RunningHub DMOSpeech2
ComfyUI Node

RunningHub DMOSpeech2

Voice cloning with a trainer for pacing

By HM-RunningHub·Created about a year ago·Updated about a year ago· 11
RunningHub DMOSpeech2
  • ref_audio
  • audio
gen_text猫猫真是太帅了,帅的我愿意每个月给他五十万块钱
seed20
ref_text

This is a text-to-speech node, and it's a weird one to find in ComfyUI - in a good way. It's a port of DMOSpeech2, a research model from the F5-TTS author (you know, the open voice-cloning TTS that actually sounds good). What DMOSpeech2 adds on top of F5-TTS is the interesting bit: it trains a duration predictor with reinforcement learning (GRPO) so the generated speech lands on the right length instead of just rattling out whatever the diffusion model feels like. If you've heard the classic F5-TTS failure where it rushes or drags the pacing, this is the attempt to fix exactly that.

One honest caveat before you commit to this: the node has essentially no community footprint. F5-TTS itself is well-known and still talked about, but "DMOSpeech2" gets you nothing on reddit, and this pack ships with zero installs. You're early-adopting a research port, not installing a polished tool. If you just want quick F5-TTS in ComfyUI, this is a solid route; if you want battle-tested, look elsewhere.

How it works

The node wires up four moving parts under the hood. First it takes your reference audio, resamples it to 24 kHz, and turns it into mel spectrograms. Then a duration predictor (model_1500.pt) reads the reference text plus your target text and estimates how many frames of speech you need - that's the RL-trained piece, and it replaces F5-TTS's crude "length ≈ characters ÷ speed" heuristic. Then the teacher model (model_85000.pt) runs a hybrid DDIM/DDPM flow ODE over ~16 steps while a distilled student finishes the job in four quick jumps - classic teacher-student distillation, same family as LCM, just for audio instead of images. Finally a Vocos vocoder turns the mel back into a waveform at 24 kHz.

Everything runs on CUDA (device="cuda" is hardcoded), and the node prints an RTF (real-time factor) to the console so you can see how fast the actual generation was - which matters, because…

The inputs that matter

Only three are required, plus one optional. The node passes a fixed set of generation parameters (cfg_strength 2.0, 16 teacher steps) so you don't tune anything:

  • ref_audio (AUDIO) - the clip whose voice you're cloning. Wire in any audio from ComfyUI. Keep it clean and under ~15 seconds; the model conditions on it.
  • gen_text (STRING) - what you want said. Default is Chinese ("猫猫真是太帅了…"), which makes sense: the pinyin tokenizer is trained on the Emilia Chinese+English dataset. English works fine too, so don't let the default scare you off.
  • seed (INT) - noise seed, default 20. Change it for variety on repeated runs.
  • ref_text (STRING, optional) - the transcript of your reference clip. Leave it blank and the node fires up Whisper large-v3-turbo to transcribe the audio for you; supply it and you skip that step entirely.

Output is a single audio (AUDIO) you can feed into a VHS/preview node or save to disk.

Installing it

The code install is easy; the models are the actual work. Via ComfyUI Manager, search "DMOSpeech2" and install "ComfyUI DMOSpeech2 Node", or:

cd ComfyUI/custom_nodes
git clone https://github.com/HM-RunningHub/ComfyUI_RH_DMOSpeech2.git
cd ComfyUI_RH_DMOSpeech2
pip install -r requirements.txt

That requirements file is the full F5-TTS stack - gradio, wandb, accelerate, x_transformers - and it pins things like numpy<=1.26.4 and pydantic<=2.10.6 that can fight your other custom nodes. Install in a clean-ish env, and note bitsandbytes won't install on macOS/arm64.

Then the downloads, all into ComfyUI/models/DMOSpeech2/:

cd ComfyUI/models/DMOSpeech2
mkdir -p ckpts Emilia_ZH_EN_pinyin vocos-mel-24khz whisper-large-v3-turbo
# ckpts/: model_85000.pt + model_1500.pt from yl4579/DMOSpeech2 on HF
# Emilia_ZH_EN_pinyin/: vocab.txt (from the E2-F5-TTS space)
# vocos-mel-24khz/: config.yaml + pytorch_model.bin (charactr/vocos-mel-24khz)
# whisper-large-v3-turbo/: the full openai Whisper model

That's roughly 3+ GB of weights across four locations, and the node does not auto-download any of it. Miss one and it fails at load time with a path error.

Gotchas

The big one: the model is constructed on every execution. Each run re-loads the student checkpoint, the teacher, Vocos, the duration predictor - and Whisper, if you left ref_text blank - so the first generation on any run is slow no matter how fast the actual sampling is. If you're iterating on a workflow, supply ref_text and accept the per-run load tax. Also: no CPU fallback, so this is GPU-only, and the model is Chinese-centric - while English works, the pacing trick is tuned on Emilia-style ZH/EN data, and genuinely bilingual output isn't its wheelhouse. It's a niche, bleeding-edge TTS node with real quality potential and real setup friction.

CategoryRunninghub/DMOSpeech2

Inputs (4)

NameTypeDefaultDescription
ref_audioAUDIO
gen_textSTRING猫猫真是太帅了,帅的我愿意每个月给他五十万块钱
seedINT200–18446744073709550000The random seed used for creating the noise.
ref_textoptSTRING

Outputs (1)

NameTypeDescription
audioAUDIO