Introducing Kokoro.js, a new JavaScript library for running Kokoro TTS, an 82 million parameter text-to-speech model, 100% locally in the browser w/ WASM. Powered by 🤗 Transformers.js. WebGPU support coming soon!
text
Introducing Kokoro.js, a new JavaScript library for running Kokoro TTS, an 82 million parameter text-to-speech model, 100% locally in the browser w/ WASM. Powered by 🤗 Transformers.js. WebGPU support coming soon!
new_line
👉 npm i kokoro-js 👈
text
👉 npm i kokoro-js 👈
new_line
new_line
Try it out yourself: 
text
Try it out yourself: 
https://huggingface.co/spaces/webml-community/kokoro-web
webml-community/kokoro-web
space
resource
https://huggingface.co/spaces/webml-community/kokoro-web
new_line
Link to 
text
Link to 
models/samples
text
models/samples
: 
text
: 
https://huggingface.co/onnx-community/Kokoro-82M-ONNX
onnx-community/Kokoro-82M-ONNX
model
resource
https://huggingface.co/onnx-community/Kokoro-82M-ONNX
new_line
new_line
You can get started in just a few lines of code!
text
You can get started in just a few lines of code!
new_line
import { KokoroTTS } from "kokoro-js";

const tts = await KokoroTTS.from_pretrained(
  "onnx-community/Kokoro-82M-ONNX",
  { dtype: "q8" }, // fp32, fp16, q8, q4, q4f16
);

const text = "Life is like a box of chocolates. You never know what you're gonna get.";
const audio = await tts.generate(text,
  { voice: "af_sky" }, // See `tts.list_voices()`
);
audio.save("audio.wav");
js
```js
import { KokoroTTS } from "kokoro-js";

const tts = await KokoroTTS.from_pretrained(
  "onnx-community/Kokoro-82M-ONNX",
  { dtype: "q8" }, // fp32, fp16, q8, q4, q4f16
);

const text = "Life is like a box of chocolates. You never know what you're gonna get.";
const audio = await tts.generate(text,
  { voice: "af_sky" }, // See `tts.list_voices()`
);
audio.save("audio.wav");
```
code_fence
new_line
Huge kudos to the Kokoro TTS community, especially taylorchu for the ONNX exports and Hexgrad for the amazing project! None of this would be possible without you all! 🤗
text
Huge kudos to the Kokoro TTS community, especially taylorchu for the ONNX exports and Hexgrad for the amazing project! None of this would be possible without you all! 🤗
new_line
new_line
The model is also extremely resilient to quantization. The smallest variant is only 86 MB in size (down from the original 326 MB), with no noticeable difference in audio quality! 🤯
text
The model is also extremely resilient to quantization. The smallest variant is only 86 MB in size (down from the original 326 MB), with no noticeable difference in audio quality! 🤯
Introducing Kokoro.js, a new JavaScript library for running Kokoro TTS, an 82 million parameter text-to-speech model, 100% locally in the browser w/ WASM. Powered by 🤗 Transformers.js. WebGPU support coming soon!
👉 npm i kokoro-js 👈

Try it out yourself: https://huggingface.co/spaces/webml-community/kokoro-web
Link to models/samples: https://huggingface.co/onnx-community/Kokoro-82M-ONNX

You can get started in just a few lines of code!
```js
import { KokoroTTS } from "kokoro-js";

const tts = await KokoroTTS.from_pretrained(
  "onnx-community/Kokoro-82M-ONNX",
  { dtype: "q8" }, // fp32, fp16, q8, q4, q4f16
);

const text = "Life is like a box of chocolates. You never know what you're gonna get.";
const audio = await tts.generate(text,
  { voice: "af_sky" }, // See `tts.list_voices()`
);
audio.save("audio.wav");
```
Huge kudos to the Kokoro TTS community, especially taylorchu for the ONNX exports and Hexgrad for the amazing project! None of this would be possible without you all! 🤗

The model is also extremely resilient to quantization. The smallest variant is only 86 MB in size (down from the original 326 MB), with no noticeable difference in audio quality! 🤯
🔥
iky1e ravi4198 John6666 niccolasmunoz XXXMARK shub1 Rsln alibabasglab not-lain gcrois TrieChen fotiecodes dewdev boriskaiser Jakevin filmore pvul alaanor carsenk Pork1977gm loganpowell cgisky KrisKale45 RyanCargan rasgaard nikodunk abielkid jameshuntercarter codewitchio
🚀
hooman650 John6666 rockerBOO Gatozu35 fotiecodes wedobetterit nikodunk
❤️
dwidlee fotiecodes filmore rhulha nikodunk cdupland
🤝
shub1 Rsln fotiecodes nikodunk
😎
dwidlee nikodunk
63184dd44d24c00131a7091c
https://cdn-avatars.huggingface.co/v1/production/uploads/63184dd44d24c00131a7091c/0Dg--xJvWgoWyTIWza5uV.png
Shubin wang
shub1
user
61b253b7ac5ecaae3d1efe0c
https://cdn-avatars.huggingface.co/v1/production/uploads/61b253b7ac5ecaae3d1efe0c/hwiQ0uvz3t-L5a-NtBIO6.png
Joshua
Xenova
user
644fcd8e5fdcff143ad4b28a
https://cdn-avatars.huggingface.co/v1/production/uploads/644fcd8e5fdcff143ad4b28a/TJjTG-Nf6lLxmMJ1hgelg.jpeg
Saurav Panda
sauravpanda
user
630e9778a97116192fad2088
https://cdn-avatars.huggingface.co/v1/production/uploads/630e9778a97116192fad2088/5nyjZx17XIlA5QP7jU_L0.jpeg
Andrew DeLisa
ayan4m1
user
678f4da5222ad094448af548
/avatars/2a345d3c505eaa4691e462b73f642c0b.svg
Trie Chen
TrieChen
user
67999a88f704ff4ef3e3d37f
https://cdn-avatars.huggingface.co/v1/production/uploads/67999a88f704ff4ef3e3d37f/zk68oeYus8rvM37z77TaT.png
neoprath ai
neoprathai
user
677d1e5ce9bb5c9b71af1f62
/avatars/14113ae6eea420b8cd059899b29efb7d.svg
Rizwan Shaikh
fcyrizz
user
65faa2d514a5a537b3eb7460
/avatars/e586fd13935f021cd96f7654b061b3bb.svg
Petre Popescu
Pazvanti
user
677fc6fcbc268e52e0c20c39
https://cdn-avatars.huggingface.co/v1/production/uploads/677fc6fcbc268e52e0c20c39/OdhSDPF27aSDHDeUOoahU.jpeg
Gul Muhammad
kakagul
user
641b3836ec5b871c0bcd93ad
https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/ccmbmPyrQK1giwdgDmxwQ.png
Saurabh Jadhav
saurabhjadhav
user
63fde2476315a264aba689f4
/avatars/e05b1795543bb2d891a708404e4613c2.svg
Herbert Kruitbosch
prhbrt
user
68e75c6238234750e5794715
/avatars/3523cfb218c8d0d7a9e3b2186dcc19f8.svg
ao
david-ao
user
644d3e701e0cef1987159b33
/avatars/cda60a4ac139b9195d75b8ab14caf06d.svg
Jesús Leguizamón
jesulo
user