Skip to main content

A simple FastAPI Server to run XTTSv2

This project is inspired by silero-api-server and utilizes XTTSv2.

I created a Pull Request that has been merged into the dev branch of SillyTavern: here.

The TTS module or server can be used in any way you prefer.

Installation

To begin, install the xtts-api-server package using pip:

pip install xtts-api-server

I strongly recommend installing PyTorch with CUDA support to leverage the processing power of your video card, which will enhance the speed of the entire process:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Starting Server

python -m xtts_api_server will run on default ip and port (localhost:8020)

usage: xtts_api_server [-h] [-hs HOST] [-p PORT] [-sf SPEAKER_FOLDER] [-o OUTPUT]

Run XTTSv2 within a FastAPI application

options:
  -h, --help show this help message and exit
  -hs HOST, --host HOST
  -p PORT, --port PORT
  -sf SPEAKER_FOLDER, --speaker_folder The folder where you get the samples for tts
  -o OUTPUT, --output Output folder

The first time you run or generate, you may need to confirm that you agree to use XTTS.

API Docs

API Docs can be accessed from http://localhost:8020/docs

Voice Samples

You can find the sample in this repository, also by default samples will be saved to /output/output.wav or you can change this, more details in the API documentation

Selecting Folder

You can change the folders for speakers and the folder for output via the API.

Get Speakers

Once you have at least one file in your speakers folder, you can get its name via API and then you only need to specify the file name.

Release files for xtts-api-server 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtts-api-server 0.2.6
File Size Uploaded
xtts_api_server-0.2.6.tar.gz 286.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xtts-api-server 0.2.6
File Interpreter ABI Platform
xtts_api_server-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 574.5 kB

Release files / xtts_api_server-0.2.6.tar.gz

Download URL xtts_api_server-0.2.6.tar.gz
Size 286.9 kB
Tags Source
SHA-256 checksum
How to use checksums
54cbd920b3dcafb05cf5adffd46b066d3358e3aba5a737b2cbb33ac17055a2e7
BLAKE2b-256 checksum
How to use checksums
629a7b6136e1a6f0b2151308d58354aadc8c24cc4e28efb456d65c2765d8c118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Release files / xtts_api_server-0.2.6-py3-none-any.whl

Download URL xtts_api_server-0.2.6-py3-none-any.whl
Size 287.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cab436dd64eb531fbc6876315afe65805ccffba62abd0c680b613dafcad46b0c
BLAKE2b-256 checksum
How to use checksums
9cb73f14464b8e277fe64e499f800aa40b562c79c90de88a98b6f4b69518b13a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page