https://github.com/bytedance/megatts3

https://github.com/bytedance/megatts3

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.7%) to scientific vocabulary

Keywords

research
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: bytedance
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.12 MB
Statistics
  • Stars: 5,802
  • Watchers: 47
  • Forks: 448
  • Open Issues: 84
  • Releases: 0
Topics
research
Created over 1 year ago · Last pushed 10 months ago
Metadata Files
Readme License Code of conduct

readme.md

MegaTTS 3

Official PyTorch Implementation

Hugging Face version version python mit

Key features

  • 🚀Lightweight and Efficient: The backbone of the TTS Diffusion Transformer has only 0.45B parameters.
  • 🎧Ultra High-Quality Voice Cloning: You can try our model at Huggingface Demo🎉. The .wav and .npy files can be found at link1. Submit a sample (.wav format, < 24s, and please do not contain space in filename) on link2 to receive .npy voice latents you can use locally.
  • 🌍Bilingual Support: Supports both Chinese and English, and code-switching.
  • ✍️Controllable: Supports accent intensity control ✅ and fine-grained pronunciation/duration adjustment (coming soon).

MegaTTS 3 Demo Video

🎯Roadmap

  • [2025-03-22] Our project has been released!

Installation

``` sh

Clone the repository

git clone https://github.com/bytedance/MegaTTS3 cd MegaTTS3 **Requirements (for Linux)** sh

Create a python 3.10 conda env (you could also use virtualenv)

conda create -n megatts3-env python=3.10 conda activate megatts3-env pip install -r requirements.txt

Set the root directory

export PYTHONPATH="/path/to/MegaTTS3:$PYTHONPATH"

[Optional] Set GPU

export CUDAVISIBLEDEVICES=0

If you encounter bugs with pydantic in inference, you should check if the versions of pydantic and gradio are matched.

[Note] if you encounter bugs related with httpx, please check that whether your environmental variable "no_proxy" has patterns like "::"

```

Requirements (for Windows) ``` sh

[The Windows version is currently under testing]

Comment below dependence in requirements.txt:

# WeTextProcessing==1.0.4.1

Create a python 3.10 conda env (you could also use virtualenv)

conda create -n megatts3-env python=3.10 conda activate megatts3-env pip install -r requirements.txt conda install -y -c conda-forge pynini==2.1.5 pip install WeTextProcessing==1.0.3

[Optional] If you want GPU inference, you may need to install specific version of PyTorch for your GPU from https://pytorch.org/.

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126

[Note] if you encounter bugs related with ffprobe or ffmpeg, you can install it through conda install -c conda-forge ffmpeg

Set environment variable for root directory

set PYTHONPATH="C:\path\to\MegaTTS3;%PYTHONPATH%" # Windows $env:PYTHONPATH="C:\path\to\MegaTTS3;%PYTHONPATH%" # Powershell on Windows conda env config vars set PYTHONPATH="C:\path\to\MegaTTS3;%PYTHONPATH%" # For conda users

[Optional] Set GPU

set CUDAVISIBLEDEVICES=0 # Windows $env:CUDAVISIBLEDEVICES=0 # Powershell on Windows

```

Requirements (for Docker) ``` sh

[The Docker version is currently under testing]

! You should download the pretrained checkpoint before running the following command

docker build . -t megatts3:latest

For GPU inference

docker run -it -p 127.0.0.1:7929:7929 --gpus all -e CUDAVISIBLEDEVICES=0 megatts3:latest

For CPU inference

docker run -it -p 127.0.0.1:7929:7929 megatts3:latest

Visit http://127.0.0.1:7860/ for gradio.

```

Model Download

The pretrained checkpoint can be found at Google Drive or Huggingface. Please download them and put them to ./checkpoints/xxx.

[!IMPORTANT]
For security issues, we do not upload the parameters of WaveVAE encoder to the above links. You can only use the pre-extracted latents from link1 for inference. If you want to synthesize speech for speaker A, you need "A.wav" and "A.npy" in the same directory. If you have any questions or suggestions for our model, please email us.

This project is primarily intended for academic purposes. For academic datasets requiring evaluation, you may upload them to the voice request queue in link2 (within 24s for each clip). After verifying that your uploaded voices are free from safety issues, we will upload their latent files to link1 as soon as possible.

In the coming days, we will also prepare and release the latent representations for some common TTS benchmarks.

Inference

Command-Line Usage (Standard) ``` bash

pw (intelligibility weight), tw (similarity weight). Typically, prompt with more noises requires higher pw and tw

python tts/infercli.py --inputwav 'assets/Chineseprompt.wav' --inputtext "另一边的桌上,一位读书人嗤之以鼻道,'佛子三藏,神子燕小鱼是什么样的人物,李家的那个李子夜如何与他们相提并论?'" --output_dir ./gen

As long as audio volume and pronunciation are appropriate, increasing --t_w within reasonable ranges (2.0~5.0)

will increase the generated speech's expressiveness and similarity (especially for some emotional cases).

python tts/infercli.py --inputwav 'assets/Englishprompt.wav' --inputtext 'As his long promised tariff threat turned into reality this week, top human advisers began fielding a wave of calls from business leaders, particularly in the automotive sector, along with lawmakers who were sounding the alarm.' --outputdir ./gen --pw 2.0 --t_w 3.0 **Command-Line Usage (for TTS with Accents)** bash

When pw (intelligibility weight) ≈ 1.0, the generated audio closely retains the speaker’s original accent. As pw increases, it shifts toward standard pronunciation.

tw (similarity weight) is typically set 0–3 points higher than pw for optimal results.

Useful for accented TTS or solving the accent problems in cross-lingual TTS.

python tts/infercli.py --inputwav 'assets/Englishprompt.wav' --inputtext '这是一条有口音的音频。' --outputdir ./gen --pw 1.0 --t_w 3.0

python tts/infercli.py --inputwav 'assets/Englishprompt.wav' --inputtext '这条音频的发音标准一些了吗?' --outputdir ./gen --pw 2.5 --t_w 2.5 ```

Web UI Usage ``` bash

We also support cpu inference, but it may take about 30 seconds (for 10 inference steps).

python tts/gradio_api.py ```

Submodules

[!TIP] In addition to TTS, some submodules in this project may also have additional usages. See ./tts/frontend_fuction.py and ./tts/infer_cli.py for example code.

Aligner

Description: a robust speech-text aligner model trained using pseudo-labels generated by a large number of MFA expert models.

Usage: 1) Prepare the finetuning dataset for our model; 2) Filter the large-scale speech dataset (if the aligner fails to align a certain speech clip, it is likely to be noisy); 3) Phoneme recognition; 4) Speech segmentation.

Graphme-to-Phoneme Model

Description: a Qwen2.5-0.5B model finetuned for robust graphme-to-phoneme conversion.

Usage: Graphme-to-phoneme conversion.

WaveVAE

Description: a strong waveform VAE that can compress 24 kHz speeche into 25 Hz acoustic latent and reconstruct the original wave almost losslessly.

Usage: 1) Acoustic latents can provide a more compact and discriminative training target for speech synthesis models compared to mel-spectrograms, accelerating convergence; 2) Used as acoustic latents for voice conversion; 3) High-quality vocoder.

Security

If you discover a potential security issue in this project, or think you may have discovered a security issue, we ask that you notify Bytedance Security via our security center or sec@bytedance.com.

Please do not create a public GitHub issue.

License

This project is licensed under the Apache-2.0 License.

Citation

This repo contains forced-align version of Sparse Alignment Enhanced Latent Diffusion Transformer for Zero-Shot Speech Synthesis and the WavVAE is mainly based on Wavtokenizer: an efficient acoustic discrete codec tokenizer for audio language modeling. Compared to the model described in paper, the repository includes additional models. These models not only enhance the stability and cloning capabilities of the algorithm but can also be independently utilized to serve a wider range of scenarios. ``` @article{jiang2025sparse, title={Sparse Alignment Enhanced Latent Diffusion Transformer for Zero-Shot Speech Synthesis}, author={Jiang, Ziyue and Ren, Yi and Li, Ruiqi and Ji, Shengpeng and Ye, Zhenhui and Zhang, Chen and Jionghao, Bai and Yang, Xiaoda and Zuo, Jialong and Zhang, Yu and others}, journal={arXiv preprint arXiv:2502.18924}, year={2025} }

@article{ji2024wavtokenizer, title={Wavtokenizer: an efficient acoustic discrete codec tokenizer for audio language modeling}, author={Ji, Shengpeng and Jiang, Ziyue and Wang, Wen and Chen, Yifu and Fang, Minghui and Zuo, Jialong and Yang, Qian and Cheng, Xize and Wang, Zehan and Li, Ruiqi and others}, journal={arXiv preprint arXiv:2408.16532}, year={2024} } ```

Owner

  • Name: Bytedance Inc.
  • Login: bytedance
  • Kind: organization
  • Location: Singapore

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 99
  • Total pull requests: 14
  • Average time to close issues: 1 day
  • Average time to close pull requests: 4 days
  • Total issue authors: 87
  • Total pull request authors: 12
  • Average comments per issue: 1.09
  • Average comments per pull request: 0.57
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 99
  • Pull requests: 14
  • Average time to close issues: 1 day
  • Average time to close pull requests: 4 days
  • Issue authors: 87
  • Pull request authors: 12
  • Average comments per issue: 1.09
  • Average comments per pull request: 0.57
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • nightt5879 (3)
  • blackjyn (3)
  • szxy0297 (2)
  • RedbHawk (2)
  • Tuomas-sky (2)
  • walkingwithGod2017 (2)
  • weedge (2)
  • bebilli (2)
  • Lock1994 (2)
  • bk111 (2)
  • softicelee2 (1)
  • 7757 (1)
  • felixszeto (1)
  • S-T-K (1)
  • smartsnow (1)
Pull Request Authors
  • Idiotabtcodes (2)
  • JyiHUO (2)
  • RickyL-2000 (1)
  • akash0-real (1)
  • eltociear (1)
  • leeyeel (1)
  • Nigh (1)
  • dependabot[bot] (1)
  • AriesAlex (1)
  • MilesQLi (1)
  • vishwamartur (1)
  • mattelothere (1)
Top Labels
Issue Labels
help wanted (1)
Pull Request Labels
dependencies (1) python (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 18 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: megatts

MegaTTS 3 - A lightweight and efficient TTS system with ultra high-quality voice cloning

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 18 Last month
Rankings
Dependent packages count: 9.4%
Average: 31.1%
Dependent repos count: 52.8%
Maintainers (1)
Last synced: 10 months ago

Dependencies

requirements.txt pypi
  • WeTextProcessing ==1.0.4.1
  • attrdict *
  • gradio *
  • httpx ==0.23.3
  • langdetect ==1.0.9
  • librosa ==0.10.2.post1
  • modelscope ==1.22.2
  • openai-whisper ==20240930
  • pydub ==0.25.1
  • pyloudnorm ==0.1.1
  • setproctitle *
  • torch ==2.3.0
  • torchaudio ==2.3.0
  • torchdiffeq ==0.2.5
  • transformers >=4.41.2,<=4.49.0,
  • x-transformers ==1.44.4