DiaOptions

Options & Configuration · AiDotNet.TextToSpeech.CodecBased

Options for Dia.

Inheritance: ModelOptions → TtsModelOptions → DiaOptions

For Beginners

These settings size Dia’s text encoder and audio decoder, control how it samples each step of sound, and set how it trains; the defaults reproduce the released 1.6B model.

How It Works

The defaults are Dia 1.6B (Nari Labs 2025; nari-labs/dia dia/config.py, nari-labs/Dia-1.6B-0626): a Transformer encoder over the text’s UTF-8 bytes (width 1024, 12 layers, 16 heads of 128, SwiGLU 4096) and a decoder over DAC’s nine codebooks (width 2048, 18 layers, 16 query heads over 4 key-value heads of 128, cross-attention of 16 heads of 128, SwiGLU 8192), 1028 tokens per codebook (codes 0–1023, end 1024, padding 1025, start 1026), the codebooks delayed by [0, 8, 9, 10, 11, 12, 13, 14, 15] frames, rotary θ 10000, at 44.1 kHz.

Generation follows Dia.generate: classifier-free guidance at scale 3, temperature 1.2, top-p 0.95 and a CFG filter keeping the 45 best guided codes, up to 3072 steps. transformers’ example (hf.py) samples at temperature 1.8 and top-p 0.90 instead. Training follows transformers’ DiaForConditionalGeneration, written with Nari Labs and the only training code, under the Trainer’s default AdamW (no recipe was released).

Constructors

Constructor Summary
DiaOptions() Creates the Dia 1.6B configuration.
DiaOptions(DiaOptions other) Copies another instance.

Properties

Property Summary
DACOptions Codec { get; set; } The codec (DAC 44.1 kHz, 9 codebooks); load its released weights with LoadDescriptCheckpoint.
double Beta1 { get; set; } AdamW’s β₁ (0.9, Hugging Face’s default).
double Beta2 { get; set; } AdamW’s β₂ (0.999, Hugging Face’s default).
double CfgScale { get; set; } Classifier-free guidance’s scale (3.0).
double Epsilon { get; set; } AdamW’s ε (1e-8, Hugging Face’s default).
double MaxGradNorm { get; set; } The gradient-norm clip (1.0, Hugging Face’s default; 0 for none).
double NormEpsilon { get; set; } RMSNorm’s ε (1e-5).
double RopeTheta { get; set; } The rotary embedding’s θ (10000).
double Temperature { get; set; } The sampling temperature (1.2; 0 takes the most likely code).
double TopP { get; set; } Nucleus sampling’s probability mass (0.95; 1 keeps every code).
int AudioVocabSize { get; set; } Tokens per codebook in the decoder’s tables and heads (1028: DAC’s 1024 codes, end, padding, start, and one unused).
int BeginToken { get; set; } The start-of-audio token (1026).
int CfgFilterTopK { get; set; } The codes kept by the CFG filter and by sampling’s top-k (45).
int Channels { get; } DAC codebooks the decoder predicts: one per DelayPattern entry (9).
int CrossHeadDim { get; set; } The cross-attention’s head width (128).
int CrossHeads { get; set; } The cross-attention’s query heads (16).
int CrossKeyValueHeads { get; set; } The cross-attention’s key-value heads (16).
int DecoderHeadDim { get; set; } The decoder’s self-attention head width (128).
int DecoderHeads { get; set; } The decoder’s self-attention query heads (16).
int DecoderHidden { get; set; } The decoder’s width (2048).
int DecoderIntermediate { get; set; } The decoder’s feed-forward width (8192).
int DecoderKeyValueHeads { get; set; } The decoder’s self-attention key-value heads (4).
int DecoderLayers { get; set; } The decoder’s layers (18).
int EncoderHeadDim { get; set; } The encoder’s head width (128).
int EncoderHeads { get; set; } The encoder’s attention heads (16).
int EncoderIntermediate { get; set; } The encoder’s feed-forward width (4096).
int EncoderKeyValueHeads { get; set; } The encoder’s key-value heads (16).
int EncoderLayers { get; set; } The encoder’s layers (12); its width is HiddenDim (1024) and its vocabulary VocabSize (256 bytes).
int EndToken { get; set; } The end-of-audio token (1024).
int MaxAudioTokens { get; set; } The most decoder steps (3072, the decoder’s positions; about 35 seconds).
int PadToken { get; set; } The padding token (1025).
int SamplingSeed { get; set; } The seed of generation’s sampling and of the native model’s initialization when the architecture has no seed (0).
int TrainingSteps { get; set; } The total optimizer steps the linear decay to 0 spans (0: a constant learning rate).
int[] DelayPattern { get; set; } Each codebook’s delay in frames ([0, 8, 9, 10, 11, 12, 13, 14, 15]).