GPT-SoVITS
by bilibili
Voice cloning and text-to-speech tool that can train a voice model from about 1 minute of audio.
- Stars
- 64,251 stars
- Forks
- 6.8k forks
- Last push
- 13 days ago
- Activity
- Active
# Create an environment$ conda create -n GPTSoVits python=3.10
conda activate GPTSoVits# Install (Linux, NVIDIA GPU, Hugging Face models)$ bash install.sh --device CU126 --source HF# Open the WebUI$ python webui.pyCommands from the project's README. Run them after installing (see below).
Overview
Understand GPT-SoVITS in 60 seconds
- What it does
- GPT-SoVITS is a text-to-speech and voice conversion tool with a web interface. From a 5-second voice sample it can speak new text in that voice, and fine-tuning on about 1 minute of audio makes the voice more similar and realistic.
- The problem it solves
- Training a custom text-to-speech voice usually needs hours of recordings. GPT-SoVITS works from seconds to a minute of audio and bundles tools for preparing training data, so beginners can build voice models.
- Why choose it
- Choose it for strong few-shot voice cloning with a WebUI and built-in dataset tools. Windows users can download an integrated package and skip the setup.
- Who should use it
- Creators making voiceovers
- Developers experimenting with custom TTS voices
- Hobbyists working with Chinese, Japanese, Korean, Cantonese or English speech
- Researchers in few-shot speech synthesis
- Setup difficulty
You'll need:
- Python 3.9 to 3.12 (tested)
- PyTorch 2.2 to 2.8 depending on device
- NVIDIA CUDA, Apple silicon or CPU
- FFmpeg
How GPT-SoVITS works
GPT-SoVITS supports zero-shot TTS from a 5-second sample and few-shot fine-tuning with 1 minute of data. It can speak in a language different from the training data, currently English, Japanese, Korean, Cantonese and Chinese.
The WebUI includes tools for separating vocals from accompaniment, slicing audio into training chunks, Chinese speech recognition and text labelling. A fine-tuning tab walks you from audio path to slicing, denoising, ASR, proofreading and training, and a separate inference tab generates speech.
The README reports an inference real-time factor of 0.028 on an RTX 4060 Ti and 0.014 on an RTX 4090 for the v2 ProPlus model. On Macs, models trained on GPU have significantly lower quality, so the project uses CPU there for now. It is MIT licensed.
Features
Key features
Zero-shot TTS
Speak new text from a 5-second sample.
Few-shot fine-tuning
Train on about 1 minute of audio.
Cross-lingual
English, Japanese, Korean, Cantonese and Chinese.
Dataset tools
Vocal separation, slicing, ASR and labelling.
WebUI
Fine-tune and run inference in the browser.
Docker images
Lite and full images for CUDA 12.6 and 12.8.
Strengths
- Very little training audio needed
- Beginner-friendly WebUI
- Windows integrated package
- MIT licensed
Limitations
- Mac GPU training gives lower quality
- Several versions (v1 to v4, v2Pro) to choose between
- Install scripts download large models
Practical use cases
Narration in your own voice
Fine-tune on a minute of your recordings.
Game or video voiceovers
Generate lines in a character voice.
Multilingual speech
Speak another language in the same voice.
Installation
Install GPT-SoVITS
Commands come from GPT-SoVITS's README. AIRepoHub hasn't run them yet. View source
Prerequisites
- conda
- Python 3.10
- FFmpeg
Supported systems
- Windows
- macOS
- Linux
- 1
Download the integrated package
Download the package linked in the README (Windows 10 or newer), extract it and double-click go-webui.bat.
- 1
Clone the repository
Shellgit clone https://github.com/bilibili/GPT-SoVITS.gitcd GPT-SoVITS - 2
Create a conda environment
Shellconda create -n GPTSoVits python=3.10conda activate GPTSoVits - 3
Run the installer
--device is CU126, CU128, ROCM or CPU; --source is HF, HF-Mirror or ModelScope. Add --download-uvr5 for the vocal separation models.
Shellbash install.sh --device CU126 --source HF
- 1
Clone the repository
Shellgit clone https://github.com/bilibili/GPT-SoVITS.gitcd GPT-SoVITS - 2
Create a conda environment
Shellconda create -n GPTSoVits python=3.10conda activate GPTSoVits - 3
Run the installer
--device is MPS or CPU.
Shellbash install.sh --device CPU --source HF
- 1
Create a conda environment
PowerShellconda create -n GPTSoVits python=3.10conda activate GPTSoVits - 2
Run the installer
--Device is CU126, CU128 or CPU; --Source is HF, HF-Mirror or ModelScope.
PowerShellpwsh -F install.ps1 --Device CU126 --Source HF
Configuration and API keys
| Setting | What it's for |
|---|---|
is_halfOptional | Docker: set to true to use half precision (fp16) if your GPU supports it. |
First run
- 1
Open the WebUI
Shellpython webui.py
GPT-SoVITS's documentation doesn't include sample output, so we don't show any. Expect the results in your terminal.
Your first project
Fine-tune a voice and generate speech
Use the WebUI to turn about a minute of audio into a custom voice.
Before you start
- GPT-SoVITS installed with pretrained models
- About 1 minute of clean recordings of one speaker
- 1
Open the WebUI
Shellpython webui.py - 2
Prepare the dataset
Fill in the audio path, slice the audio into chunks, optionally denoise, run ASR and proofread the transcriptions.
- 3
Fine-tune
Go to the next tab and fine-tune the model.
- 4
Generate speech
Open the inference WebUI at 1-GPT-SoVITS-TTS/1C-inference, or run it directly.
Shellpython GPT_SoVITS/inference_webui.py
What to expect
The inference page speaks your text in the fine-tuned voice.
Next steps
- Try zero-shot TTS with a 5-second sample
- Read the English user guide linked in the README
- Compare the v2Pro and v4 models
Costs and requirements
What it costs to run
- License
- MIT.Free
- Software
- Free and open source.Free
- Hardware
- An NVIDIA GPU speeds up training and inference.Depends
Troubleshooting
Common setup issues
Low quality after training on a Mac
Mac GPU training gives lower quality; use CPU, as the project currently does.
Pretrained models missing
If install.sh didn't finish, download the pretrained and G2PW models manually as the README lists.
Out of GPU memory in Docker
Set is_half to true if your GPU supports fp16.
FFmpeg errors
Install FFmpeg with conda, apt (plus libsox-dev) or brew.
Alternatives
Similar AI repositories
markitdown
microsoft
Python tool from Microsoft that converts PDFs, Word, Excel, PowerPoint and other files into Markdown for use with AI.
transformers
huggingface
Hugging Face library for defining, running and training machine learning models for text, vision and audio.
langchain
langchain-ai
Framework for building LLM-powered applications and agents.
pytorch
pytorch
Python framework for building and training neural networks with tensors and GPU acceleration.