Skip to content

How to Use F5-TTS Locally (2026): Install, Voice Cloning, CLI and Finetuning

7–11 minutes
Amazed woman with an auburn bob in a blue hoodie and denim jacket at a busy tech conference holding a card reading F5-TTS, with the text Clone Your Voice Free F5-TTS

F5-TTS is a free, open source text-to-speech model that can copy the voice style of a short reference clip and read any text in that voice. It runs on your own PC with an NVIDIA, AMD, Intel or Apple Silicon GPU, and comes with a simple web app, a command-line tool and a Python API.

It was built by researchers from SJTU’s X-LANCE lab and partners, and its v1 base model handles English and Chinese. Community finetunes add many more languages, including Hindi, French, German, Japanese and Spanish.

This guide shows how to install F5-TTS, generate speech in the web app and CLI, make multi-voice stories, use the Python API, finetune on your own data and fix common errors. It follows the official F5-TTS README and docs as of November 2026 (package version 1.1.22).

TL;DR

  • What: open source zero-shot voice cloning TTS using flow matching.
  • Install: PyTorch for your GPU, then pip install f5-tts (Python 3.10+, FFmpeg needed).
  • Web app: f5-tts_infer-gradio, then open http://127.0.0.1:7860.
  • Reference clip: under 12 seconds, with about 1 second of silence at the end.
  • License: code is MIT, but the official models are CC-BY-NC (non-commercial).
  • Rule: only clone your own voice or one you have clear permission to use.

What F5-TTS Is Good At

  • Zero-shot voice cloning: give it a few seconds of speech plus the transcript, and it speaks new text in that style.
  • Long text: the web app and CLI split long scripts into chunks automatically.
  • Multi-speaker stories: switch between voices inside one script.
  • Voice chat: the web app includes a chat mode powered by Qwen2.5-3B-Instruct.
  • Finetuning: train it on a new language or voice dataset with a Gradio training app.
Model What it is
F5TTS_v1_Base The current default (March 2025), better training and inference than the first release
F5TTS_Base The original 2024 model; the one that supports the BigVGAN vocoder
E2TTS_Base A reproduction of Microsoft’s E2 TTS paper, included for comparison

For most people, F5TTS_v1_Base is the right choice. The project’s own benchmark shows an offline PyTorch real-time factor of about 0.15 on an L20 GPU, which means a second of audio takes well under a second to make. Your speed will depend on your GPU.

What You Need

Item Requirement
Python 3.10 or newer (the README uses 3.11)
FFmpeg Required; missing FFmpeg is a common cause of silent output
GPU NVIDIA (CUDA), AMD (ROCm, Linux only), Intel (XPU) or Apple Silicon
Disk Room for PyTorch plus model downloads from Hugging Face
Reference audio A clean WAV or FLAC clip under 12 seconds

Install F5-TTS

  1. Create an environment so F5-TTS doesn’t clash with other AI tools:
    conda create -n f5-tts python=3.11
    conda activate f5-tts
    conda install ffmpeg
  2. Install PyTorch for your GPU. For NVIDIA with CUDA 12.8, the README uses:
    pip install torch==2.8.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.org/whl/cu128
  3. AMD on Linux: use the ROCm build. The README notes RX 9060/9070 and Radeon 8050S/8060S cards need ROCm 7.x:
    pip install torch==2.9.1+rocm7.2 torchaudio==2.9.1+rocm7.2 --extra-index-url https://download.pytorch.org/whl/rocm7.2
  4. Apple Silicon: plain pip install torch torchaudio is enough.
  5. Install F5-TTS for inference only:
    pip install f5-tts
  6. Or install from source if you also want to train or finetune:
    git clone https://github.com/SWivid/F5-TTS.git
    cd F5-TTS
    pip install -e .

The first run downloads the model from Hugging Face automatically, so give it a few minutes.

Run With Docker

If you’d rather not touch Python, the project publishes a container image. With an NVIDIA GPU and the NVIDIA Container Toolkit installed, start just the web app with:

docker container run --rm -it --gpus=all --mount 'type=volume,source=f5-tts,target=/root/.cache/huggingface/hub/' -p 7860:7860 ghcr.io/swivid/f5-tts:main f5-tts_infer-gradio --host 0.0.0.0

The named volume keeps downloaded models between runs, so you only download them once. Open http://localhost:7860 when it’s ready. The README also includes a Docker Compose example with a GPU reservation.

Use the Web App

  1. Start it:
    f5-tts_infer-gradio

    Add --inbrowser to open it automatically, or --port 7860 --host 0.0.0.0 to reach it from another device on your network.

  2. Upload a reference clip of under 12 seconds, with about 1 second of silence at the end.
  3. Type the reference text, or leave it empty so a speech recognition model transcribes it (this uses extra GPU memory).
  4. Type the text you want spoken and click synthesize.
  5. Listen and download the result. Re-run with a different seed if a line sounds off.

Avoid --share unless you need it, because it creates a public link to your app. The README’s writing tips help a lot:

  • Uppercase letters are spelled out letter by letter, so write “K.F.C.” for an acronym and lowercase for normal words.
  • Add commas, full stops or spaces to create pauses.
  • Put a space after each full stop, or the chunker may not split sentences properly.
  • Keep each generation under 30 seconds total; the app chunks longer text for you.

Use the Command Line

f5-tts_infer-cli --model F5TTS_v1_Base \
  --ref_audio "my_voice.wav" \
  --ref_text "The exact words spoken in my reference clip." \
  --gen_text "This sentence is generated by F5-TTS on my own computer."

Leaving --ref_text "" makes it transcribe the clip automatically. Other useful options:

Option What it does
-c custom.toml Load all settings from a TOML file
--ckpt_file path Use a downloaded or finetuned checkpoint
--vocab_file path Use a custom vocab.txt (needed for many community models)
--vocoder_name bigvgan Use BigVGAN instead of Vocos (F5TTS_Base only)
--help List every flag

A TOML file is handy for long scripts. Set gen_file to a text file and the CLI reads it instead of gen_text. Set remove_silence = true to trim long gaps.

Multi-Voice Stories

You can make a short drama or a dialogue with several voices from one script.

  1. Make a TOML file with a main voice and extra voices:
    model = "F5TTS_v1_Base"
    ref_audio = "narrator.wav"
    ref_text = ""
    gen_file = "story.txt"
    remove_silence = true
    output_dir = "output"
    
    [voices.alex]
    ref_audio = "alex.wav"
    ref_text = ""
    
    [voices.sam]
    ref_audio = "sam.wav"
    ref_text = ""
  2. Mark voices in story.txt with tags such as [main], [alex] and [sam] wherever the speaker changes.
  3. Run it: f5-tts_infer-cli -c story.toml.

The web app’s Multi-Style / Multi-Speaker tab does the same thing without a file.

Python API

from f5_tts.api import F5TTS

tts = F5TTS()
wav, sr, spec = tts.infer(
    ref_file="my_voice.wav",
    ref_text="The exact words spoken in my reference clip.",
    gen_text="Hello from a Python script running F5-TTS locally.",
    file_wave="output.wav",
    seed=None,
)

This is the easiest way to batch-generate lines for a video, game or app. You can also embed the whole web app inside a bigger Gradio project by importing app from f5_tts.infer.infer_gradio.

More Languages

The official v1 model is trained on Chinese and English. The project’s SHARED.md page lists community checkpoints for Arabic, Finnish, French, German, Hindi, Italian, Japanese, Latvian, Russian, Spanish and more.

  1. Open SHARED.md in the F5-TTS repo and pick a model for your language.
  2. Check its license in the model card table; many are non-commercial.
  3. Download the checkpoint and its vocab file.
  4. Load them in the web app’s custom model option, or with --ckpt_file and --vocab_file in the CLI.

Use a reference clip in the same language as the model for the most natural accent.

Finetune on Your Own Voice Data

Finetuning needs a source install and a decent GPU.

  1. Prepare a CSV with the header audio_file|text and absolute paths to your clips.
  2. Convert it:
    python src/f5_tts/train/datasets/prepare_csv_wavs.py /path/to/metadata.csv /path/to/output
  3. Start the training app: f5-tts_finetune-gradio, or use accelerate launch with a config from src/f5_tts/configs.
  4. Test early checkpoints with use_ema turned off. The docs say EMA weights can hurt checkpoints that have only had a few updates.

Only train on recordings you own or have written permission to use.

License and Responsible Use

The code is MIT licensed, but the official pre-trained models are CC-BY-NC because of the Emilia training data. That means no commercial use of those models. If you need commercial rights, look for a model with a permissive license, or compare our Chatterbox TTS guide (MIT code) and Voicebox tutorial.

  • Get consent: only clone your own voice or a voice whose owner has agreed.
  • Never impersonate real people, public figures or customers.
  • Label AI audio in videos and podcasts, and follow each platform’s rules.
  • Check local laws, as many regions now regulate synthetic voices.

Troubleshooting

Problem Likely cause Fix
Output is pure silence FFmpeg missing Install FFmpeg and check ffmpeg -version
Words cut off at the start Reference clip too long or no silence Trim to under 12 s and leave about 1 s of silence at the end
Acronyms read wrongly Case rules Use “K.F.C.” style for letters, lowercase for words
CUDA out of memory ASR or chat model loaded too Type the reference text yourself; close other GPU apps
Very slow CPU-only PyTorch Reinstall the CUDA, ROCm or XPU build of PyTorch
HIP error: invalid device function New AMD GPU on ROCm 6.x Install the ROCm 7.x PyTorch build
Garbled speech with a community model Wrong vocab file Load the model’s own vocab.txt
Finetuned voice sounds like the base model EMA weights on an early checkpoint Turn off use_ema

For general GPU memory issues, see our CUDA out of memory fix. Need subtitles for the audio you made? WhisperX adds word-level timestamps.

FAQ

Is F5-TTS free?

Yes. The code is MIT licensed and free. The official models are free for non-commercial use under CC-BY-NC.

Can I use F5-TTS commercially?

Not with the official checkpoints, because of their CC-BY-NC license. Check each community model’s license on SHARED.md.

How long should the reference audio be?

Under 12 seconds, with about a second of silence at the end. Longer clips are cut to about 12 seconds.

Does F5-TTS work on AMD or Mac?

Yes. AMD works through ROCm on Linux, and Apple Silicon works with standard PyTorch. There’s also a community MLX port for Macs.

Does F5-TTS support Hindi?

Yes, through a community model from IIT Madras’s SPRING Lab listed on SHARED.md.

Can it read a whole book?

Yes. Use a TOML file with gen_file. The CLI splits long text into chunks automatically.

What’s the difference between F5-TTS and E2 TTS?

Both ship in the same repo. F5-TTS uses a Diffusion Transformer and is the main, faster model; E2 TTS is a reproduction of another paper for comparison.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Amazed woman with an auburn bob in a blue hoodie and denim jacket at a busy tech conference holding a card reading F5-TTS, with the text Clone Your Voice Free F5-TTS