Kokoro TTS Plugin is a plugin for NVIDIA In-Game Inference AI framework. It embeds the well known lightweight Kokoro-82M text-to-speech model and allows real-time voice rendering through NVIGI. Kokoro TTS Plugin can run the Kokoro model on NVIDIA GPU card as well as on CPU.
- NVIDIA RTX 30x0 series or (preferably) RTX 4080/4090 or RTX 5080/5090 with a minimum of 6GB and recommendation of 8GB VRAM.
NOTE: Some plugins only support RTX 40x0 and above, and will not be available on RTX 30x0.
- Win10 20H1 (version 2004 - 10.0.19041) or newer
- Install graphics driver r555.85 or newer
- Install VS Code or VS2019/VS2022 with SDK 10.0.19041+
Build steps for Powershell:
- Enter the root directory of the plugin
- Execute the following commands (replace -Release with -Debug or -Production if necessary)
.\setup.bat
.\build.bat -Release
.\package.bat -Release
By doing so you have created a directory _sdk where plugin files were copied.
The version of Kokoro-82M model compatible with the plugin can be downloaded from HuggingFace. To do so execute the following line in the root directory of the plugin (using Powershell):
.\download_data.bat
The model is downloaded to the directory data.
The plugin comes with a simple sample that shows the possible integration of the plugin in software. It also helps to confirm the plugin is correctly built. To build the sample follow these steps (using Powershell)
- Enter the root directory of the plugin
- Execute the following commands
.\setup_sample.bat
.\build_sample.bat
To run the sample enter the following
.\run_sample.bat
The audio rendering process will start and after a while you will hear sample text being played.
Here you can find a short description of the directory setup. The directory setup mirrors that of NVIGI repository.
_artifacts(appears after building; contains object files)_project(appears after setup; contains VS solution files)_sdk(appears after packaging; contains a plugin pack ready to be used)data(appears after data download; contains model files)external(appears after setup; contains third-party dependencies)nvigi_core(The NVIGI core framework; headers, libraries, DLLs)premake(contains scripts for managing the project)source/plugins(contains the plugin source code)sample(contains the sample source code)shared(contains the shared headers)
tools(contains tools for managing the project)
Below you can find some performance metrics for the plugin using the optimized version of Kokoro. The measurements were taken under no stress condition. The third item in the table RT / AL stands for Render Time / Audio Length ratio.
| Provider | N Samples | RT / AL | VRAM Mean (MB) | VRAM Median (MB) |
|---|---|---|---|---|
| RTX 4090 | 12 | 0.045 | 2083 | 2139 |
| RTX 3070Ti | 20 | 0.089 | 1170 | 1225 |
Kokoro TTS Plugin is a plugin for NVIDIA In-Game Inference AI framework. For high-level details of NVIGI, as well as links to the official downloads for the product, see NVIDIA In-Game Inferencing