IndexTTS2Options

Options & Configuration · AiDotNet.TextToSpeech.Latest

Options for IndexTTS2.

Inheritance: ModelOptions → TtsModelOptions → IndexTTS2Options

For Beginners

IndexTTS2 clones a voice from a short recording and can set the speech’s emotion and length. These settings size its networks and control generation; the defaults follow the paper, and Release matches the downloadable model.

How It Works

The paper (Zhou et al. 2025) fixes the design but few sizes; the defaults are the release’s (IndexTeam/IndexTTS-2``config.yaml) except where the paper decides otherwise: the duration token p = W_sem h(T) (Duration), the 7-emotion set and Eq. 5’s mean (EmotionMode, EmotionLabels), and a Qwen3-1.7B text-to-emotion model. Release gives the released configuration (speed tokens, 8 emotions with nearest-speaker rows, Qwen3-0.6B), which the released weights need.

Constructors

Constructor Summary
IndexTTS2Options() Creates the paper’s configuration with the release’s sizes.

Properties

Property Summary
IndexTts2DurationConditioning Duration { get; set; } How the target length reaches the model: the paper’s duration token (default) or the release’s speed tokens.
IndexTts2EmotionMode EmotionMode { get; set; } How an emotion distribution becomes the emotion vector (the paper’s Eq.
IndexTts2Stage CurrentStage { get; set; } The stage IndexTTS2 trains.
bool Sample { get; set; } Whether the beam candidates are sampled (do_sample, true) rather than taken best-first.
double Beta1 { get; set; } AdamW β₁.
double Beta2 { get; set; } AdamW β₂.
double ClassDropout { get; set; } The conditioning dropout of flow-matching training (0.1).
double DurationDropProbability { get; set; } The duration token’s drop probability in stage 1 (§ Training: 30%).
double Epsilon { get; set; } AdamW ε.
double FramesPerToken { get; set; } Mel frames per semantic token (1.72: 22050 / 256 frames a second over 50 tokens).
double Guidance { get; set; } Classifier-free guidance (inference_cfg_rate, 0.7).
double LatentFusionProbability { get; set; } The GPT latent fusion probability in training (§ S2M: 50%).
double MaxPromptSeconds { get; set; } The longest prompt the release reads, in seconds (15).
double RepetitionPenalty { get; set; } Repetition penalty (10).
double SpeakerAdversaryWeight { get; set; } The speaker classifier’s loss coefficient α in Eq.
double Temperature { get; set; } Temperature (0.8).
double TopP { get; set; } Top-p (0.8).
double WavenetDropout { get; set; } The WaveNet head’s dropout (0.2).
int Beams { get; set; } Beams (num_beams, 3).
int ConditionBlocks { get; set; } The speaker conformer’s blocks (6).
int ConditionDim { get; set; } The speaker conformer’s width (512).
int ConditionHeads { get; set; } The speaker conformer’s heads (8).
int ConditionLatents { get; set; } The speaker perceiver’s latents (32).
int ConditionLinearUnits { get; set; } The speaker conformer’s feed-forward width (2048).
int DiffusionSteps { get; set; } Euler steps (25).
int DitDepth { get; set; } The DiT’s blocks (13).
int DitHeads { get; set; } The DiT’s heads (8).
int DitHidden { get; set; } The DiT’s width (512).
int EmotionConditionBlocks { get; set; } The emotion conformer’s blocks (4).
int EmotionConditionDim { get; set; } The emotion conformer’s width (512).
int EmotionConditionHeads { get; set; } The emotion conformer’s heads (4).
int EmotionConditionLinearUnits { get; set; } The emotion conformer’s feed-forward width (1024).
int EmotionHeadDim { get; set; } The text-to-emotion model’s head width (128).
int EmotionHeads { get; set; } The text-to-emotion model’s heads (16).
int EmotionHidden { get; set; } The text-to-emotion model’s width (Qwen3-1.7B: 2048).
int EmotionIntermediate { get; set; } The text-to-emotion model’s feed-forward width (Qwen3-1.7B: 6144).
int EmotionKeyValueHeads { get; set; } The text-to-emotion model’s key-value heads (8).
int EmotionLayers { get; set; } The text-to-emotion model’s layers (28).
int EmotionLoraRank { get; set; } The LoRA rank the text-to-emotion distillation trains (§ T2E; 8).
int EmotionMaxTokens { get; set; } The most tokens the text-to-emotion model generates (256).
int EmotionVocabulary { get; set; } The text-to-emotion model’s vocabulary (151,936).
int Layers { get; set; } GPT-2 layers (24).
int MaxGeneratedTokens { get; set; } The most semantic tokens a segment generates (max_mel_tokens at inference, 1500).
int MaxMelTokens { get; set; } Semantic positions (max_mel_tokens, 1815).
int MelCodes { get; set; } Semantic codes plus the start and stop tokens (8194).
int PerceiverMultiple { get; set; } The perceivers’ feed-forward multiple (2).
int RegulatorChannels { get; set; } The length regulator’s width (512).
int RegulatorStages { get; set; } The length regulator’s convolution stages (4).
int SamplingSeed { get; set; } The seed of generation’s draws and the flow’s noise.
int SegmentSilenceMilliseconds { get; set; } Silence between segments, in milliseconds (interval_silence, 200).
int SegmentTokens { get; set; } Text tokens per synthesized segment (max_text_tokens_per_segment, 120).
int SemanticCodebookDim { get; set; } The semantic codebook’s dimension (8).
int SemanticCodebookSize { get; set; } Semantic codes (8192).
int SemanticCodecDim { get; set; } The semantic codec’s Vocos width (384).
int SemanticCodecIntermediate { get; set; } The semantic codec’s Vocos feed-forward width (2048).
int SemanticCodecLayers { get; set; } The semantic codec’s Vocos blocks (12).
int SemanticHeads { get; set; } w2v-BERT 2.0’s heads (16).
int SemanticHiddenSize { get; set; } w2v-BERT 2.0’s width (1024).
int SemanticIntermediateSize { get; set; } w2v-BERT 2.0’s feed-forward width (4096).
int SemanticLayer { get; set; } The hidden state the features come from (17).
int SemanticSampleRate { get; set; } The rate the semantic model reads (16 kHz).
int SpeakerCount { get; set; } The speaker classifier’s speakers (stage 2).
int SpeakerEncoderChannels { get; set; } CAM++’s TDNN channels (128).
int SpeakerEncoderGrowthRate { get; set; } CAM++’s growth rate (32).
int StyleDim { get; set; } The CAM++ style’s width (192).
int TopK { get; set; } Top-k (30).
int TrainingSeed { get; set; } The seed of the networks’ initialization and of training’s draws.
int VocoderInitialChannels { get; set; } BigVGAN’s first width (1536).
int WavenetHidden { get; set; } The WaveNet head’s width (512).
int WavenetKernel { get; set; } The WaveNet head’s kernel (5).
int WavenetLayers { get; set; } The WaveNet head’s layers (8).
int? TargetSemanticTokens { get; set; } The number of semantic tokens to generate per segment (the paper’s duration control); null generates freely.
int[] EmotionGroupSizes { get; set; } The emotion table’s rows per emotion (the release’s emo_num); null when the table is not loaded.
int[] VocoderResBlockKernels { get; set; } BigVGAN’s AMP block kernels (3, 7, 11).
int[] VocoderUpsampleKernels { get; set; } BigVGAN’s upsampling kernels (8, 8, 4, 4, 4, 4).
int[] VocoderUpsampleRates { get; set; } BigVGAN’s upsampling rates (4, 4, 2, 2, 2, 2).
int[][] VocoderResBlockDilations { get; set; } BigVGAN’s AMP block dilations ((1, 3, 5) each).
string BpeModelPath { get; set; } The release’s SentencePiece model (bpe.model), which turning text into tokens needs.
string EmotionModelPath { get; set; } The text-to-emotion model directory (a Qwen3 model.safetensors and tokenizer.json).
string[] EmotionLabels { get; set; } The emotions, in the order of the emotion table’s groups and of an emotion vector’s weights (the paper’s seven by default).

Methods

Method Summary
IndexTTS2Options Release() The released model’s configuration: the speed tokens, the release’s 8 emotions with nearest-speaker rows and group sizes, and Qwen3-0.6B for text-to-emotion.