Sign inSign up

babanovac1980/chatterbox-tts-server

By babanovac1980

•Updated over 1 year ago

Image
0

420

babanovac1980/chatterbox-tts-server repository overview

⁠Chatterbox TTS Server Docker Image

A containerized FastAPI server for the powerful Chatterbox TTS model by Resemble AI. Features a modern Web UI, voice cloning, large text processing, and GPU acceleration.

⁠Features

šŸ—£ļø High-quality text-to-speech synthesis
šŸŽ¤ Voice cloning with reference audio
🌐 Modern Web UI and REST API
šŸ“š Large text handling with intelligent chunking
šŸš€ GPU acceleration (NVIDIA CUDA 12.4)
šŸ”„ OpenAI-compatible API endpoints
šŸ“¦ Pre-built voices included

⁠Quick Start

Prerequisites:

  • Docker & Docker Compose
  • NVIDIA GPU with CUDA 12.4+ support
  • NVIDIA Container Toolkit

⁠Configuration

šŸ”§ Environment Variables:

  • PORT - Host port to expose (default: 8004)
  • HF_HUB_ENABLE_HF_TRANSFER - Enable faster downloads (default: 1)
  • NVIDIA_VISIBLE_DEVICES - GPU devices to expose (default: all)
  • NVIDIA_DRIVER_CAPABILITIES - Driver capabilities (default: compute,utility)

šŸ“ Volume Mounts:

  • ./config/config.yaml → /app/config.yaml (Application configuration)
  • ./data/voices → /app/voices (Predefined voice files)
  • ./data/reference_audio → /app/reference_audio (Reference audio for cloning)
  • ./data/outputs → /app/outputs (Generated audio files)
  • ./data/logs → /app/logs (Application logs)
  • ./data/models → /app/hf_cache (Cached model files)

⁠API Usage

Generate Speech:

curl -X POST "http://localhost:8004/tts" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, this is Chatterbox TTS!",
    "voice_mode": "predefined",
    "voice_id": "default"
  }' \
  --output speech.wav

Voice Cloning:

curl -X POST "http://localhost:8004/tts" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This will sound like the reference voice!",
    "voice_mode": "clone",
    "clone_reference_filename": "my_voice.wav"
  }' \
  --output cloned_speech.wav

⁠Configuration Options

The default configuration works out of the box. To customize:

  1. Edit config/config.yaml
  2. Restart the container: docker restart chatterbox-tts-server

Key configuration options:

  • tts_engine.device: Set to "auto", "cuda", or "cpu"
  • server.port: Internal server port (keep as 8000)
  • generation_defaults: Default TTS parameters

⁠GPU Requirements

  • NVIDIA GPU with Compute Capability 6.0+
  • CUDA 12.4+ support
  • Minimum 4GB VRAM recommended
  • 8GB+ VRAM for optimal performance

⁠Troubleshooting

GPU not detected:

  • Ensure NVIDIA Container Toolkit is installed
  • Check GPU compatibility: nvidia-smi
  • Verify Docker can access GPU: docker run --gpus all nvidia/cuda:12.4.0-base-ubuntu22.04 nvidia-smi

Model download issues:

  • Check internet connection
  • Ensure sufficient disk space (models are ~2-3GB)
  • Check HuggingFace Hub status

Performance issues:

  • Increase shared memory: add shm_size: '2gb' to docker-compose
  • Monitor GPU memory usage
  • Consider reducing model precision in config

Tag summary

Content type

Image

Digest

sha256:2aae9a01c…

Size

5 GB

Last updated

over 1 year ago

docker pull babanovac1980/chatterbox-tts-server