Overview
TheConditionals dataclass stores voice and style conditioning information used by Chatterbox TTS models. It encapsulates both T3 (text-to-tokens) conditionals and S3Gen (tokens-to-audio) conditionals required for voice cloning and speech generation.
Class Signature
Attributes
T3 model conditionals containing:
speaker_emb: Voice encoder speaker embeddingclap_emb: Optional CLAP audio-text embeddingcond_prompt_speech_tokens: Speech tokens from reference audiocond_prompt_speech_emb: Speech embeddings from reference audioemotion_adv: Exaggeration level for expressive speech (0.0 to 1.0+)
S3Gen model conditionals dictionary containing:
prompt_token: Reference audio tokensprompt_token_len: Length of reference tokensprompt_feat: Reference audio featuresprompt_feat_len: Length of reference featuresembedding: Voice embedding for generation
Methods
to()
Move conditionals to a specified device.Parameters
Target device (“cuda”, “cpu”, or “mps”)
Returns
The conditionals object with all tensors moved to the specified device
Example
save()
Save conditionals to a file for later reuse.Parameters
Path where the conditionals will be saved as a .pt file
Example
load()
Load conditionals from a saved file.Parameters
Path to the saved conditionals .pt file
Device to load the conditionals onto (“cuda”, “cpu”, or “mps”)
Returns
Loaded Conditionals object
Example
Usage Examples
Save and Reuse Voice Conditionals
Transfer Conditionals Between Models
Move Conditionals Between Devices
Notes
- Conditionals are automatically created when you call
prepare_conditionals()on a TTS model - Saved conditionals are portable and can be shared or reused across sessions
- The same conditionals can be used with different models in the Chatterbox family (TTS, TurboTTS, MultilingualTTS)
- Moving conditionals to a device is necessary before inference to ensure tensor compatibility
- Conditionals files are typically small (a few MB) compared to model checkpoints
- The
emotion_advparameter in T3Cond controls voice exaggeration and can be adjusted per generation