three-stage autoregressive-to-diffusion speech synthesis
Generates speech by chaining three neural models: an autoregressive GPT-like model (UnifiedVoice) that produces mel spectrogram codes from tokenized text conditioned on voice embeddings, a diffusion decoder (DiffusionTts) that refines codes into high-quality mel spectrograms through iterative denoising, and a HiFiGAN vocoder that converts spectrograms to waveforms. This multi-stage approach decouples content generation from acoustic refinement, enabling both prosody control and high-fidelity output.
Unique: Combines autoregressive content generation with diffusion-based acoustic refinement rather than end-to-end autoregressive generation, enabling independent control over semantic content and acoustic quality. The diffusion decoder stage specifically addresses prosody naturalness through iterative refinement rather than single-pass generation.
vs alternatives: Produces more natural prosody and intonation than single-stage autoregressive TTS systems (like Glow-TTS) because diffusion refinement captures fine-grained acoustic details; slower than FastPitch but higher quality for complex linguistic phenomena.
voice cloning from minimal reference audio
Extracts speaker embeddings from reference audio samples (5-30 seconds) using a speaker encoder, then conditions the autoregressive and diffusion models on these embeddings to synthesize speech in the cloned voice. The voice conditioning system integrates embeddings at multiple points in the generation pipeline, enabling voice characteristics to influence both content generation timing and acoustic refinement without requiring fine-tuning.
Unique: Uses speaker embeddings extracted from reference audio to condition both the autoregressive model (for timing/prosody) and diffusion decoder (for acoustic refinement) without requiring model fine-tuning. This enables zero-shot voice cloning where the speaker encoder generalizes to unseen speakers.
vs alternatives: Requires minimal reference audio (5-30 seconds) compared to fine-tuning-based approaches like Tacotron2 with speaker adaptation (which need 1-2 minutes); faster than voice conversion methods because it generates directly rather than transforming existing speech.
command-line interface for single-phrase and long-form synthesis
Provides two CLI tools: do_tts.py for single-phrase synthesis and read.py for long-form text reading. These tools expose core API functionality through command-line arguments, enabling non-programmatic users to generate speech without writing code. The CLI handles file I/O, argument parsing, and progress reporting. This enables integration into shell scripts and batch processing workflows.
Unique: Provides separate CLI tools for different use cases (single-phrase vs. long-form) rather than a single monolithic CLI, enabling simpler interfaces for each workflow. Integrates with standard Unix conventions (file paths, exit codes) for shell script compatibility.
vs alternatives: More accessible than programmatic API for non-technical users; enables shell script integration unlike GUI-only systems; simpler than web APIs because no server setup required.
pre-trained model weight management and lazy loading
Manages downloading, caching, and loading of pre-trained model weights (autoregressive, diffusion, vocoder, speaker encoder) from remote repositories. Models are downloaded on-demand and cached locally to avoid repeated downloads. The TextToSpeech API handles lazy loading, where models are loaded into GPU memory only when needed, reducing startup time and memory footprint for inference-only workflows.
Unique: Implements lazy loading where models are loaded into GPU memory only when needed, reducing startup time and memory footprint. Automatic caching avoids repeated downloads while enabling offline inference after initial download.
vs alternatives: Faster startup than eager loading because models load on-demand; simpler than manual weight management because downloads are automatic; more flexible than bundled models because users can customize model versions.
batch text-to-speech generation with memory optimization
Processes multiple text inputs in configurable batch sizes through the autoregressive model, with automatic batch size selection based on available GPU memory. Implements KV-cache optimization to reduce redundant computation during autoregressive decoding and supports half-precision (FP16) computation to reduce memory footprint. The TextToSpeech API orchestrates batch processing across all three pipeline stages while managing device placement and memory allocation.
Unique: Implements automatic batch size selection based on GPU memory profiling rather than requiring manual tuning, combined with KV-cache optimization in the autoregressive stage to reduce redundant attention computation. Supports both FP32 and FP16 inference with explicit quality/speed tradeoff control.
vs alternatives: More memory-efficient than naive batching because KV-cache eliminates recomputation of attention keys/values; automatic batch sizing reduces user burden compared to systems requiring manual memory management.
long-form text reading with sentence-level streaming
Processes long documents by splitting text into sentences, synthesizing each sentence independently, and concatenating audio outputs with optional silence padding. The read.py and read_fast.py modules implement streaming generation where sentences are synthesized sequentially and can be output to audio files or streamed in real-time. This approach avoids loading entire documents into memory and enables progressive audio generation without waiting for full synthesis.
Unique: Implements sentence-level streaming where each sentence is synthesized independently and concatenated, enabling progressive output without loading entire documents into memory. The streaming architecture decouples text processing from audio generation, allowing real-time output as sentences complete.
vs alternatives: More memory-efficient than end-to-end synthesis of full documents; enables progressive playback unlike batch-only systems; simpler than paragraph-level synthesis because sentence boundaries are more reliable.
diffusion-based acoustic refinement with configurable denoising steps
The DiffusionTts decoder refines mel spectrogram codes from the autoregressive model through iterative denoising, where each step removes noise and improves acoustic quality. The number of diffusion steps is configurable (typically 5-50 steps), trading off quality for inference speed. This stage operates on mel spectrogram space rather than waveform space, making it computationally efficient while capturing fine-grained acoustic details like formant structure and spectral smoothness.
Unique: Uses diffusion-based iterative denoising in mel spectrogram space rather than waveform space, making refinement computationally efficient while capturing acoustic details. Configurable step count enables explicit quality/speed tradeoff without model retraining.
vs alternatives: More efficient than waveform-space diffusion (like DiffWave) because mel spectrograms are lower-dimensional; more flexible than fixed-quality systems because step count is tunable; captures acoustic details better than single-pass refinement networks.
hifigan neural vocoding with high-fidelity waveform synthesis
Converts mel spectrograms to audio waveforms using a pre-trained HiFiGAN generative adversarial network, which uses multi-scale discriminators and periodic/aperiodic decomposition to generate high-fidelity audio. The vocoder operates on 24kHz mel spectrograms (80-128 mel bins) and produces 24kHz waveforms with minimal artifacts. This stage is the final step in the synthesis pipeline and is computationally efficient compared to autoregressive or diffusion stages.
Unique: Uses HiFiGAN architecture with multi-scale discriminators and periodic/aperiodic decomposition, which is more efficient and higher-quality than earlier vocoders (WaveGlow, WaveNet). Optimized for 24kHz synthesis with minimal artifacts.
vs alternatives: Faster and higher-quality than WaveNet-based vocoders; more stable than WaveGlow because GAN training is more robust; produces fewer artifacts than Griffin-Lim phase reconstruction.
+4 more capabilities