gitmyhub

kokoro-lab-web

JavaScript ★ 2 updated 1mo ago

a web port of kokoro-lab

A browser-only lab for designing AI voices with the Kokoro text-to-speech model, letting you draw directly on pitch and timing curves.

JavaScriptHTMLonnxruntime-webWebGPUWebAssemblysetup: moderatecomplexity 4/5

Kokoro Lab Web is a browser based tool for designing and shaping AI generated voices using a text to speech model called Kokoro. Everything runs directly in the browser with no server and no install; it is a plain static website made of HTML and JavaScript that can be hosted on GitHub Pages or any static file host.

Inside, a person can design a voice by moving sliders that control the main directions of the model's voice space, starting from a built in stock voice or a random one. They can also nudge how masculine or feminine a voice sounds and push it toward specific emotions by adjusting valence, arousal, and dominance, which map onto the pitch, loudness, and speaking rate of the generated audio. The most distinctive feature lets someone draw directly on the pitch, loudness, and timing curves of a voice with the mouse, and the audio resynthesizes almost immediately after each stroke because only the back half of the model needs to rerun.

Changes to the voice, emotion, or these hand drawn edits are kept as an adjustable difference on top of whatever the model would normally produce, so switching to a new voice or emotion does not erase a person's manual edits.

Technically, the Kokoro model is split into three separate pieces so that the part which turns text into timing and features runs once, while the part that decodes the drawn changes into audio can rerun on its own, which is what makes live editing fast. The tool prefers the browser's WebGPU feature for speed and falls back to a WebAssembly worker when that is not available, so the page stays responsive. On first run it downloads roughly 300 megabytes of model files from a public source, though a smaller version and a script to store everything locally are both provided.

The code is released under the MIT license, though the actual Kokoro model weights and voice data come from outside sources with their own separate licenses.

Where it fits