Qwen3-TTS
Synthesize highly accurate multilingual character speech using Qwen3-TTS in both voice cloning and text-described VoiceDesign modes.
Qwen3-TTS 12Hz 1.7B provides high-accuracy local speech synthesis. Running servers/tts/qwen3tts/server.py in its default auto mode dynamically selects the Base voice-cloning model or the VoiceDesign model based on each incoming request.
Run these commands from the TomoriBot repo root, the folder where you cloned TomoriBot:
python -m venv servers\tts\qwen3tts\.venvservers\tts\qwen3tts\.venv\Scripts\Activate.ps1python -m pip install --upgrade pippip install -r servers\tts\qwen3tts\requirements.txtpython servers\tts\qwen3tts\server.pyOn an NVIDIA GPU, the default cuda-graphs backend runs automatically. On a CPU-only machine, set $env:QWEN3TTS_BACKEND = "transformers" before starting server.py.
Install sox if it is not already on your system (sudo apt-get install -y sox on Debian/Ubuntu), then create the virtual environment and start the server:
python3 -m venv servers/tts/qwen3tts/.venvsource servers/tts/qwen3tts/.venv/bin/activatepython -m pip install --upgrade pippython -m pip install -r servers/tts/qwen3tts/requirements.txtpython servers/tts/qwen3tts/server.pyOn an NVIDIA GPU, the default cuda-graphs backend runs automatically. On a CPU or AMD ROCm GPU, set QWEN3TTS_BACKEND=transformers (and install a matching ROCm PyTorch build into .venv for AMD GPUs).
Install sox via Homebrew first, then create the virtual environment and start the server with the standard transformers backend (cuda-graphs requires an NVIDIA CUDA GPU, and pip falls back to standard PyPI PyTorch wheels on macOS):
brew install soxpython3 -m venv servers/tts/qwen3tts/.venvsource servers/tts/qwen3tts/.venv/bin/activatepython -m pip install --upgrade pippython -m pip install -r servers/tts/qwen3tts/requirements.txtQWEN3TTS_BACKEND=transformers python servers/tts/qwen3tts/server.pyBy default without CUDA, the server runs on cpu in float32. On Apple Silicon you can also test QWEN3TTS_DEVICE_MAP=mps with QWEN3TTS_DTYPE=float32, though standard PyTorch MPS throughput is much slower than NVIDIA CUDA and is not covered by repo tests.
Keep that terminal open while TomoriBot is using Qwen3-TTS (or start it later with bun run launch --qwen3tts). The default auto-mode endpoint URL is http://127.0.0.1:8012; set QWEN3TTS_PORT to use another port. You can also specify auto mode explicitly with --mode auto.
Auto mode inspects each /synthesize request: requests with ref_audio use the clone model, while requests with instruct use the VoiceDesign model. It keeps only one model loaded at a time and swaps models when the request type changes, so the first request after a swap may be slower.
Fast CUDA backend
Section titled “Fast CUDA backend”By default the server uses faster-qwen3-tts, which the requirements install. On an NVIDIA GPU it synthesizes about 6x faster than the standard backend, so speech generates faster than real time instead of about twice as slow. It needs no extra setup, but it only runs on NVIDIA GPUs: on a CPU, a Mac, or an AMD GPU the server stops at startup and tells you to switch backends.
This backend reserves room for a fixed amount of speech per request, shared between the reference clip and the generated audio (about 170 seconds in total). With a 10-20 second clip that leaves well over two minutes of speech. If a request does not fit, the server returns an error instead of cutting the audio short; use a shorter clip or text, or the standard backend.
To use the standard backend instead, set QWEN3TTS_BACKEND=transformers before starting the server:
$env:QWEN3TTS_BACKEND = "transformers"python servers\tts\qwen3tts\server.pyQWEN3TTS_BACKEND=transformers python servers/tts/qwen3tts/server.pyQWEN3TTS_BACKEND=transformers python servers/tts/qwen3tts/server.pyRegister in TomoriBot
Section titled “Register in TomoriBot”For most users, register the auto-mode server so one endpoint can support both voice-clone and VoiceDesign personas.
Run /providers, choose Add New Custom Endpoint, and use the speech API compatibility:
- API Compatibility:
tts-clone endpoint_url:http://127.0.0.1:8012
After saving the connection, select it and use its model dropdown to add a Speech model. The model form asks for Voice Source Mode and Script Markup; choose Auto and Plain for the auto-mode server.
Use /providers for endpoint registration and model setup. Then open /config > Models > Switch Models to select and activate the registered endpoint.
Set up persona voices
Section titled “Set up persona voices”Voice cloning
Section titled “Voice cloning”Use this for personas that should imitate a reference clip:
- Prepare a clean 10-20 second voice clip with one speaker and no background music.
- Open
/configunder Models > TTS Parameters & Voices and upload the clip. - Open
/configunder Persona > Voice, then choose the persona and the voice sample.
Qwen3-TTS supports reference clips as short as 3 seconds.
VoiceDesign
Section titled “VoiceDesign”Use this for personas that should use a written voice description instead of a sample:
- Open
/configunder Persona > Voice and choose VoiceDesign. - Choose the persona.
- Enter a natural-language voice prompt, such as the speaker’s age, tone, accent, and delivery.
Optional: VoiceDesign-only server
Section titled “Optional: VoiceDesign-only server”Start the same server in VoiceDesign mode when serving Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign (add QWEN3TTS_BACKEND=transformers on non-NVIDIA hardware):
servers\tts\qwen3tts\.venv\Scripts\Activate.ps1$env:TOMORI_TTS_MODE = "voice-design"python servers\tts\qwen3tts\server.pysource servers/tts/qwen3tts/.venv/bin/activateTOMORI_TTS_MODE=voice-design python servers/tts/qwen3tts/server.pysource servers/tts/qwen3tts/.venv/bin/activateQWEN3TTS_BACKEND=transformers TOMORI_TTS_MODE=voice-design python servers/tts/qwen3tts/server.pyYou can also pass --mode voice-design instead of setting TOMORI_TTS_MODE. The default VoiceDesign-only endpoint URL is http://127.0.0.1:8014.
Register it the same way as auto mode, but use endpoint URL http://127.0.0.1:8014 and choose VoiceDesign as the Voice Source Mode on the Speech model.