Files
spark-pocket-tts/docs/generate.md
T
thataboyandVáclav Volhejn edec7f8790 Add .safetensors save/load to get_state_for_audio_prompt (#69)
Quality of life improvement to save user voice embedding as a
.safetensors file that can be loaded for subsequent use, achieving the
same efficiency as the predefined voices, all via the existing
get_state_for_audio_prompt function.

---------

Co-authored-by: Václav Volhejn <8401624+vvolhejn@users.noreply.github.com>
2026-01-26 10:36:27 +01:00

2.7 KiB

Generate Command Documentation

The generate command allows you to generate speech from text directly from the command line using Kyutai Pocket TTS.

Basic Usage

uvx pocket-tts generate
# or if installed manually:
pocket-tts generate

This will generate a WAV file ./tts_output.wav with the default text and voice.

Command Options

Core Options

  • --text TEXT: Text to generate (default: "Hello world! I am Kyutai Pocket TTS. I'm fast enough to run on small CPUs. I hope you'll like me.")
  • --voice VOICE: Path to audio conditioning file (voice to clone) (default: "hf://kyutai/tts-voices/alba-mackenna/casual.wav"). Urls and local paths are supported.
  • --output-path OUTPUT_PATH: Output path for generated audio (default: "./tts_output.wav")

Generation Parameters

  • --variant VARIANT: Model signature (default: "b6369a24")
  • --lsd-decode-steps LSD_DECODE_STEPS: Number of generation steps (default: 1)
  • --temperature TEMPERATURE: Temperature for generation (default: 0.7)
  • --noise-clamp NOISE_CLAMP: Noise clamp value (default: None)
  • --eos-threshold EOS_THRESHOLD: EOS threshold (default: -4.0)
  • --frames-after-eos FRAMES_AFTER_EOS: Number of frames to generate after EOS (default: None, auto-calculated based on the text length). Each frame is 80ms.

Performance Options

  • --device DEVICE: Device to use (default: "cpu", you may not get a speedup by using a gpu since it's a small model)
  • --quiet, -q: Disable logging output

Examples

Basic Generation

# Generate with default settings
pocket-tts generate

# Custom text
pocket-tts generate --text "Hello, this is a custom message."

# Custom output path
pocket-tts generate --output-path "./my_audio.wav"

Voice Selection

# Use different voice from HuggingFace
pocket-tts generate --voice "hf://kyutai/tts-voices/jessica-jian/casual.wav"

# Use local voice file
pocket-tts generate --voice "./my_voice.wav"

# Use a safetensors file (such as one created using `pocket-tts export-voice`)
pocket-tts generate --voice "./my_voice.safetensors"

Quality Tuning

# Higher quality (more steps)
pocket-tts generate --lsd-decode-steps 5 --temperature 0.5

# More expressive (higher temperature)
pocket-tts generate --temperature 1.0

# Adjust EOS threshold, smaller means finishing earlier.
pocket-tts generate --eos-threshold -3.0

Output Format

The generate command always outputs WAV files in the following format:

  • Sample Rate: 24kHz
  • Channels: Mono
  • Bit Depth: 16-bit PCM
  • Format: Standard WAV file

For more advanced usage, see the Python API documentation or consider using the serve command for web-based generation and quick iteration.