MegaTTS3Options
Options & Configuration · AiDotNet.TextToSpeech.Latest
Options for MegaTTS3: the release’s five networks (the diffusion transformer, the duration
language model, the Whisper aligner, the Qwen2 grapheme-to-phoneme model and the WaveVAE), its inference settings and the
paper’s training recipe.
Inheritance: ModelOptions → TtsModelOptions → MegaTTS3Options
For Beginners
MegaTTS 3 copies a voice from a few seconds of it. These options size its parts and set how it samples; the defaults load the released checkpoints.
How It Works
The defaults are the release’s (bytedance/MegaTTS3: dit.py, duration_lm/config.yaml,
whisper_small.py, g2p/config.json, wavvae_v3.py, infer_cli.py) and, for training, the paper’s
(Jiang et al. 2025, §3 and Appendix A.1).
Constructors
| Constructor | Summary |
|---|---|
MegaTTS3Options() |
Initializes a new instance with default values. |
Properties
| Property | Summary |
|---|---|
bool SparseAlignment { get; set; } |
Whether the transformer reads one random anchor frame per phone in training (the paper’s sparse alignment); false reads every frame, as inference does. |
double Beta1 { get; set; } |
Adam’s β1 (0.9). |
double Beta2 { get; set; } |
Adam’s β2 (0.999). |
double DropoutRate { get; set; } |
The released networks have no model dropout; only zero is supported. |
double DurationDisturbance { get; set; } |
The random disturbance of predicted durations (dur_disturb, 0.1). |
double DurationScale { get; set; } |
The scale of predicted durations (dur_alpha, 1.0). |
double G2pRopeTheta { get; set; } |
The g2p model’s RoPE base (1,000,000). |
double PromptFractionMax { get; set; } |
See PromptFractionMin. |
double PromptFractionMin { get; set; } |
The prompt’s share of a training latent, drawn from U(min, max) (0.1, 0.9). |
double SpeakerDropProbability { get; set; } |
The probability of dropping the speaker prompt (p_spk, 0.10). |
double SpeakerGuidance { get; set; } |
The speaker guidance weight (--t_w, “similarity”, 2.5). |
double TextDropProbability { get; set; } |
The probability of also dropping the text when the prompt is dropped (50 %). |
double TextGuidance { get; set; } |
The text guidance weight (--p_w, “intelligibility”, 1.6). |
int AlignerHeads { get; set; } |
The aligner’s heads (8). |
int AlignerLayers { get; set; } |
The aligner’s encoder and decoder layers (6 each). |
int AlignerMaxTokens { get; set; } |
The aligner’s most decoded tokens (768). |
int AlignerVocabulary { get; set; } |
The aligner’s vocabulary (6800). |
int AlignerWidth { get; set; } |
The aligner’s width (512). |
int ChineseChunkLimit { get; set; } |
Chinese chunks of about this many ideographs (60). |
int ContextMaskDim { get; set; } |
The context mask’s projection width (16). |
int DitHeads { get; set; } |
Attention heads (16). |
int DitLayers { get; set; } |
Transformer layers (24). |
int DitPhoneVocabulary { get; set; } |
The transformer’s phone vocabulary (302; the last is the CFG mask token). |
int DitToneVocabulary { get; set; } |
The transformer’s tone vocabulary (32; the last is the CFG mask token). |
int DurationCodeSize { get; set; } |
Duration codes (128: a phone lasts at most 127 frames). |
int DurationEncoderFilter { get; set; } |
The text encoder’s feed-forward width (1024). |
int DurationEncoderHeads { get; set; } |
The text encoder’s heads (2). |
int DurationEncoderLayers { get; set; } |
The text encoder’s layers (4). |
int DurationEncoderWidth { get; set; } |
The duration model’s text encoder width (512). |
int DurationHeads { get; set; } |
The duration decoder’s heads (8). |
int DurationLayers { get; set; } |
The duration decoder’s layers (8). |
int DurationPhoneVocabulary { get; set; } |
The duration model’s phone vocabulary (174: the release’s 171 phones and three reserved tokens). |
int DurationToneVocabulary { get; set; } |
The duration model’s tone vocabulary (23: 20 and three reserved). |
int DurationWidth { get; set; } |
The duration decoder’s width (512). |
int EnglishChunkBytes { get; set; } |
English chunks of at most this many UTF-8 bytes (130). |
int G2pHeads { get; set; } |
The g2p model’s attention heads (14). |
int G2pHidden { get; set; } |
The g2p model’s width (896). |
int G2pIntermediate { get; set; } |
The g2p model’s feed-forward width (4864). |
int G2pKeyValueHeads { get; set; } |
The g2p model’s key-value heads (2). |
int G2pLayers { get; set; } |
The g2p model’s layers (24). |
int G2pMaxNewTokens { get; set; } |
The g2p model’s most generated tokens (256). |
int G2pVocabSize { get; set; } |
The g2p model’s vocabulary (168,896). |
int HopSize { get; set; } |
Samples per mel frame; paired with the WaveVAE encoder and generator rate products. |
int LatentChannels { get; set; } |
The WaveVAE latent’s channels (32). |
int LocalConditionDim { get; set; } |
The local condition’s width (512). |
int NumDecoderLayers { get; set; } |
The diffusion transformer’s layer count; forwards to DitLayers. |
int NumEncoderLayers { get; set; } |
The phone encoder’s layer count; forwards to PhoneEncoderLayers. |
int NumHeads { get; set; } |
The diffusion transformer’s attention heads; forwards to DitHeads. |
int PhoneEncoderHeads { get; set; } |
The phone encoder’s heads (4). |
int PhoneEncoderLayers { get; set; } |
The phone encoder’s layers (6). |
int SamplingSeed { get; set; } |
The seed of the duration disturbance, the diffusion noise, the posterior draw and language detection. |
int Steps { get; set; } |
Diffusion steps (--time_step, 32). |
int TrainingSeed { get; set; } |
The seed of training’s draws. |
int VaeEncoderDimension { get; set; } |
The encoder’s output width (512). |
int VaeEncoderFilters { get; set; } |
The encoder’s base filters (32). |
int VaeGeneratorFilters { get; set; } |
The generator’s base filters (128). |
int VaeLatentUpsampling { get; set; } |
The latent upsampler’s factor (4). |
int VaeUpsamplerChannels { get; set; } |
The latent upsampler’s channels (320). |
int VocabSize { get; set; } |
The diffusion transformer’s phone vocabulary; forwards to DitPhoneVocabulary. |
int WarmupSteps { get; set; } |
Linear warm-up steps from a rate of 0 (10,000), then the constant rate; 0 trains at the rate from the first step. |
int[] VaeEncoderRatios { get; set; } |
The SEANet encoder’s downsampling ratios (6, 5, 4, 4, 2: 960 samples a latent frame). |
int[] VaeGeneratorRatios { get; set; } |
The generator’s upsampling ratios (5, 4, 4, 3). |
string G2pTokenizerJson { get; set; } |
The g2p tokenizer’s tokenizer.json text; LoadReferenceWeights reads it from the checkpoint. |