Kokoro-FastAPI icon indicating copy to clipboard operation
Kokoro-FastAPI copied to clipboard

For those who want to only use venv and don't want to use dockers or astral-uv.

Open BracerJack opened this issue 1 year ago • 2 comments

For those who prefer not to incorporate Docker or yet another package manager "astral-uv" (yawn), here's how to install this using python's built in venv:

python -m venv venv activate

pip install -e ".[cpu]" python -m docker.scripts.download_model --output api\src\models\v1_0 [It will report that there are download errors, it's nonsense, it is downloaded]

Set the following environmental variables, hopefully, all these will be removed in future versions, I have used other kokoro implementations and they don't require you to litter your environmental variables like these: PHONEMIZER_ESPEAK_LIBRARY: C:\Program Files\eSpeak NG\libespeak-ng.dll PYTHONUTF8: 1 PROJECT_ROOT: Your project path USE_GPU: false USE_ONNX: false MODEL_DIR: src\models VOICES_DIR: src\voices\v1_0 WEB_PLAYER_PATH: %PROJECT_ROOT%\web

python -m uvicorn api.src.main:app --host 0.0.0.0 --port 8880

Run by going to: http://localhost:8880/web/

BracerJack avatar Apr 23 '25 22:04 BracerJack

Can this be packaged into an executable .exe file and invoked by passing parameters via cmd? For example: ./kokoro.exe --text="hello!" --model="models/xxx.pt" --output="hello.wav"

kamjin3086 avatar May 07 '25 05:05 kamjin3086

You can also use https://github.com/skwzrd/kokoro_slim

skwzrd avatar Aug 13 '25 05:08 skwzrd