Miso TTS 8B Documentation

repository·main·Indexed 25 days ago

https://github.com/misolabsai/misotts

Inference code for Miso TTS 8B, a text-to-dialogue RVQ Transformer for high-quality conversational speech generation. It utilizes a Llama 3.2-style backbone and an autoregressive audio decoder to generate Mimi audio codes. Supports English-only text-to-speech and voice cloning via prompted generation. Requires Python 3.10 and high-VRAM GPUs for optimal performance.

Tokens
1.1K
Snippets
4
Records
5
Agent score
35%

What's inside Miso TTS 8B

  1. Install and run Miso TTS 8B locally using pip

    main

    If you prefer using pip, create a Python 3.10 virtual environment, activate it, and install the package in editable mode before running the example script.

    python3.10 -m venv .venv
    source .venv/bin/activate
    pip install -e .
    python run_misotts.py
  2. Install and run Miso TTS 8B locally using uv

    main

    To set up the environment using uv, install uv first, clone the repository, and sync the environment with Python 3.10. You can then run the provided example conversation script which downloads the model from Hugging Face automatically.

    # Install uv if not present
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Clone and setup
    git clone https://github.com/MisoLabsAI/MisoTTS.git
    cd MisoTTS
    uv sync --python 3.10
    source .venv/bin/activate
    
    # Run the example
    uv run python run_misotts.py
  3. Perform prompted generation for voice cloning

    main

    Miso TTS can condition generation on prior audio (voice cloning) by providing a list of Segment objects to the context parameter in the .generate() method. Each Segment requires a speaker ID, the text transcript of the audio, and the audio tensor itself.

    import torchaudio
    
    from generator import Segment, load_miso_8b
    
    generator = load_miso_8b(device="cuda")
    
    prompt_audio, sample_rate = torchaudio.load("prompt.wav")
    prompt_audio = torchaudio.functional.resample(
        prompt_audio.squeeze(0),
        orig_freq=sample_rate,
        new_freq=generator.sample_rate,
    )
    
    context = [
        Segment(
            speaker=0,
            text="This is the transcript for the prompt audio.",
            audio=prompt_audio,
        )
    ]
    
    audio = generator.generate(
        text="This is the next sentence to synthesize.",
        speaker=0,
        context=context,
        max_audio_length_ms=10_000,
    )
  4. Use the Miso TTS 8B Python API for text-to-speech

    main

    Use load_miso_8b to initialize the generator and .generate() to synthesize audio from text. The model currently supports English only. The output is a tensor that can be saved using torchaudio.

    import torch
    import torchaudio
    
    from generator import load_miso_8b
    
    device = "cuda" if torch.cuda.is_available() else "cpu"
    
    generator = load_miso_8b(
        device=device,
        model_path_or_repo_id="MisoLabs/MisoTTS",
    )
    
    audio = generator.generate(
        text="Hello from Miso.",
        speaker=0,
        context=[],
        max_audio_length_ms=10_000,
    )
    
    torchaudio.save("miso.wav", audio.unsqueeze(0).cpu(), generator.sample_rate)
  5. Check Miso TTS 8B system requirements and VRAM needs

    main

    Miso TTS 8B is a large model (~8.2B parameters). For interactive use, a high-VRAM GPU is recommended. GPU inference defaults to torch.bfloat16.

    VRAM Requirements (Approximate):

    • bfloat16/fp16: ~16 GB weights, 24 GB VRAM recommended (e.g., RTX 3090/4090, A5000, L4).
    • float32: ~33 GB weights, 40 GB+ VRAM recommended (e.g., A100 40GB, A6000, H100).

    Other Requirements:

    • CPU: Slow inference. Requires ~20 GB RAM for bfloat16 and ~40 GB for float32.
    • Disk: ~30–40 GB free space for model weights, Mimi codec, SilentCipher watermarker, and Llama 3.2 tokenizer.