News icon

Kimi K3 is now available on Runpod

How to Run F5-TTS on Runpod

F5-TTS clones a voice from 5-15 seconds of reference audio using flow matching rather than the token-by-token autoregressive decoding older TTS models use, which means it doesn't accumulate errors on long passages the way older architectures do. At roughly 500M parameters and 2-3 GB of VRAM at FP16, it's also one of the lightest models in this guide series to deploy. This covers getting it running on Runpod as a callable API rather than just the demo Gradio UI.

1. License, before anything else

F5-TTS's code is MIT-licensed, but the pretrained model weights are licensed CC-BY-NC-4.0 because they're trained on the Emilia dataset, which restricts commercial use. If you're building a commercial voice product, confirm your use case against that license before shipping, or plan to fine-tune on your own licensed audio and train weights you can license yourself.

2. GPU selection

F5-TTS's VRAM footprint is small enough that GPU choice is mostly about throughput and concurrency rather than whether the model fits at all:

  • RTX 4090 (24 GB) or L4 (24 GB): comfortably handles single-stream generation with significant headroom; the right default for most deployments
  • L40S or A100 80GB: only worth it if you're batching many concurrent generation requests, since a single F5-TTS worker doesn't need this much VRAM on its own

3. Launching a Runpod Pod with F5-TTS

From Pods > GPU Cloud, deploy on an RTX 4090 with:

ghcr.io/swivid/f5-tts:main

Attach a Network Volume mounted at /root/.cache/huggingface/hub so the model checkpoint persists across restarts instead of re-downloading on every boot.

Under Expose Ports, add port 7860, the default Gradio port. Runpod's proxy serves it at https://{POD_ID}-7860.proxy.runpod.net.

Set the start command to launch the Gradio interface bound to all network interfaces, not just localhost:

f5-tts_infer-gradio --host 0.0.0.0

4. Wrapping F5-TTS in a REST API

The Gradio UI is fine for manual testing, but a production integration needs a real API rather than driving a web form. Wrap the Python package in FastAPI:

from fastapi import FastAPI
from f5_tts import F5TTS
import tempfile

app = FastAPI()
tts = F5TTS(device="cuda")

@app.post("/generate")
def generate_speech(text: str, ref_audio_path: str, ref_text: str):
    with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as f:
        tts.generate(
            text=text,
            ref_audio=ref_audio_path,
            ref_text=ref_text,
            output_path=f.name,
        )
        return {"audio_path": f.name}

Build this into a custom Dockerfile extending the official image, expose whatever port your FastAPI app listens on, and set that as the pod's start command instead of the Gradio launcher.

5. Zero-shot voice cloning in practice

F5-TTS's default checkpoint (F5TTS_v1_Base) is already zero-shot; there's no separate "voice cloning mode" to enable. Provide a 5-15 second reference clip and its exact transcript alongside the target text, and the model conditions on that reference's voice characteristics:

tts.generate(
    text="This is my cloned voice speaking new text.",
    ref_audio="reference_voice.wav",
    ref_text="This is the reference text spoken in the audio.",
    output_path="cloned_output.wav",
)

Reference audio quality matters more than length past the 5-15 second minimum: a clean, single-speaker clip with minimal background noise clones more reliably than a longer but noisier one.

6. Language coverage

The base checkpoint was trained primarily on English and Chinese audio (the Emilia dataset). Other languages work, but quality depends on community-finetuned checkpoints rather than the base model; check the F5-TTS Hugging Face organization for language-specific checkpoints before assuming out-of-the-box quality on a language outside that pair.

7. Testing the deployment

Once the pod is running, open the Gradio UI at your proxy URL to sanity-check generation quality with a reference clip before wiring up the API path. For the FastAPI wrapper:

curl -X POST https://{POD_ID}-{PORT}.proxy.runpod.net/generate \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from Runpod.", "ref_audio_path": "/path/to/ref.wav", "ref_text": "reference transcript"}'

8. Quick-start checklist

  1. Confirm CC-BY-NC-4.0 fits your use case, or plan to train your own weights for commercial deployment
  2. Create an RTX 4090 Pod with ghcr.io/swivid/f5-tts:main, a Network Volume, and port 7860 exposed
  3. Launch with f5-tts_infer-gradio --host 0.0.0.0 for initial testing
  4. Wrap the Python package in FastAPI for a production-callable endpoint
  5. Provide a clean 5-15 second reference clip and exact transcript for cloning

Deploy on Runpod →

Purple glow background

Related articles

View All
No items found.

Build what’s next.

Build, train, and scale AI workloads on Runpod with cloud GPUs, Serverless, and Clusters.

Star field background