Skip to main content

A simple FastAPI server to host XTTSv2

Project description

A simple FastAPI Server to run XTTSv2

The project is inspired by silero-api-server repo uses XTTSv2

TODO: This is will be to serve the TTS extension in SillyTavern soon. The TTS module or server can be used any way you wish.

Installation

pip install xtts-api-server

I strongly recommend installing pytorch with CUDA so that the entire process is on the video card

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 (0.0.0.0:8020)

usage: xtts-api-server [-h] [-o HOST] [-p PORT] [-sf SPEAKER_FOLDER] [-o OUTPUT]

Run XTTSv2 within a FastAPI application

options:
  -h, --help            show this help message and exit
  -o 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. The model will be loaded into memory after the first generation.

API Docs

API Docs can be accessed from http://localhost:8001/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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtts_api_server-0.1.1.tar.gz (286.5 kB view details)

Uploaded Source

Built Distribution

xtts_api_server-0.1.1-py3-none-any.whl (287.1 kB view details)

Uploaded Python 3

File details

Details for the file xtts_api_server-0.1.1.tar.gz.

File metadata

  • Download URL: xtts_api_server-0.1.1.tar.gz
  • Upload date:
  • Size: 286.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for xtts_api_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a7022f820f65ae4faa94e52d6f74644dc2aa2d0c6773c149ae46431edf6f7192
MD5 eb15b2b194ad80765dc83469099f73fc
BLAKE2b-256 accfc77fbc7f8e1a23c785097aa9dcd1ef162cc9a1007d74b2e01157484b13c1

See more details on using hashes here.

File details

Details for the file xtts_api_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for xtts_api_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d757c0484399873b9524eabdab7348830a48572c3809724f7fef97c79a978968
MD5 28660fb2e749bc05ed2559b5dbecce35
BLAKE2b-256 43067d42c785b0ef5b5a0ad281f3d19666db26d62911337466dc130a5473ceee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page