CoolFace
Modelpublic

FluidInference/qwen3-tts-coreml

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
3likes42downloads
Model Card

Qwen3-TTS CoreML

CoreML conversion of Qwen/Qwen3-TTS (0.6B) for on-device inference on Apple platforms.

Supports English and Chinese text-to-speech synthesis.

Models

ModelDescriptionSize
qwen3_tts_lm_prefill_v9LM KV-cache prefill (text + speaker conditioning)~2.8 GB
qwen3_tts_lm_decode_v10Autoregressive LM decode (CB0 codec token generation)~1.8 GB
qwen3_tts_cp_prefillCode predictor prefill (CB1-15 conditioning)~432 MB
qwen3_tts_cp_decodeCode predictor decode (CB1-15 generation)~420 MB
qwen3_tts_decoder_10sAudio decoder (16-codebook codes → 24kHz waveform)~436 MB
speaker_embedding_official.npyDefault speaker embedding (1024-dim)4 KB

Total: ~5.9 GB

Pipeline

Text tokens + Speaker embedding
        ↓
  LM Prefill (KV cache initialization)
        ↓
  LM Decode (CB0 codec tokens, temperature=0.9, top_k=50)
        ↓
  Code Predictor Prefill + Decode (CB1-15 per frame)
        ↓
  Audio Decoder (16 codebooks → 24kHz waveform)
        ↓
  Silence trimming → Final audio

Key Parameters

  • Sample rate: 24,000 Hz
  • Codebooks: 16 (CB0 from LM, CB1-15 from code predictor)
  • Max codec tokens: 125 frames (~10s audio)
  • Sampling: temperature=0.9, top_k=50 (both CB0 and CB1-15)
  • EOS token ID: 2150 (in codec logit space)

Usage

swift
import FluidAudioTTS

let manager = Qwen3TtsManager()
try await manager.loadFromDirectory(modelDir)

let wav = try await manager.synthesize(
    text: "Hello world",
    tokenIds: [9707, 1879, ...],  // Pre-tokenized with Qwen3 processor
    useSpeaker: true
)

See FluidAudio for the full Swift framework.

Conversion

Converted using coremltools from the original PyTorch weights. Conversion scripts are in the mobius repository.

License

Apache-2.0, inherited from Qwen/Qwen3-TTS.

References