How to Use F5-TTS: Clone a Voice From a Short Audio Sample
CodexFuse Team · 2026-11-06T14:03:00.920Z · 20 min read min read
How to Use F5-TTS: Clone a Voice From a Short Audio Sample
Learning how to use F5-TTS takes about an hour the first time, including the PyTorch install, and only a few minutes on later runs. F5-TTS is a free, open-source text-to-speech model that clones a voice from a short reference clip, with no training on that voice, and it runs entirely on your own computer. This f5-tts tutorial follows the full arc, from install to your first clone in the Gradio app, then batch generation from the command line, with every version and command taken from the official repository and docs.
To use F5-TTS, install Python 3.10 or newer and PyTorch, run pip install f5-tts, launch f5-tts_infer-gradio, upload a clean reference clip under 12 seconds with its transcript, type the text you want spoken, and click Synthesize. The model reads your text in the voice of the clip, and the Gradio app and the command line split longer texts into chunks automatically. You need no training data, no paid account, and no cloud service, because the whole pipeline runs locally.
All facts in this guide are as of November 2026, and the current package release is 1.1.22, published 23 July 2026. CodexFuse offers no F5-TTS tool, so this guide teaches the open-source project itself, step by step, with every version, command, and limit taken from the official repository, the inference guide, and the model page.
What Is F5-TTS, Exactly?
F5-TTS is an open-source text-to-speech model that turns written text into speech in a voice copied from a short reference recording. It is a Diffusion Transformer with ConvNeXt V2, trained with flow matching, and its name stands for "A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching." The project comes from researchers including the X-LANCE Lab at Shanghai Jiao Tong University, and its paper appeared on arXiv on 9 October 2024.
F5-TTS has nothing to do with F5-Networks, the networking company behind F5 BIG-IP. The shared "F5" is a coincidence, and this guide is only about the open-source speech model. If you landed here looking for load balancers or application delivery controllers, you are in the wrong place.
F5-TTS clones a voice zero-shot, which means it needs no training on the voice it copies. You give it a few seconds of someone speaking plus the words spoken in that clip, and it reads new text in that voice straight away. That short clip plus a transcript is the whole trick of f5-tts voice cloning: the reference clip teaches the model the timbre, pace, and tone, while the text you type supplies the words.
The code is released under the MIT licence, while the official pretrained model weights are licensed CC-BY-NC, which means non-commercial use only. The weights were trained on Emilia, a large in-the-wild speech dataset, and that training data is why the non-commercial term applies. Fine-tuning does not remove the term, because a fine-tune still starts from the same weights.
If you want plain text-to-speech with no voice cloning at all, our Piper TTS guide covers a lighter local synthesizer that reads text in fixed voices. F5-TTS is the tool you reach for when the voice itself matters, because Piper cannot copy a specific person's voice from a clip.
The project is heavily used: the repository holds 15,522 stars and 2,267 forks, and the model page on Hugging Face recorded 1,303,032 downloads in the last month. The repository was created on 8 October 2024, so the project is about two years old and still actively maintained, with commits landing after the latest release.
What You Need Before You Install
F5-TTS is a normal Python project, so the install is quick if you already work in Python and slow if you do not. The slow part is almost always PyTorch, because it must match your graphics card and its driver version. Get the four items in the table first, and the rest of the install is one pip command.
| Item | What to get | Why it matters |
|---|---|---|
| Python | Version 3.10 or newer; the official example uses 3.11 | The package and its dependencies require a modern Python |
| FFmpeg | Installed through conda or your system package manager | Audio conversion and playback; a missing FFmpeg causes silent output |
| PyTorch | The build that matches your hardware, installed before f5-tts | The model runs on PyTorch, and a mismatched build fails with confusing errors |
| Disk space | Room for PyTorch, the package, and the model checkpoint | The largest single weight file is 1.3 GB, so budget a few gigabytes in total |
| Graphics card | Optional; a GPU is faster, but CPU-only works | Generation on a CPU is slow, while a GPU finishes a sentence in seconds |
| Reference audio | One clean clip of a voice, under 12 seconds | The clip is the voice you clone, so its quality sets the result |
PyTorch must be installed before the f5-tts package, because the package does not pick the right PyTorch build for you. NVIDIA users install the CUDA build, AMD users on Linux install the ROCm build, Apple Silicon users install the plain build, and CPU-only users install the plain build too. The README lists the exact command for each case, and the next section gives the two most common ones.
How Do I Install F5-TTS?
Install F5-TTS in seven steps. The whole arc is one environment, one PyTorch install, one pip install, and one launch command, and you only repeat the last step on later runs.
- Create a clean conda environment with Python 3.11, so the project never fights your other Python packages.
- Activate the environment and install FFmpeg inside it.
- Install the PyTorch build that matches your hardware, before you install f5-tts.
- Install F5-TTS itself with pip install f5-tts.
- Launch the Gradio web app with f5-tts_infer-gradio.
- Wait for the first launch to download the model checkpoint from Hugging Face, which takes a few minutes once.
- Generate your first test sentence in the app to confirm everything works.
Start with the environment and FFmpeg. The official example uses Python 3.11, and the README asks for Python 3.10 or newer.
conda create -n f5-tts python=3.11 conda activate f5-tts conda install ffmpeg
Next, install PyTorch for your hardware. The NVIDIA command below installs the CUDA 12.8 build, and Apple Silicon or CPU-only users run a plain pip install torch torchaudio instead. Pick exactly one PyTorch command, and run it before the f5-tts install.
pip install torch==2.8.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.org/whl/cu128
Now install F5-TTS itself. The pip package covers inference, which is everything this guide uses, while the editable install from a git clone adds training and fine-tuning.
pip install f5-tts
The install commands above come from the repository, and our GitHub beginner guide covers cloning a repo if you choose the editable install instead of pip. That route is git clone https://github.com/SWivid/F5-TTS.git followed by pip install -e . inside the cloned folder.
Which F5-TTS Model Should You Pick?
F5-TTS ships with three checkpoints, and the app picks the current one by default. You do not need to choose unless you want the original model or the sibling E2-TTS model, so start with the default and change it only for a reason.
| Checkpoint | File on Hugging Face | Status |
|---|---|---|
| F5TTS_v1_Base | F5TTS_v1_Base/model_1250000.safetensors | Default model, current v1 generation |
| F5TTS_Base | F5TTS_Base/model_1200000.safetensors | Original October 2024 base model, still downloadable |
| E2TTS_Base | E2TTS_Base/model_1200000.safetensors | Sibling model with a UNet transformer, selectable in the app |
Keep the two version numbers apart: 1.1.22 is the package release, and F5-TTS v1 is the model generation announced in March 2025. The release notes for 1.1.22 list a single change, a fix that spreads the chunk duration across chunks to stop long generations from running several times longer than intended.
You do not download the weights by hand in the normal path. The first launch resolves the checkpoint from Hugging Face and caches it locally, and later launches reuse it instantly. Manual download is only for offline setups, where the files go under a ckpts folder in the layout shown in the table.
The numbers below are computed from the repository and model page as fetched on 6 November 2026. The repository is 759 days old, the v1 model was announced 604 days ago, and release 1.1.22 is 106 days old, which shows a mature project with a stable current release. The repository averages about 6.85 stars per fork, and the model page's monthly downloads work out to roughly 42,033 downloads a day.
repo_created = "2024-10-08" v1_announced = "2025-03-12" release_1_1_22 = "2026-07-23" today = "2026-11-06" repo_age_days = 759 v1_age_days = 604 release_age_days = 106 stars, forks = 15522, 2267 stars_per_fork = round(stars / forks, 2) # 6.85 hf_downloads_last_month = 1303032 downloads_per_day = round(hf_downloads_last_month / 31, 1) # 42033.3 print(repo_age_days, v1_age_days, release_age_days, stars_per_fork, downloads_per_day)
How Do I Prepare a Reference Audio Clip?
The reference clip is the whole voice clone, so its quality matters more than any setting. A clean clip of a few seconds beats a long noisy recording every time, and the official inference guide states the rules plainly. Follow them before you touch the app.
Use a clip under 12 seconds, because longer reference audio is clipped to about 12 seconds anyway. Leave about one second of silence at the end, or the last word may be cut off mid-word. Keep it to one speaker, with steady loudness and no background music or noise, and write down the exact words spoken in the clip, because an exact transcript gives the closest voice match.
Clone only voices you own or have permission to use, because a short clip is enough to imitate someone convincingly. A voice is personal, so treat a reference recording the way you would treat someone's photo, and never clone a voice to mislead anyone.
Trim and convert the clip with FFmpeg first, and our FFmpeg beginner guide covers the exact trim and convert commands. A mono WAV file works everywhere in the app, and ten seconds of clear speech is a good target length.
If you do not have a transcript, leave the reference text blank and the app transcribes the clip for you with an extra speech model, at the cost of more GPU memory. You can also transcribe the clip yourself first, and our Whisper beginner guide covers that transcription step.
Two small habits save you retries. Capital letters are read out one by one, which is right for initials like K.F.C. but wrong for a normal word, so type ordinary words in lowercase. A comma or a full stop followed by a space is how you give the model a pause, and a space must follow sentence-ending punctuation or the chunking step fails.
How Do I Clone a Voice in the Gradio App?
The f5-tts gradio app is the fastest way to clone a voice, because it needs no code and no config files. Launch it from your activated environment, then open the address it prints in your browser.
f5-tts_infer-gradio
The app opens at http://127.0.0.1:7860 by default. Add --host 0.0.0.0 to serve it on your local network, or --share for a temporary public Gradio link, and the first launch downloads the model once before the page becomes usable.
The app has exactly four tabs, and each one does a different job. The Basic tab is where your first clone happens, and the other tabs cover multi-speaker scripts, voice chat, and credits.
| Tab | What it does |
|---|---|
| Basic-TTS | Single-voice generation; the page heading reads "Batched TTS" and long text is chunked automatically |
| Multi-Speech | Multi-style and multi-speaker scripts with {Style} and [voice] markers inline in the text |
| Voice-Chat | Voice chat where the Qwen2.5-3B-Instruct model writes replies and F5-TTS speaks them |
| Credits | Contributor credits for the project |
Your first clone takes four inputs in the Basic-TTS tab. Upload the reference audio, paste the exact reference text or leave it blank for automatic transcription, type the text you want spoken, and click Synthesize. The app returns the generated audio plus a spectrogram image.
The Advanced Settings accordion holds the tuning knobs. NFE steps default to 32 inside a 4 to 64 range, speed defaults to 1.0 inside a 0.3 to 2.0 range, and cross-fade duration defaults to 0.15 seconds inside a 0.0 to 1.0 range. Seed randomisation is on by default, and Remove Silences trims quiet gaps from the output.
The official app has no Podcast tab, so do not look for one: podcast-style multi-host scripts belong in the Multi-Speech tab. A Podcast tab exists only in MimicPC's hosted demo, which is a different interface from the official Gradio app.
How Do I Generate Longer Audio in Batches?
One generation supports about 30 seconds of audio in total, counting the reference clip, so a single generation gives you roughly 18 seconds of new speech after a 12-second reference. The Gradio app and the command line both split longer texts into chunks automatically, so batch generation is how you turn a script into minutes of audio.
The command line generates one sentence from one reference clip. Pass the model, the reference audio, the reference transcript, and the text to speak, and the output is a WAV file.
f5-tts_infer-cli --model F5TTS_v1_Base --ref_audio "ref_audio.wav" --ref_text "The content, subtitle or transcription of reference audio." --gen_text "Some text you want the TTS model to generate for you."
Leave the reference text empty and an automatic speech recogniser transcribes the clip for you, at the cost of extra GPU memory. Run f5-tts_infer-cli with no flags and it uses the built-in basic example config, while f5-tts_infer-cli --help lists every flag.
For a whole script, use a TOML config file instead of one command per sentence. The config names each voice with its own reference audio and transcript, points at a script file, and marks voices inside the script with bracketed names.
[voices.main] ref_audio = "main.wav" ref_text = "Hello, and welcome to the show." [voices.guest] ref_audio = "guest.wav" ref_text = "Thanks for having me on today." gen_file = "episode.txt" remove_silence = true
Run the batch with f5-tts_infer-cli -c custom.toml, and mark the voices in the script file with [main] and [guest] before their lines. The same config format drives the built-in multi-voice story example, and the Gradio Multi-Speech tab is the no-code version of the same idea.
How Do I Use F5-TTS From Python?
The Python API is the shortest path to F5-TTS inside your own program, because it needs no web app and no command line. Import F5TTS, create one instance, and call infer with the reference file, the reference text, and the text to generate.
from f5_tts.api import F5TTS
f5tts = F5TTS()
wav, sr, spec = f5tts.infer(
ref_file="basic_ref_en.wav",
ref_text="some call me nature, others call me mother nature.",
gen_text="I don't really care what you call me.",
file_wave="api_out.wav",
file_spec="api_out.png",
seed=None,
)
The call returns the waveform, the sample rate, and a spectrogram, and it writes the audio and spectrogram files when you pass file paths. See api.py in the repository for the full option list, including model selection and seed control.
The Gradio app can also be embedded as a component inside a larger Gradio project, by importing the app object and rendering it inside your own Blocks layout. Advanced users get more options in the same repo: a fine-tuning Gradio app, a TensorRT-LLM deployment guide for faster inference, and a socket server for real-time streaming speech.
How Do I Run F5-TTS in Docker or on a Cloud GPU?
Docker is the cleanest way to run F5-TTS on a machine you do not want to fill with Python packages. Build the image from the repository, then run it with GPU access, a volume mount for the Hugging Face cache, and port 7860 exposed for the Gradio app.
docker build -t f5tts:v1 . docker run --gpus=all -v ~/.cache/huggingface:/root/.cache/huggingface -p 7860:7860 f5tts:v1 f5-tts_infer-gradio --host 0.0.0.0
The volume mount matters, because it keeps the downloaded model checkpoint on your machine instead of re-downloading it on every container start. A prebuilt image also exists at ghcr.io/swivid/f5-tts:main if you would rather skip the build, and a docker-compose example is in the README.
Our Docker beginner guide covers containers from zero if Docker is new to you. The same image runs on a rented cloud GPU, where a RunPod guide walks through the same cache volume and port setup, and the install steps are identical once the container is running.
F5-TTS vs XTTS: Which Open-Source Voice Cloner Should You Pick?
F5-TTS and XTTS v2 are the two open-source voice cloners most people compare, and both are non-commercial licensed, so the choice is about quality, speed, languages, and setup pain. The table below combines a head-to-head spec comparison with a hands-on six-model listening test, and both sources are named in the Sources section.
| F5-TTS | XTTS v2 | |
|---|---|---|
| Voice cloning | Yes, zero-shot, about a 3-second reference | Yes, zero-shot, a 6-second reference, 3 seconds passable |
| Quality, English | Best overall in the hands-on listening test, strongest on long-form prosody | Very good, close enough that most listeners would not tell on short prompts |
| Speed | About 3 to 5 times real-time; real-time factor near 0.15 | About 2 times real-time; real-time factor near 0.30 |
| Languages | Base model English and Chinese; more via community fine-tunes | 17 languages built in, with cross-lingual cloning |
| Install pain | Medium-high; manual PyTorch and CUDA matching | Easy; a one-click installer exists |
| Licence | Code MIT, weights non-commercial | Non-commercial CPML, and no commercial licence is buyable since Coqui shut down in January 2024 |
| Architecture | Flow matching, Diffusion Transformer | GPT-based, autoregressive |
Pick F5-TTS when long English narration is the job, because the listening test found its prosody more natural on long inputs and its silences between sentences sound right. The same test measured about 4 seconds per sentence for F5-TTS against about 2 seconds for XTTS v2 on an RTX 3060, so XTTS is the faster generator per sentence even though F5-TTS has the better real-time factor on paper.
Pick XTTS v2 when you need many languages out of the box, a lower hardware floor, or the easiest install. F5-TTS is the newer model with the edge on English quality, while XTTS v2 is the established workhorse with broader coverage, and neither one can be used commercially under its licence.
What Are the Limits and Common Mistakes?
F5-TTS is a strong cloner with narrow limits, and most failures come from the reference clip or the text, not the model. Knowing the limits before you start saves you the retry loop that every beginner hits.
There is no official VRAM figure, so treat every number you read as a third-party report: published claims range from about 3 GB to 16 GB depending on the checkpoint and precision. The only official speed figure is a benchmark on a single L20 GPU, where PyTorch inference ran at a 0.15 real-time factor, and a community guide independently reports the same 0.15 figure.
If the output is pure silence, check that FFmpeg is installed, because that is the fix the official inference guide gives. If the voice sounds wrong, check the reference clip first: a noisy clip, a wrong transcript, or two speakers in one clip all degrade the result, and the exact transcript matters more than people expect.
One generation covers about 30 seconds in total, so plan scripts in chunks and let the app or the CLI split them for you. Long reference clips do not help, because anything past about 12 seconds is clipped, and a missing space after sentence-ending punctuation breaks the chunking step.
The base model officially supports English and Chinese, and other languages come from community fine-tunes listed in the repository, not from the base checkpoint. Guides that list many languages out of the box are describing those fine-tunes, so check which checkpoint a language claim belongs to before you believe it.
What Can You Build With a Cloned Voice?
As a zero shot voice cloning open source project, F5-TTS is most useful for your own projects, where the voice is yours and the use is personal. Narrate your own videos, record an audiobook draft in your own voice, voice a game character, or build a podcast intro that sounds like you, all without a studio or a recording session.
Accessibility is a strong use case, because a person losing their voice can bank a short recording and keep speaking in their own voice. Language learners can hear their own pronunciation read back, and developers can prototype voice interfaces before hiring voice actors.
Keep the licence in mind for anything public: the official weights are non-commercial, so a monetised video narrated with the official model is outside the licence. A community model under a permissive licence exists for commercial work, but it is labelled alpha, weaker than the official model, and English only.
Sources
Official sources: the F5-TTS repository on GitHub, github.com/SWivid/F5-TTS, for the README, install steps, licence, and release history; the releases page, github.com/SWivid/F5-TTS/releases, for version 1.1.22, published 23 July 2026; the inference guide, github.com/SWivid/F5-TTS/blob/main/src/f5_tts/infer/README.md, for reference-audio rules, the Gradio app, the CLI, and the Python API; and the Gradio app source, infer_gradio.py, for the four tabs, slider defaults, and launch options.
Model sources: the Hugging Face model page, huggingface.co/SWivid/F5-TTS, for the checkpoints, the paper link, and the 1,303,032 downloads in the last month; and the F5-TTS paper, arXiv:2410.06885, published 9 October 2024.
Comparison sources: PromptQuorum, promptquorum.com/power-local-llm/local-tts-voice-cloning-piper-coqui-xtts, for the F5-TTS versus XTTS head-to-head table with licences verified in June 2026; RareBuildSoftware, rarebuildsoftware.com/blog/best-open-source-voice-cloning-2026.html, published 26 April 2026, for the hands-on six-model test on an RTX 3060; and the T5Gemma-TTS Technical Report, arXiv:2604.01760, published 3 April 2026, for the real-time-factor and reference-length table.
Guide sources: MyVoiceClones, myvoiceclones.com/articles/f5-tts-voice-cloning/, updated 13 October 2026, for the licensing explainer and the OpenF5-TTS alternative; MurmurTTS, murmurtts.com/blog/f5-tts-mac-guide, updated around 20 October 2026, for the Mac install and the MLX port; MrTechKing, mrtechking.com/f5-tts-github/, scanned 22 October 2026, for the independent security scan and version check; and RunPod, runpod.io/articles/guides/f5-tts-on-runpod, updated around 15 October 2026, for the cloud GPU deployment.
Further guides: MimicPC, mimicpc.com/demo/f5-tts, for the hosted demo and its own Podcast Tab; RunComfy, runcomfy.com/comfyui-workflows/comfyui-f5-tts-workflow-text-to-speech-voice-cloning, updated around January 2026, for the ComfyUI integration; RunLocalAI, runlocalai.co/models/f5-tts, reviewed October 2026, for the 0.336B parameter figure and the 0.15 real-time factor; and CPU3D, cpu3d.com/en/aiaudio/f5-tts/, values checked 3 November 2026, for the 1.3 GB largest weight file.
Frequently Asked Questions
Is F5-TTS free to use?
Yes, the code is free under the MIT licence, and the official pretrained weights are free for personal and research use under a non-commercial licence. You cannot use the official model for paid work such as a monetised video, a paid audiobook, or a client advertisement, and a community model under a permissive licence exists if you need commercial use.
How long should the reference audio be?
Use a clean clip under 12 seconds, with about one second of silence at the end so the last word is not cut off. Longer clips are clipped to about 12 seconds anyway, so a short, clean, single-speaker recording with an exact transcript gives the best clone.
Can F5-TTS run on a CPU or a Mac?
Yes, F5-TTS runs on a CPU and on Apple Silicon, but generation is slow without a graphics card. Apple Silicon users install PyTorch with a plain pip install torch torchaudio, and a community MLX port exists for Macs that want Apple's own machine-learning stack.
How long can one F5-TTS generation be?
One generation covers about 30 seconds of audio in total, counting the reference clip, so you get roughly 18 seconds of new speech after a 12-second reference. The Gradio app and the command line split longer texts into chunks automatically, so batch generation handles scripts of any length.
Is F5-TTS better than XTTS?
For long-form English narration, yes, according to a hands-on six-model listening test published in April 2026, which ranked F5-TTS best overall on English quality and prosody. XTTS v2 wins on install ease, 17 built-in languages, and a lower hardware floor, so pick XTTS when coverage or setup speed matters more than long-form quality.




