Nodes/ComfyUI-lethris-dia2/🗣️ Dia2 TTS Generator
ComfyUI Node

🗣️ Dia2 TTS Generator

A whole AI dialogue scene out of one text box

By lord-lethris·Created 9 months ago·Updated 9 months ago· 1
🗣️ Dia2 TTS Generator
  • Voice_Sample_S1
  • Voice_Sample_S2
  • audio
  • timestamps_json
prompt[S1] Welcome to the Dia2 TTS Generator. [S2] Nice. Are we testing voices today? [S1] Yep. Just a quick demo. (laughs). [S2] Great. I hope I sound normal this time. [S1] No promises. Press Generate and find out.
seed0
model_file
tokenizer_file
mimi_id
device
dtype
use_cuda_graphtrue
verbosetrue
save_outputtrue
output_format
cfg_scale2.00
text_temperature0.60
text_top_k50
audio_temperature0.80
audio_top_k50

Most TTS in ComfyUI is "give me a voice that reads this." The Dia2 TTS Generator is the weirder, more fun one: it's built for scripted multi-speaker dialogue - two characters talking, with laughter, applause, coughs and car-engine sounds dropped into the middle of a sentence, plus word-level timestamps so you can subtitle it. Type a little screenplay, get a finished audio clip. That's the whole pitch, and it's a genuinely different corner than Kokoro or Chatterbox.

It's a wrapper around Dia2-2B, a 2B-parameter dialogue TTS from nari-labs (Apache 2.0), and the author - lord_lethris, a r/StableDiffusion regular who was building WAN 2.2 lip-sync workflows - bolted it into ComfyUI. The model is the real deal; the community's earlier Dia-1.6B got a proper launch thread and a following for exactly this "multi-voice podcast / character dialogue" use. If that's your use, this is the node you want. If you just need a narrator, go grab Chatterbox or Kokoro instead - Dia2 is English-only, capped around two minutes per generation, and pointed squarely at conversations.

How it works

Dia2 is an autoregressive decoder that predicts two token streams at once: text and audio, the audio side encoded with the Kyutai Mimi codec (24 kHz, ~12.5 Hz frames). It reads your script, switches speaker on [S1]/[S2] tags, and mixes in short action tokens like (laughs) or (applause) as their own audio events. Sampling is controlled the way you'd expect: a CFG scale, plus separate temperature/top-k for the text and audio streams. On the way out it hands you both the waveform and a JSON list of [word, seconds] alignments, which is exactly what a caption generator (or a lip-sync workflow) needs. The whole thing runs locally - no API, no key.

The inputs that matter

  • prompt - the script. One speaker per line, tags inline: [S1] Hi. (laughs) [S2] Hi yourself. The action tokens are listed in the README; (laughs), (applause), (sighs), (whispers), (screams) are the ones you'll actually use.
  • model_file / tokenizer_file - dropdowns that auto-populate from your models/Dia2/ folder. Just pick what you downloaded.
  • seed - set nonzero for reproducible audio.
  • device / dtype - auto picks CUDA + bfloat16 if a GPU is available, otherwise CPU. CPU works but is slow; this is a 2B model.
  • cfg_scale, text_temperature/text_top_k, audio_temperature/audio_top_k - the fun knobs. Defaults (CFG 2.0, text temp 0.6, audio temp 0.8) are sane; bump temperature if output feels robotic, lower it if it's getting garbled.
  • Voice_Sample_S1 / Voice_Sample_S2 (optional) - feed an AUDIO clip and Dia2 conditions on it as a voice reference. That's your zero-shot voice cloning, one clip per speaker.
  • output_format - wav, flac, or mp3.

Ignore mimi_id (empty uses the default Kyutai Mimi) and leave use_cuda_graph on.

Outputs: audio (a standard ComfyUI AUDIO tensor - wire it to Save Audio or an audio player node) and timestamps_json (a STRING, which is the input the sibling 💬 Dia2 Captions Generator node consumes).

Install

Best via ComfyUI Manager: search "Dia2 TTS & Captions Generators for ComfyUI" and install. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/lord-lethris/ComfyUI-lethris-dia2
cd ComfyUI-lethris-dia2
pip install -r requirements.txt

Then restart ComfyUI. The real work is the model. Download it from the nari-labs/Dia2-2B repo - the weights file is ~7.7 GB - and put it in ComfyUI/models/Dia2/:

  • model.safetensors → rename to Dia2-2B.safetensors
  • tokenizer.json and config.json (the README's download list skips the config, but the node hard-errors without it - grab all three)

The first generation also pulls the Kyutai Mimi codec from HuggingFace automatically.

Troubleshooting

  • GPU needs CUDA 12.8+. The README is blunt about it. If your drivers or PyTorch are older, you'll get slow CPU fallback at best and crashes at worst. Check torch.version.cuda before blaming the node.
  • "No Dia2 config found in model folder" - you followed the README's file list literally. Add config.json (see above).
  • "Dia2 package not available" - the bundled dia2 package imports transformers for the Mimi codec; a stripped-down ComfyUI env can miss it. pip install transformers fixes it.
  • Audio stops at ~2 minutes - that's a model limit (max context), not a bug. Split long scripts.
  • The node warns (harmlessly) if it finds weights in diffusion_models instead of Dia2.
Categorylethris🧠/Dia2

Inputs (18)

NameTypeDefaultDescription
promptSTRING[S1] Welcome to the Dia2 TTS Generator. [S2] Nice. Are we testing voices today? [S1] Yep. Just a quick demo. (laughs). [S2] Great. I hope I sound normal this time. [S1] No promises. Press Generate and find out.
seedINT00–4294967295
model_fileCOMBO1 options:
tokenizer_fileCOMBO1 options:
mimi_idSTRING
deviceCOMBO3 options: auto, cuda, cpu
dtypeCOMBO4 options: auto, bfloat16, float16, float32
use_cuda_graphBOOLEANtrue
verboseBOOLEANtrue
save_outputBOOLEANtrue
output_formatCOMBO3 options: mp3, flac, wav
cfg_scaleFLOAT2.000–10
text_temperatureFLOAT0.600–2
text_top_kINT501–1000
audio_temperatureFLOAT0.800–2
audio_top_kINT501–1000
Voice_Sample_S1optAUDIO
Voice_Sample_S2optAUDIO

Outputs (2)

NameTypeDescription
audioAUDIO
timestamps_jsonSTRING