Nodes/Dia realistic TTS/Generate speech
ComfyUI Node

Generate speech

TTS that does dialogue, not just narration

By rkfg·Created about a year ago·Updated about a year ago· 0
Generate speech
  • model
  • audio_prompt
  • AUDIO
text[S1] Hello! [S2] Hi!
max_tokens3072
temperature1.30
cfg_scale3.0
top_p0.95
top_pcfg_filter_top_k30
speed_factor0.94
seed0
use_torch_compiletrue

Most TTS nodes read one line of text and hand you a flat narrator voice. DiaSampler (displayed as "Generate speech") is the other thing. It's the sampler half of the rkfg/ComfyUI-Dia_tts pack, a wrapper around Nari Labs' Dia, a 1.6B model built for dialogue - two or more speakers trading lines in a single clip, each with their own voice. You feed it text tagged [S1] and [S2], it hands back a 44.1 kHz waveform, and the result sounds like two people talking instead of a text-to-speech engine with dramatic pauses. It all runs on your GPU - no API key, no cloud - which is why r/StableDiffusion had a 244-point "new TTS model" thread the day it dropped.

How it works

Dia is an autoregressive transformer, not a diffusion model (yes, it's confusingly living inside a diffusion app). It tokenizes your text, predicts a stream of audio code tokens one at a time, and decodes them back into sound through Descript's DAC codec - that's the descript-audio-codec dependency. The pack splits this into two nodes: DiaModelLoader grabs the weights, and DiaSampler runs the generation loop with CFG, top-p sampling, and a temperature on top of the token prediction.

The inputs that matter

Most of the knobs are standard LLM sampling fare, and the defaults are genuinely good. The ones you'll actually touch:

  • text - multiline, defaulting to [S1] Hello!\n[S2] Hi!. [S1] and [S2] mark distinct speakers; each line is a turn. Keep lines short - the model loves to run long.
  • max_tokens (3072, min 860) - caps how many audio tokens it generates. Bigger cap, longer clip; the 860 floor is baked into the model's training length.
  • temperature (1.3), cfg_scale (3), top_p (0.95), top_pcfg_filter_top_k (30) - the sampling knobs. Flat or garbled voices? Nudge temperature. Drifting off-topic? Bump CFG.
  • speed_factor (0.94) - resamples the final waveform, so below 1.0 comes out slightly slower and more relaxed; 1.0 is native speed. It's plain resampling, not a fancy time-stretch, so it shifts pitch a touch too.
  • seed - set it for reproducible takes, same way you do for image gen.
  • use_torch_compile (on by default) - makes the first generation pay a long compile cost. If the node sits there doing nothing for minutes, this is why; flip it off.

The output is a single AUDIO at 44.1 kHz. Wire it into any audio-save or VHS node to write a WAV.

Voice cloning

The optional audio_prompt input is where this gets fun. Drop in a short reference clip and Dia encodes it into DAC tokens and uses it as an acoustic prompt - you get a voice that isn't one of the built-in speakers. One honest caveat from the community: this is more "a different voice of the same gender" than a faithful clone, and Dia is a podcast tool, not an assistant-style TTS bot.

Installing it

Use ComfyUI Manager and search "Dia TTS" (the pack's title is "Dia realistic TTS"), or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/rkfg/ComfyUI-Dia_tts
# restart ComfyUI

It needs torchaudio and descript-audio-codec, which the pack's requirements.txt installs. The first run downloads the Dia-1.6B weights plus a DAC checkpoint from HuggingFace, so budget a few gigabytes and a working network connection.

Where people get burned

  • VRAM. Dia is a 1.6B model running in bf16; community reports put it around 10 GB, though people do run it on 6 GB cards with ComfyUI shuffling weights. The node calls unload_all_models() before sampling, so it boots your image and video checkpoints out of VRAM first - don't panic when they unload.
  • The long first generation. With torch.compile on by default, the first step compiles and can take a while - or fail outright on odd torch/CUDA combinations. Turn it off if it hangs.
  • It goes on too long. Short lines and a sane max_tokens keep the pacing under control; the model really will talk for a while if you let it.
CategoryDia TTS

Inputs (11)

NameTypeDefaultDescription
textSTRING[S1] Hello! [S2] Hi!
max_tokensINT3072860–16384
temperatureFLOAT1.300.7–1.5
cfg_scaleFLOAT3.01–5
top_pFLOAT0.950.8–1
top_pcfg_filter_top_kINT3015–50
speed_factorFLOAT0.940.8–1
seedINT00–18446744073709550000
use_torch_compileBOOLEANtrue
modelTTSMODEL
audio_promptoptAUDIO

Outputs (1)

NameTypeDescription
AUDIOAUDIO