ZonosOptions

Options & Configuration · AiDotNet.TextToSpeech.CodecBased

Options for Zonos.

Inheritance: ModelOptions → ZonosOptions

For Beginners

These settings size Zonos, pick its backbone, control how it samples, set the default speaking style, and set how it trains; the defaults reproduce the released transformer model.

How It Works

The defaults are Zonos-v0.1-transformer (Zyphra 2025; Zyphra/Zonos zonos/config.py, the release’s config.json): width 2048, 26 attention layers of 16 query heads over 4 key-value heads with rotary positions on adjacent pairs, gated feed-forward 8192, over DAC’s nine 1024-code codebooks at 44.1 kHz. Hybrid gives Zonos-v0.1-hybrid: 46 layers, attention at 0, 4, …, 44 (rotary on halves) and Mamba2 elsewhere (state 128, head width 64, expansion 2, one group), with four more conditioners.

Generation follows Zonos.generate with make_cond_dict’s defaults: classifier-free guidance at 2.0, min-p 0.1, a repetition penalty of 3 over the last 2 frames, up to 30 seconds; English, a neutral-leaning emotion mix, fmax 22050 Hz, pitch deviation 20 Hz and 15 phonemes a second. Training (no code was released) scores each head on its next delayed code, drops each optional conditioner 10% of the time, and uses the Trainer’s default AdamW.

Constructors

Constructor Summary
ZonosOptions() Creates the Zonos-v0.1-transformer configuration.
ZonosOptions(ZonosOptions other) Copies another instance.

Properties

Property Summary
DACOptions Codec { get; set; } The codec (DAC 44.1 kHz, 9 codebooks); load its released weights with LoadPretrainedWeights.
List<ZonosConditioner> Conditioners { get; set; } The prefix conditioners, in order (the transformer’s seven).
List<string> UnconditionalInputs { get; set; } Conditioners left unconditional (make_cond_dict’s vqscore_8 and dnsmos_ovrl).
OnnxModelOptions OnnxOptions { get; set; } Settings for the ONNX graph runtime.
ZonosBackbone Backbone { get; set; } The backbone (the transformer).
bool RotaryInterleaved { get; set; } Whether the rotary embedding turns adjacent pairs (the transformer) rather than halves (the hybrid).
bool SpeakerNoised { get; set; } The hybrid’s speaker-noised flag (false).
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 (2.0; the release requires it to differ from 1).
double ConditionerDropout { get; set; } In training, the chance each optional conditioner is replaced by its unconditional vector (0.1).
double CtcLoss { get; set; } The hybrid’s target CTC loss (0).
double DnsmosOverall { get; set; } The hybrid’s target DNSMOS (4).
double Epsilon { get; set; } AdamW’s ε (1e-8, Hugging Face’s default).
double Fmax { get; set; } The highest frequency in Hz (22050; use 22050 for voice cloning).
double LearningRate { get; set; } The native AdamW learning rate (5e-5).
double MaxGradNorm { get; set; } The gradient-norm clip (1.0, Hugging Face’s default; 0 for none).
double MinP { get; set; } Min-p (0.1).
double NormEpsilon { get; set; } LayerNorm’s ε (1e-5).
double PitchStd { get; set; } The pitch’s standard deviation in Hz (20; 20–45 normal, 60–150 expressive).
double RepetitionPenalty { get; set; } The repetition penalty (3.0; 1 for none).
double SpeakingRate { get; set; } Phonemes a second (15; 10 slow, 30 very fast).
double Temperature { get; set; } The temperature (1.0; 0 takes the most likely code).
double TopP { get; set; } Nucleus sampling’s mass (0: off).
double UnifiedConfidence { get; set; } The unified sampler’s confidence term.
double UnifiedLinear { get; set; } NovelAI’s unified sampler’s linear term (0: off).
double UnifiedQuadratic { get; set; } The unified sampler’s quadratic term.
double WeightDecay { get; set; } The native AdamW weight decay (0).
double[] Emotion { get; set; } The emotion mix: happiness, sadness, disgust, fear, surprise, anger, other, neutral (normalized to sum 1).
double[] VqScore { get; set; } The hybrid’s target VQScore for each eighth of the audio (0.78).
int AttentionIntermediate { get; set; } The attention layers’ gated feed-forward width (8192).
int ChunkSize { get; set; } The SSD algorithm’s chunk length (256); it changes only the order of the arithmetic.
int Codebooks { get; set; } DAC codebooks (9).
int ConvWidth { get; set; } Mamba2’s convolution width (4).
int EndToken { get; set; } The end-of-audio token (1024).
int Expand { get; set; } Mamba2’s expansion (2).
int Groups { get; set; } Mamba2’s groups of B and C (1).
int Heads { get; set; } Query heads (16).
int HiddenDim { get; set; } The backbone and conditioning width (2048).
int KeyValueHeads { get; set; } Key-value heads (4).
int Layers { get; set; } Layers (26; the hybrid has 46).
int MambaHeadDim { get; set; } Mamba2’s head width (64).
int MambaIntermediate { get; set; } The Mamba2 layers’ gated feed-forward width (0: none).
int MaskToken { get; set; } The mask token of the delay pattern (1025).
int MaxNewTokens { get; set; } The most frames generated (2580: 30 seconds).
int MaxTextLength { get; set; } The input length advertised to TTS clients (2048).
int RepetitionWindow { get; set; } The frames the repetition penalty looks back over (2).
int RotaryDim { get; set; } Head dimensions the rotary embedding turns (128: all).
int SampleRate { get; set; } The waveform sample rate, matching the DAC configuration (44100).
int SamplingSeed { get; set; } The seed of sampling and conditioner dropout, and the initialization fallback when neither the shared Seed nor the architecture specifies a seed (0).
int StateDim { get; set; } Mamba2’s state size (128).
int TopK { get; set; } Top-k (0: off).
int TrainingSteps { get; set; } The total optimizer steps the linear decay to 0 spans (0: a constant learning rate).
int[] AttentionLayers { get; set; } The layers that attend; null selects all layers for Transformer or every fourth layer for Hybrid.
string Language { get; set; } The eSpeak language (en-us); one of Languages.
string ModelPath { get; set; } The exported ONNX graph path, when used.
string SudachiDictionary { get; set; } For Japanese: sudachidict_full’s system.dic (null: the SUDACHI_DICT environment variable).
string SudachiResources { get; set; } For Japanese: SudachiPy’s resources directory with char.def, unk.def and rewrite.def (null: the SUDACHI_RESOURCES environment variable).

Methods

Method Summary
ZonosOptions Hybrid() The Zonos-v0.1-hybrid configuration.