You can initialize the ChatterboxTTS client using two primary methods:
from_pretrained(device): Downloads and loads the necessary model weights (VoiceEncoder, T3, S3Gen, tokenizer, and conditionals) from the Hugging Face Hub (ResembleAI/chatterbox).from_local(ckpt_dir, device): Loads the model from a local directory containing the required .pt and .json files.
Supported devices include cpu, mps (macOS), and CUDA-enabled GPUs. When loading on non-CUDA devices, the client automatically handles mapping to CPU to prevent errors with CUDA-saved models.
from chatterbox.tts import ChatterboxTTS
# Option 1: Load from Hugging Face
tts = ChatterboxTTS.from_pretrained(device="cuda")
# Option 2: Load from local directory
# ckpt_dir must contain ve.pt, t3_cfg.pt, s3gen.pt, tokenizer.json, and conds.pt
tts = ChatterboxTTS.from_local("path/to/checkpoints", device="cpu")