mlx-community/Zyphra-ZONOS2
3126
ZONOS2
ZONOS2 is Zyphra's autoregressive text-to-speech model with multi-codebook audio generation, 44.1 kHz DAC decode, and speaker conditioning from reference audio.
Original model: Zyphra/ZONOS2
Supported Repositories
Installation
pip install mlx-audio
Usage
Python API:
from mlx_audio.audio_io import write as audio_write
from mlx_audio.tts import load
model = load("mlx-community/Zyphra-ZONOS2", lazy=True)
result = next(model.generate(
text="Hello, this is ZONOS two running locally with MLX audio.",
max_tokens=220,
))
audio_write("zonos2.wav", result.audio, result.sample_rate)Voice Cloning
Pass a short reference clip with ref_audio. Clean speech-only clips work best.
result = next(model.generate(
text="This text will be spoken with the reference speaker.",
ref_audio="speaker.wav",
max_tokens=220,
))You can also compute the speaker embedding once and reuse it from the Python API:
speaker = model.extract_speaker_embedding("speaker.wav")
result = next(model.generate(
text="This reuses a precomputed speaker embedding.",
speaker_embedding=speaker,
max_tokens=220,
))CLI
python -m mlx_audio.tts.generate \
--model mlx-community/Zyphra-ZONOS2 \
--text "Hello, this is ZONOS two running with MLX audio." \
--output_path outputs \
--file_prefix zonos2Voice cloning:
python -m mlx_audio.tts.generate \
--model mlx-community/Zyphra-ZONOS2 \
--text "This text will use the voice from the reference clip." \
--ref_audio speaker.wav \
--output_path outputs \
--file_prefix zonos2_cloneGeneration Parameters
Notes
- Output audio is mono 44.1 kHz.
- DAC dependency: mlx-community/descript-audio-codec-44khz
- Speaker encoder: marksverdhei/Qwen3-Voice-Embedding-12Hz-1.7B
- Reference-audio speaker extraction uses the bundled speaker encoder.
- English text normalization handles common written forms; unsupported languages fall back to raw UTF-8 byte prompting.
- Streaming is not implemented yet. Use non-streaming generation.
License
See the Zyphra/ZONOS2 model card for upstream license and usage details.
