dia README

The project's README from github.com/nari-labs/dia. As one markdown file: README.md.

Static Badge LICENSE

Model on HuggingFace Space on HuggingFace

Dia is a 1.6B parameter text to speech model created by Nari Labs.

UPDATE 🤗(06/27): Dia is now available through Hugging Face Transformers!

UPDATE 🚀(11/19): Dia2 is released on Github and HuggingFace link!

Dia directly generates highly realistic dialogue from a transcript. You can condition the output on audio, enabling emotion and tone control. The model can also produce nonverbal communications like laughter, coughing, clearing throat, etc.

To accelerate research, we are providing access to pretrained model checkpoints and inference code. The model weights are hosted on Hugging Face. The model only supports English generation at the moment.

We also provide a demo page comparing our model to ElevenLabs Studio and Sesame CSM-1B.

Generation Guidelines

Quickstart

Transformers Support

We now have a Hugging Face Transformers implementation of Dia! You should install main branch of transformers to use it. See hf.py for more information.

View more details

Install main branch of transformers

pip install git+https://github.com/huggingface/transformers.git
# or install with uv
uv pip install git+https://github.com/huggingface/transformers.git

Run hf.py. The file is as below.

from transformers import AutoProcessor, DiaForConditionalGeneration


torch_device = "cuda"
model_checkpoint = "nari-labs/Dia-1.6B-0626"

text = [
    "[S1] Dia is an open weights text to dialogue model. [S2] You get full control over scripts and voices. [S1] Wow. Amazing. (laughs) [S2] Try it now on Git hub or Hugging Face."
]
processor = AutoProcessor.from_pretrained(model_checkpoint)
inputs = processor(text=text, padding=True, return_tensors="pt").to(torch_device)

model = DiaForConditionalGeneration.from_pretrained(model_checkpoint).to(torch_device)
outputs = model.generate(
    **inputs, max_new_tokens=3072, guidance_scale=3.0, temperature=1.8, top_p=0.90, top_k=45
)

outputs = processor.batch_decode(outputs)
processor.save_audio(outputs, "example.mp3")

Run with this repo

Install via pip
# Clone this repository
git clone https://github.com/nari-labs/dia.git
cd dia

# Optionally
python -m venv .venv && source .venv/bin/activate

# Install dia
pip install -e .

Or you can install without cloning.

# Install directly from GitHub
pip install git+https://github.com/nari-labs/dia.git

Now, run some examples.

python example/simple.py
Install via uv

You need uv to be installed.

# Clone this repository
git clone https://github.com/nari-labs/dia.git
cd dia

Run some examples directly.

uv run example/simple.py
Run Gradio UI
python app.py

# Or if you have uv installed
uv run app.py
Run with CLI
python cli.py --help

# Or if you have uv installed
uv run cli.py --help

[!NOTE] The model was not fine-tuned on a specific voice. Hence, you will get different voices every time you run the model. You can keep speaker consistency by either adding an audio prompt, or fixing the seed.

[!IMPORTANT] If you are using 5000 series GPU, you should use torch 2.8 nightly. Look at the issue #26 for more details.

Features

💻 Hardware and Inference Speed

Dia has been tested on only GPUs (pytorch 2.0+, CUDA 12.6). CPU support is to be added soon. The initial run will take longer as the Descript Audio Codec also needs to be downloaded.

These are the speed we benchmarked in RTX 4090.

precision realtime factor w/ compile realtime factor w/o compile VRAM
bfloat16 x2.1 x1.5 ~4.4GB
float16 x2.2 x1.3 ~4.4GB
float32 x1 x0.9 ~7.9GB

We will be adding a quantized version in the future.

If you don't have hardware available or if you want to play with bigger versions of our models, join the waitlist here.

🪪 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

⚠️ Disclaimer

This project offers a high-fidelity speech generation model intended for research and educational use. The following uses are strictly forbidden:

By using this model, you agree to uphold relevant legal standards and ethical responsibilities. We are not responsible for any misuse and firmly oppose any unethical usage of this technology.

🔭 TODO / Future Work

🤝 Contributing

We are a tiny team of 1 full-time and 1 part-time research-engineers. We are extra-welcome to any contributions! Join our Discord Server for discussions.

🤗 Acknowledgements

⭐ Star History

Star History Chart

dia (nari-labs/dia)

Searching Database…

19.4K ·GitHub
Что это такое?Dia — это open-weights модель преобразования текста в речь с 1,6 млрд параметров от Nari Labs, которая за один проход генерирует сверхреалистичный диалог нескольких говорящих по расшифровке.
Это онлайн-сервис или что-то, что я запускаю сам?Вы запускаете его сами: это модель на Python с кодом для инференса, а веса скачиваются с Hugging Face. Если хотите сначала просто попробовать, есть бесплатный ZeroGPU Space, который работает прямо в браузере.
Как его запустить?Установите через pip или uv и запустите примеры скриптов. Есть также реализация в Hugging Face Transformers (установите главную ветку transformers, затем запустите hf.py), плюс интерфейс на Gradio и CLI.
Какие главные ограничения стоит знать заранее?Пока генерация доступна только на английском. Держите клипы в диапазоне 5–20 секунд: более короткий ввод звучит неестественно, а на более длинном речь становится неестественно быстрой. Картам RTX 5000-й серии сейчас нужен torch 2.8 nightly.
Можно ли пользоваться бесплатно, и есть ли ограничения на использование?Лицензия — Apache 2.0, но дисклеймер разрешает использование только в исследовательских и образовательных целях: нельзя клонировать голоса реальных людей без разрешения, создавать обманный контент вроде фейковых новостей и делать что-либо незаконное.
Какое железо для этого нужно?GPU с CUDA — модель тестировалась только на GPU (PyTorch 2.0+, CUDA 12.6), поддержки CPU пока нет. В bfloat16 требуется около 4,4 ГБ видеопамяти, а на RTX 4090 скорость примерно в 2 раза выше реального времени.
Как он сравнивается с ElevenLabs и другими TTS-моделями?Команда выложила демо-страницу, где Dia сравнивается с ElevenLabs Studio и Sesame CSM-1B, чтобы вы сами оценили качество на слух; в README собственного вердикта нет.
Dia всё ещё активно развивается?Да — Dia был интегрирован в Hugging Face Transformers в июньском обновлении, а Dia2 вышел на GitHub и Hugging Face в ноябрьском обновлении.
Что есть в планах на будущее?Поддержка Docker для архитектуры ARM и MacOS, более быстрый инференс и квантованная версия с меньшим расходом памяти. Также есть лист ожидания на более крупные версии Dia и для тех, у кого нет подходящего железа для запуска.
What are similar projects?csm, bark, ChatTTS, Speech, DramaBox, FireRedAudio, breeze-tts, OpenVoice
Creator
nari-labs
Size
0.6 MB
Stars
19.4K
Updated
CommitNov 19
Age
1y
Commits · 90 Days