ComfyUI Node: Kokoro TTS

Class Name

Kokoro TTS

Category
kokoro
Author
Burgstall-labs (Account age: 48days)
Extension
ComfyUI-BS_Kokoro-onnx
Latest Updated
2025-01-19
Github Stars
0.03K

How to Install ComfyUI-BS_Kokoro-onnx

Install this extension via the ComfyUI Manager by searching for ComfyUI-BS_Kokoro-onnx
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-BS_Kokoro-onnx in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Kokoro TTS Description

Powerful text-to-speech node with diverse voice options, leveraging Kokoro ONNX model for high-quality audio outputs.

Kokoro TTS:

Kokoro TTS is a powerful text-to-speech node designed to convert written text into spoken audio using a variety of voice options. This node leverages the Kokoro ONNX model to generate high-quality audio outputs, making it an excellent tool for AI artists and developers who want to add voice capabilities to their projects. The node is capable of handling different speakers, allowing for a diverse range of vocal outputs. It is particularly beneficial for creating voiceovers, narrations, or any application where converting text to speech is required. The node ensures ease of use by providing a straightforward interface for inputting text and selecting a speaker, while handling the complex processing in the background.

Kokoro TTS Input Parameters:

text

The text parameter is a string input that represents the content you want to convert into speech. It supports multiline text, allowing you to input longer passages or scripts. The default value is a promotional message for BS Labs' YouTube channel, but you can replace it with any text you wish to vocalize. This parameter is crucial as it directly influences the audio output, with the content of the text being transformed into spoken words.

speaker

The speaker parameter allows you to select the voice that will be used to generate the speech. It offers a variety of options, including voices like "af_sarah," "am_adam," and "bf_emma," among others. The default speaker is "af_sarah." This parameter is important because it determines the vocal characteristics of the output, such as tone, pitch, and accent, enabling you to tailor the audio to fit specific needs or preferences.

Kokoro TTS Output Parameters:

audio

The audio output parameter is a dictionary containing the generated audio waveform and its sample rate. The waveform is a tensor that represents the audio signal, formatted to be compatible with ComfyUI's audio output requirements. The sample rate indicates the number of samples per second in the audio, which is essential for playback quality. This output is crucial as it provides the final audio product that can be used in various applications, from multimedia projects to interactive installations.

Kokoro TTS Usage Tips:

  • Ensure that the text input is clear and free of errors to achieve the best audio quality. Proper punctuation can also help in generating more natural-sounding speech.
  • Experiment with different speakers to find the voice that best suits your project's needs. Each speaker has unique vocal characteristics that can enhance the overall impact of the audio.

Kokoro TTS Common Errors and Solutions:

ERROR: model or voice file not found. Please download them manually from {MODEL_URL} and {VOICES_URL} and place them in the same folder as the node.

  • Explanation: This error occurs when the required model or voice files are missing from the node's directory.
  • Solution: Download the necessary files from the provided URLs and ensure they are placed in the correct directory alongside the node script.

ERROR: could not load kokoro-onnx in generate

  • Explanation: This error indicates a problem with loading the Kokoro ONNX model, possibly due to file corruption or incorrect file paths.
  • Solution: Verify that the model file is intact and located at the specified path. Re-download the file if necessary.

ERROR: could not generate speech using kokoro.create

  • Explanation: This error suggests an issue during the speech generation process, which could be due to invalid input parameters or internal processing errors.
  • Solution: Check the input text and speaker parameters for correctness. Ensure that the text is not empty and the speaker is selected from the available options.

ERROR: the text-to-speech generation did not return audio. Make sure you have a valid text string.

  • Explanation: This error occurs when the text-to-speech process fails to produce an audio output, often due to an invalid or empty text input.
  • Solution: Confirm that the text input is valid and not empty. Re-enter the text if necessary and try generating the audio again.

Kokoro TTS Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-BS_Kokoro-onnx
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.