Skip to main content

Overview

The Conditionals 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

T3Cond
required
T3 model conditionals containing:
  • speaker_emb: Voice encoder speaker embedding
  • clap_emb: Optional CLAP audio-text embedding
  • cond_prompt_speech_tokens: Speech tokens from reference audio
  • cond_prompt_speech_emb: Speech embeddings from reference audio
  • emotion_adv: Exaggeration level for expressive speech (0.0 to 1.0+)
dict
required
S3Gen model conditionals dictionary containing:
  • prompt_token: Reference audio tokens
  • prompt_token_len: Length of reference tokens
  • prompt_feat: Reference audio features
  • prompt_feat_len: Length of reference features
  • embedding: Voice embedding for generation

Methods

to()

Move conditionals to a specified device.

Parameters

str
required
Target device (“cuda”, “cpu”, or “mps”)

Returns

Conditionals
The conditionals object with all tensors moved to the specified device

Example

save()

Save conditionals to a file for later reuse.

Parameters

Path
required
Path where the conditionals will be saved as a .pt file

Example

load()

Load conditionals from a saved file.

Parameters

Path
required
Path to the saved conditionals .pt file
str
default:"cpu"
Device to load the conditionals onto (“cuda”, “cpu”, or “mps”)

Returns

Conditionals
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_adv parameter in T3Cond controls voice exaggeration and can be adjusted per generation