KaniTTS2Options

Options & Configuration · AiDotNet.TextToSpeech.Latest

Options for KaniTTS2.

Inheritance: ModelOptions → KaniTTSOptions → KaniTTS2Options

For Beginners

These settings size KaniTTS 2’s language model, its audio codec and the speaker embedder that reads a voice from a recording; the defaults reproduce the released model.

How It Works

KaniTTS 2 has no paper: the defaults are its release (nineninesix-ai/kani-tts-2 and the kani-tts 1.0.1 package; nineninesix/kani-tts-2-en’s config.json; nineninesix-ai/kani-tts-2-pretrain for training). It is Kani 1’s LFM2-350M and NanoCodec with three changes: frame-level positions (a frame’s four codes share one rotary position, frames one apart), a learnable rotary scale per attention layer (α in [0.1, 2]), and a 128-wide speaker embedding — WavLM-Large speaker embeddings (nineninesix/speaker-emb-tbr, after Orange/Speaker-wavLM-tbr) — projected and inserted after the first token; its vocabulary is 80,538 and a prompt may start with a language tag. Sampling is the package’s (temperature 1, top-k 50, top-p 0.95, repetition penalty 1.1, up to 3000 tokens). Training is the pretraining recipe: every language-model weight with AdamW at 9e-4 (the rotary scales at 1.5 times that, without weight decay), 2000 warm-up steps then cosine decay, the gradient norm clipped to 3, and 36 samples per step (6 × 6 accumulation).

Constructors

Constructor Summary
KaniTTS2Options() Creates the released configuration.
KaniTTS2Options(KaniTTS2Options other) Copies another instance.

Properties

Property Summary
bool ReleaseSpeakerCachePosition { get; set; } Keep the release’s generation cache positions despite its inserted speaker token (on).
double MaxReferenceSeconds { get; set; } The longest speaker reference read, in seconds (30); longer recordings are cut.
int EmbedderHeadWidth { get; set; } The speaker embedder head’s middle width (512).
int EmbedderHeads { get; set; } The speaker embedder’s WavLM heads (16).
int EmbedderIntermediate { get; set; } The speaker embedder’s WavLM feed-forward width (4096).
int EmbedderLayers { get; set; } The speaker embedder’s WavLM layers (24).
int EmbedderPositionalGroups { get; set; } The speaker embedder’s position convolution groups (16).
int EmbedderPositionalKernel { get; set; } The speaker embedder’s position convolution kernel (128).
int EmbedderWidth { get; set; } The speaker embedder’s WavLM width (1024).
int SpeakerEmbeddingDim { get; set; } Speaker embedding width (128), projected and inserted after the first token.
int[] EmbedderConvDims { get; set; } The speaker embedder’s feature-encoder widths (seven of 512).
string[] LanguageTags { get; set; } The checkpoint’s language tags (config.json’s language_settings.language_tags_list, which LoadReferenceWeights reads), indexed by a voice’s or a training sample’s LanguageId.