A simple local web interface to convert text to speech using ChatTTS. It supports mixed Chinese, English, and numbers, and provides an API.
Original ChatTTS project
UI Preview
The model will be downloaded automatically on the first launch. It will try connecting to
https://huggingface.cofirst. If unreachable, it will download from ModelScope (modelscope.cn).Please ensure you have a stable internet connection (a VPN may be needed in some regions) when deploying from source to avoid download failures.
- Download the zip file from Releases, extract it, and double-click
app.exeto start. - Some antivirus software may trigger false positives. You can temporarily disable them or deploy from source instead.
- GPU acceleration will be enabled if you have an NVIDIA card with more than 4GB VRAM and CUDA 12.8+ installed.
-
Set up a Python 3.9–3.11 environment.
-
Create an empty directory
/data/chatttsand run:cd /data/chattts && git clone https://github.com/jianchang512/chatTTS-ui . -
Create a virtual environment:
python3 -m venv venv -
Activate the virtual environment:
source ./venv/bin/activate -
Install dependencies:
pip3 install -r requirements.txt -
For CPU-only (no CUDA acceleration), run:
pip3 install torch==2.7.1 torchaudio==2.7.1For GPU acceleration (CUDA), run:
pip install torch==2.7.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128 pip install nvidia-cublas-cu11 nvidia-cudnn-cu11
You will also need to install the CUDA 12.8+ Toolkit yourself.
-
Run
python3 app.pyto start. A browser window will open automatically at the default addresshttp://127.0.0.1:9966. (Note: By default, the model is downloaded from ModelScope. Please turn off your proxy/VPN during this download, as proxies are not supported for ModelScope).
-
Set up a Python 3.9–3.11 environment, install Git, and run:
brew install libsndfile git python@3.10Then run:export PATH="/usr/local/opt/python@3.10/bin:$PATH" source ~/.bash_profile source ~/.zshrc
-
Create an empty directory
/data/chatttsand run:cd /data/chattts && git clone https://github.com/jianchang512/chatTTS-ui . -
Create a virtual environment:
python3 -m venv venv -
Activate the virtual environment:
source ./venv/bin/activate -
Install dependencies:
pip3 install -r requirements.txt -
Install Torch:
pip3 install torch==2.7.1 torchaudio==2.7.1 -
Run
python3 app.pyto start. A browser window will open automatically athttp://127.0.0.1:9966.
-
Download and install Python 3.9–3.11. Make sure to check "Add Python to environment variables" during installation.
-
Download and install Git: https://github.com/git-for-windows/git/releases/download/v2.45.1.windows.1/Git-2.45.1-64-bit.exe
-
Create an empty folder named
D:/chattts. Open the folder, typecmdin the address bar, press Enter, and run:git clone https://github.com/jianchang512/chatTTS-ui . -
Create a virtual environment:
python -m venv venv -
Activate the virtual environment:
.\venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
For CPU-only (no CUDA acceleration):
Run
pip install torch==2.7.1 torchaudio==2.7.1For GPU acceleration (CUDA), run:
pip install torch==2.7.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128You will also need to install the CUDA 12.8+ Toolkit yourself.
-
Run
python app.pyto start. A browser window will open automatically athttp://127.0.0.1:9966. (Note: By default, the model is downloaded from ModelScope. Please turn off your proxy/VPN during this download).
-
Clone the repository
Clone the project into any directory, for example:
git clone https://github.com/jianchang512/ChatTTS-ui.git chat-tts-ui
-
Start the Container
Navigate to the project directory:
cd chat-tts-uiStart the container and view the initialization logs:
# GPU version docker compose -f docker-compose.gpu.yaml up -d # CPU version docker compose -f docker-compose.cpu.yaml up -d docker compose logs -f --no-log-prefix
-
Access ChatTTS WebUI
Once started on
0.0.0.0:9966, you can access the WebUI using the device'sIP:9966. For example:- Local:
http://127.0.0.1:9966 - Server:
http://192.168.1.100:9966
- Local:
-
Get the latest code from the main branch:
git checkout main git pull origin main
-
Stop the container and rebuild with the latest image:
docker compose down # GPU version docker compose -f docker-compose.gpu.yaml up -d --build # CPU version docker compose -f docker-compose.cpu.yaml up -d --build docker compose logs -f --no-log-prefix
-
If your GPU VRAM is less than 4GB, CPU mode will be forced.
-
On Windows or Linux, if you have an NVIDIA card with >4GB VRAM but the software still uses CPU, try uninstalling and reinstalling Torch. Run
pip uninstall -y torch torchaudiofirst, then reinstall the CUDA version:pip install torch==2.7.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128. Ensure you have CUDA 12.8+ installed. -
The software checks if ModelScope is accessible. If yes, it downloads the model from ModelScope; otherwise, it downloads from huggingface.co.
Starting from version 0.92, fixed voices in .csv or .pt format are supported. Simply download and save them in the speaker folder inside the software directory.
.pt files can be downloaded from the demo link page of the ChatTTS_Speaker project (https://modelscope.cn/studios/ttwwwaa/ChatTTS_Speaker).
You can also visit http://ttslist.aiqbh.com/10000cn/ to listen to audio samples and copy the corresponding voice seed value into the "Custom Voice Value" text box.
Note: The same voice seed value may sound slightly different across different devices. Even on the same device, the tone or pitch of the same voice seed may vary slightly between generations.
Open the .env file with a text editor to modify the configuration:
WEB_ADDRESS=127.0.0.1:9966 # Modify the Web service address and port
compile=false
device=default # Defaults to CUDA (if VRAM > 4GB) or MPS. You can manually set this to cpu, mps, or cudaThe default address is http://127.0.0.1:9966. To change this, open the .env file in the project folder and change WEB_ADDRESS=127.0.0.1:9966 to your preferred IP and port (e.g., WEB_ADDRESS=192.168.0.10:9966 to allow local network access).
Request Method: POST
Request URL: http://127.0.0.1:9966/tts
Parameters:
text: str | Required. The text to be synthesized.voice: Optional. Default is 2222. Numeric seed for the voice (e.g., 2222, 7869, 6653, 4099, 5099). Pass any number for a random voice.prompt: str | Optional. Default is empty. Used to insert laughter or pauses, e.g.,[oral_2][laugh_0][break_6].temperature: float | Optional. Default is 0.3.top_p: float | Optional. Default is 0.7.top_k: int | Optional. Default is 20.skip_refine: int | Optional. Default is 0.1= skip text refinement,0= do not skip.custom_voice: int | Optional. Default is 0. Seed value for custom voice. Must be an integer greater than 0. If set, this overrides thevoiceparameter.
Response: JSON
Success:
{
"code": 0,
"msg": "ok",
"audio_files": [
{
"filename": "absolute path to WAV",
"url": "downloadable URL for WAV"
}
]
}Failure:
{
"code": 1,
"msg": "error details"
}# API Code Example
import requests
res = requests.post('http://127.0.0.1:9966/tts', data={
"text": "Hello world.",
"prompt": "",
"voice": "3333",
"temperature": 0.3,
"top_p": 0.7,
"top_k": 20,
"skip_refine": 0,
"custom_voice": 0
})
print(res.json())
# Success Response
# {code:0, msg:'ok', audio_files:[{filename: E:/python/chattts/static/wavs/20240601-22_12_12-c7456293f7b5e4dfd3ff83bbd884a23e.wav, url: http://127.0.0.1:9966/static/wavs/20240601-22_12_12-c7456293f7b5e4dfd3ff83bbd884a23e.wav}]}
# Error Response
# {code:1, msg:"error"}Upgrade pyVideoTrans to 1.82+ (https://github.com/jianchang512/pyvideotrans)
- Click Menu -> Settings -> ChatTTS, and enter the request URL (default is
http://127.0.0.1:9966). - Once the test is successful, select
ChatTTSin the main interface.

