Views
No views yet
Requirement — install uv and use CUDA 12.8+ drivers. All commands below run throughuv run …as a rule.
uv syncinput.txt using [S1] / [S2] speaker tags.1uv run -m dia2.cli \
2 --hf nari-labs/Dia2-2B \
3 --input input.txt \
4 --cfg 2.0 --temperature 0.8 \
5 --cuda-graph --verbose \
6 output.wav--device / --dtype if needed.1uv run -m dia2.cli \
2 --hf nari-labs/Dia2-2B \
3 --input input.txt \
4 --prefix-speaker-1 prefix_speaker1.wav \
5 --prefix-speaker-2 prefix_speaker2.wav \
6 --cuda-graph --verbose \
7 output_conditioned.wavuv run gradio_app.py1from dia2 import Dia2, GenerationConfig, SamplingConfig
2
3dia = Dia2.from_repo("nari-labs/Dia2-2B", device="cuda", dtype="bfloat16")
4config = GenerationConfig(
5 cfg_scale=2.0,
6 audio=SamplingConfig(temperature=0.8, top_k=50),
7 use_cuda_graph=True,
8)
9result = dia.generate("[S1] Hello Dia2!", config=config, output_wav="hello.wav", verbose=True)max_context_steps (1500, 2 minutes)
or until EOS is detected. GenerationResult includes audio tokens, waveform tensor,
and word timestamps relative to Mimi’s ~12.5 Hz frame rate.| Variant | Repo |
|---|---|
| Dia2-1B | nari-labs/Dia2-1B |
| Dia2-2B | nari-labs/Dia2-2B |