A custom node for ComfyUI that provides Text-to-Speech capabilities using the Kokoro TTS engine.
TTS with LatentSync for Lipsync
2025-01-20.20-55-55.mp4
Example Result.
- High-quality text-to-speech synthesis
- Multiple voice options
- Support for multilingual text
- Easy integration with ComfyUI workflows
- Clone this repository into your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/benjiyaya/ComfyUI-KokoroTTS
-
Download required model files:
- Create a folder
Kokorotts
under ComfyUI/models - Go to https://huggingface.co/thewh1teagle/Kokoro/tree/main
- Download the model 'kokoro-v0_19.onnx' file and save to 'Kokorotts' folder
- Download the voices 'voices.json' file and save to 'Kokorotts' folder
- Place both files in the
ComfyUI/models/Kokorotts
directory
- Create a folder
-
Install required Python packages:
pip install -r requirements.txt
or
if you are using window protable version.
Go to 'ComfyUI_windows_portable' folder
run the command : "python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KokoroTTS\requirements.txt"
The following voices are available:
- af (American Female)
- af_sarah (American Female Sarah)
- af_bella (American Female Bella)
- af_nicole (American Female Nicole)
- af_sky (American Female Sky)
- am_adam (American Male Adam)
- am_michael (American Male Michael)
- bf_emma (British Female Emma)
- bf_isabella (British Female Isabella)
- bm_george (British Male George)
- bm_lewis (British Male Lewis)
- In ComfyUI, locate the "Kokoro TextToSpeech" node under the "kokoro" category
- Connect the node to your workflow
- Input your text and select a voice
- The node will output an audio waveform that can be used with other audio nodes
text
: The text you want to convert to speech (supports multiline text)speaker
: The voice to use for speech synthesis (default: af_sarah)
audio
: Audio data in the format expected by ComfyUI audio nodes
The node includes comprehensive error handling for common issues:
- Missing model or voice files
- Invalid text input
- TTS generation failures
Error messages will be logged with detailed information to help troubleshoot any issues.
kokoro-onnx: MIT kokoro model: Apache 2.0
- Kokoro TTS Engine: [Include credits for the original Kokoro TTS project]
- ComfyUI: https://github.com/comfyanonymous/ComfyUI
- ComfyUI-BS_Kokoro-onnx https://github.com/Burgstall-labs/ComfyUI-BS_Kokoro-onnx