From 8579517a35ef1865fc9b428899d73d52dcb27a14 Mon Sep 17 00:00:00 2001 From: historia Date: Wed, 2 Sep 2026 01:26:09 -0400 Subject: feat: sglang backend support --- README.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 529d881..5638aec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # tts-audiobook-generator -Generate audiobooks from books (epub, txt, pdf) using text-to-speech backends such as `audio.cpp` and `qwen-tts`. Installs and manages +Generate audiobooks from books (epub, txt, pdf) using text-to-speech backends such as `audio.cpp`, `qwen-tts`, and `SGLang-Omni`. Installs and manages ## Overview @@ -8,7 +8,7 @@ The converter sends text extracted from your books to a locally running TTS serv - Input: `.txt`, `.pdf`, or `.epub` - Output: `.m4b`, `.mp3`, `.ogg`, or `.flac` (single file or one-per-chapter) -- Supports [audio.cpp](https://github.com/0xShug0/audio.cpp), [qwen-tts](https://pypi.org/project/qwen-tts/), and [faster-qwen3-tts](https://github.com/andimarafioti/faster-qwen3-tts) backend servers +- Supports [audio.cpp](https://github.com/0xShug0/audio.cpp), [qwen-tts](https://pypi.org/project/qwen-tts/), [faster-qwen3-tts](https://github.com/andimarafioti/faster-qwen3-tts), and [SGLang-Omni](https://github.com/sgl-project/sglang-omni) backend servers - Automatic metadata (title/artist/album tags, chapter track numbers) and a generated cover - Supports text-to-speech, voice cloning, and voice design @@ -17,6 +17,7 @@ The converter sends text extracted from your books to a locally running TTS serv | [audio.cpp](https://github.com/0xShug0/audio.cpp) | Newer C++ TTS backend that supports many recent models | | [Qwen-TTS](https://pypi.org/project/qwen-tts/) | Qwen demo server (qwen-tts-demo); one model at a time — CustomVoice, Base or VoiceDesign | | [Faster-Qwen-TTS](https://github.com/andimarafioti/faster-qwen3-tts) | Qwen server with 2-8x faster inference for NVidia GPUs | +| [SGLang-Omni](https://github.com/sgl-project/sglang-omni) | Multi-model OpenAI-compatible serving stack (NVIDIA GPU + Linux, Python 3.10-3.12) | ## Prerequisites @@ -53,6 +54,16 @@ cd tts-audiobook-generator With several audio.cpp models installed, the **Model** menu also offers **All (multiple generation)**: every book is generated once per configured model, so their output can be compared. Output file names carry the model (`book__.m4b`), the same Voice is sent to every model that accepts it (models it does not fit use their own default voice), and loaded models are unloaded between runs to free VRAM. +The **SGLang-Omni** backend works the same way (`Configure Backends > +Install Backend > SGLang-Omni`): the wizard provisions a Python +3.10-3.12 venv automatically (downloading a managed interpreter when the +system has none), pip-installs the serving stack, and installs the +models you pick from its catalog (Qwen3-TTS, Higgs Audio v3, MOSS-TTS, +Voxtral TTS, Fish Speech, and more — see +[the backend docs](app/docs/backend-sglomni.md)). It requires Linux with +an NVIDIA GPU; one model is hosted per server process, so the Generate +form's Model pick decides which server boots. + ## CLI Options Without `--api-url` the CLI manages the server itself, just like the TUI: it starts the selected backend's managed instance (installed via the TUI), converts, and stops it again. A server already running at the configured endpoint is used as-is and left running when the run ends. `--api-url` points at an external server instead, and never touches server state. @@ -67,6 +78,13 @@ python audiobook.py --backend audiocpp --model Qwen3-TTS-12Hz-1.7B-VoiceDesign-G python audiobook.py --backend faster --voice narrator +python audiobook.py --backend sglomni --model higgs_audio_v3_tts + +python audiobook.py --backend sglomni --model moss_tts_local --clone voices/narrator.wav + +python audiobook.py --backend sglomni --model qwen3_tts_1_7b_voicedesign \ + --instructions "A warm adult female narrator with a British accent" + python audiobook.py --backend audiocpp --api-url http://10.20.30.40:8080 --voice narrator python audiobook.py --input-file the_odyssey.epub --output-file the_odyssey.mp3 \ @@ -77,7 +95,7 @@ python audiobook.py --input-file the_odyssey.epub --output-file the_odyssey.mp3 | Flag | Example | Description | | ---------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--backend {audiocpp,qwen,faster}` | `audiocpp` | TTS server to use. Required: there is no default backend. | +| `--backend {audiocpp,qwen,faster,sglomni}` | `audiocpp` | TTS server to use. Required: there is no default backend. | | `--format {mp3,m4b,ogg,flac}` | `m4b` | Output format (default: the `AUDIO_FORMAT` setting in `app/converter/config.py`, `m4b`). | | `--voice ` | `Vivian` | Voice to request. For `faster` this is the key in `voices.json` (required). For the Qwen CustomVoice model this is the speaker (Ryan, Vivian, etc.). For audio.cpp it is a server-side clone voice: required for clone-only families (e.g. Chatterbox), optional on mixed families and unused by pure-TTS models (e.g. Supertonic). | | `--input ` | `./input` | Directory containing the books to convert (default: the `INPUT_DIR` setting in `app/converter/config.py`, `./input`; relative paths resolve against the project root). | @@ -90,7 +108,7 @@ python audiobook.py --input-file the_odyssey.epub --output-file the_odyssey.mp3 | `--language ` | `English` | Output language for the synthesized speech. May add an accent even if the text is English. | | `--debug` | | Dump each chunk's raw audio and sent text to `debug/` and log every request. Forces the `DEBUG` setting in `app/converter/config.py` on for this run. | | `--api-url ` | `http://10.20.30.40:8080` | URL of an external TTS server. Accepts `host:port` or a full `http(s)://` URL. Without it the CLI starts and stops the backend's managed server itself. | -| `--model ` | `qwen3_tts_1_7b_base_q8_0` | `audiocpp`: Choose the TTS model from `server.json` (required on multi-model servers; auto-selected on single-model servers) | +| `--model ` | `qwen3_tts_1_7b_base_q8_0` | `audiocpp`: Choose the TTS model from `server.json` (required on multi-model servers; auto-selected on single-model servers). `sglomni`: the catalog model key (e.g. `higgs_audio_v3_tts`; required when several models are installed) | | `--option KEY=VALUE` | `emotion=neutral` | `audiocpp`: Some models support custom options with this (e.g. `emotion=neutral`) | | Flag | Example | Description | @@ -110,6 +128,7 @@ If the TUI auto-install doesn't work for some reason, you may need to set up the - [audio.cpp instructions](app/docs/backend-audiocpp.md) - [qwen-tts instructions](app/docs/backend-qwen.md) - [faster-qwen-tts instructions](app/docs/backend-faster.md) +- [SGLang-Omni instructions](app/docs/backend-sglomni.md) `./audiobook.py` can also connect to external servers running these backends if you want to completely manage your own install. The TUI will automatically look for and connect to the API URLs configured in settings. For CLI use, point at `--api-url` for an external server; without it the CLI starts and stops a locally-installed backend server around the run. @@ -137,3 +156,4 @@ MIT - [Qwen3-Audiobook-Converter](https://github.com/WhiskeyCoder/Qwen3-Audiobook-Converter) by WhiskeyCoder. This project was originally built upon this. - [Qwen3-TTS](https://github.com/QwenLM/Qwen3-TTS) voice model. - [audio.cpp](https://github.com/0xShug0/audio.cpp) inference engine for the `audiocpp` backend. +- [SGLang-Omni](https://github.com/sgl-project/sglang-omni) serving framework for the `sglomni` backend. -- cgit v1.2.3