Instructions to use Prompt-Pirate/comfytts-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Prompt-Pirate/comfytts-models with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Prompt-Pirate/comfytts-models:Q8_0 # Run inference directly in the terminal: llama cli -hf Prompt-Pirate/comfytts-models:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Prompt-Pirate/comfytts-models:Q8_0 # Run inference directly in the terminal: llama cli -hf Prompt-Pirate/comfytts-models:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Prompt-Pirate/comfytts-models:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf Prompt-Pirate/comfytts-models:Q8_0
Use Docker
docker model run hf.co/Prompt-Pirate/comfytts-models:Q8_0
- Llama new
- LM Studio
- Jan
- Ollama
How to use Prompt-Pirate/comfytts-models with Ollama:
ollama run hf.co/Prompt-Pirate/comfytts-models:Q8_0
- Unsloth Desktop
- Pi
How to use Prompt-Pirate/comfytts-models with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Prompt-Pirate/comfytts-models:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Prompt-Pirate/comfytts-models:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Prompt-Pirate/comfytts-models with Docker Model Runner:
docker model run hf.co/Prompt-Pirate/comfytts-models:Q8_0
- Lemonade
How to use Prompt-Pirate/comfytts-models with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Prompt-Pirate/comfytts-models:Q8_0
Run and chat with the model
lemonade run user.comfytts-models-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use Prompt-Pirate/comfytts-models with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Prompt-Pirate/comfytts-models:Q8_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default Prompt-Pirate/comfytts-models:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Prompt-Pirate/comfytts-models with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Prompt-Pirate/comfytts-models:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "Prompt-Pirate/comfytts-models:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload folder using huggingface_hub
Browse filesFiles changed (21)
- .gitattributes+4
- engines/kokoro/.github/workflows/publish.ymlAdded+25
- engines/kokoro/.gitignoreAdded+175
- engines/kokoro/.meta/generator.pngAdded
- engines/kokoro/.meta/img.pngAdded
- engines/kokoro/.meta/lipsync.pngAdded
- engines/kokoro/.meta/speaker.pngAdded
- engines/kokoro/.meta/speaker_combiner.pngAdded
- engines/kokoro/.meta/workflow.pngAdded
- engines/kokoro/.meta/yt_img.pngAdded
- engines/kokoro/CHANGE_LOG.mdAdded+19
- engines/kokoro/ComfyUIKokoro.pyAdded+292
- engines/kokoro/LICENSEAdded+201
- engines/kokoro/README.mdAdded+96
- engines/kokoro/__init__.pyAdded+22
- engines/kokoro/__pycache__/ComfyUIKokoro.cpython-312.pycAdded
- engines/kokoro/__pycache__/__init__.cpython-312.pycAdded
- engines/kokoro/kokoro_v1.onnxAdded+3
- engines/kokoro/pyproject.tomlAdded+15
- engines/kokoro/requirements.txtAdded+5
- engines/kokoro/voices_v1.binAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353637383932 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textengines/kokoro/.meta/img.png filter=lfs diff=lfs merge=lfs -textengines/kokoro/.meta/lipsync.png filter=lfs diff=lfs merge=lfs -textengines/kokoro/.meta/workflow.png filter=lfs diff=lfs merge=lfs -textengines/kokoro/.meta/yt_img.png filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"
permissions:
issues: write
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'stavsap' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@v1
with:
## Add your own personal access token to your Github Repository secrets and reference it here.
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
# PyPI configuration file
.pypirc
kokoro-v0_19.onnx
voices.json
voices.bin1234567891011121314151617181915-02-2025
Add missing languages selectors.
13-02-2025
Add missing Spanish language selector.
02-02-2025
Add supported languages as drop down menu (**might be breaking change**, default will be `English`)
01-02-2025
Support kokoro V1.0
21-01-2025
Initial release.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292import numpy as np
import torch
from kokoro_onnx import Kokoro
import logging
import os
import requests
from tqdm import tqdm
import io
logger = logging.getLogger(__name__)
MODEL_URL = "https://github.com/taylorchu/kokoro-onnx/releases/download/v0.2.0/kokoro.onnx"
MODEL_FILENAME = "kokoro_v1.onnx"
VOICES_FILENAME = "voices_v1.bin"
supported_languages_display = ["English", "English (British)","French", "Japanese", "Hindi", "Mandarin Chinese", "Spanish", "Brazilian Portuguese", "Italian"]
supported_languages = {
supported_languages_display[0]: "en-us",
supported_languages_display[1]: "en-gb",
supported_languages_display[2]: "fr-fr",
supported_languages_display[3]: "ja",
supported_languages_display[4]: "hi",
supported_languages_display[5]: "cmn",
supported_languages_display[6]: "es",
supported_languages_display[7]: "pt-br",
supported_languages_display[8]: "it",
}
supported_voices =[
# American Female
"af_heart",
"af_alloy",
"af_aoede",
"af_bella",
"af_jessica",
"af_kore",
"af_nicole",
"af_nova",
"af_river",
"af_sarah",
"af_sky",
#American Male
"am_adam",
"am_echo",
"am_eric",
"am_fenrir",
"am_liam",
"am_michael",
"am_onyx",
"am_puck",
"am_santa",
# British Female
"bf_alice",
"bf_emma",
"bf_isabella",
"bf_lily",
# British Male
"bm_daniel",
"bm_fable",
"bm_george",
"bm_lewis",
# Japanese Female
"jf_alpha",
"jf_gongitsune",
"jf_nezumi",
"jf_tebukuro",
# Japanese Male
"jm_kumo",
"zf_xiaobei",
"zf_xiaoni",
"zf_xiaoxiao",
"zf_xiaoyi",
"zm_yunjian",
"zm_yunxi",
"zm_yunxia",
"zm_yunyang",
"ef_dora",
"em_alex",
"em_santa",
"ff_siwis",
"hf_alpha",
"hf_beta",
"hm_omega",
"hm_psi",
"if_sara",
"im_nicola",
"pf_dora",
"pm_alex",
"pm_santa",
]
def download_file(url, file_name, path):
if not os.path.exists(path):
os.makedirs(path)
with requests.get(url, stream=True, allow_redirects=True) as response:
total_size = int(response.headers.get('content-length', 0))
block_size = 4096 # 4KB blocks
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True, desc=file_name)
with open(os.path.join(path, file_name), 'wb') as file:
for data in response.iter_content(block_size):
progress_bar.update(len(data))
file.write(data)
progress_bar.close()
def download_voices(path):
file_path = os.path.join(path, VOICES_FILENAME)
if os.path.exists(file_path):
return
names = supported_voices
pattern = "https://huggingface.co/hexgrad/Kokoro-82M/resolve/main/voices/{name}.pt"
voices = {}
for name in names:
url = pattern.format(name=name)
print(f"Downloading {url}")
r = requests.get(url)
r.raise_for_status() # Ensure the request was successful
content = io.BytesIO(r.content)
data: np.ndarray = torch.load(content, weights_only=True).numpy()
voices[name] = data
with open(file_path, "wb") as f:
np.savez(f, **voices)
print(f"Created {file_path}")
def download_model(path):
if os.path.exists(os.path.join(path, MODEL_FILENAME)):
return
download_file(MODEL_URL, MODEL_FILENAME, path)
class KokoroSpeaker:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"speaker_name": (
supported_voices,
{"default": "af_sarah"},
),
},
}
RETURN_TYPES = ("KOKORO_SPEAKER",)
RETURN_NAMES = ("speaker",)
FUNCTION = "select"
CATEGORY = "kokoro"
def __init__(self):
self.kokoro = None
self.node_dir = os.path.dirname(os.path.abspath(__file__))
self.voices_path = os.path.join(self.node_dir, VOICES_FILENAME)
self.model_path = os.path.join(self.node_dir, MODEL_FILENAME)
def select(self, speaker_name):
download_model(self.node_dir)
download_voices(self.node_dir)
kokoro = Kokoro(self.model_path, self.voices_path)
speaker: np.ndarray = kokoro.get_voice_style(speaker_name)
return ({"speaker": speaker},)
@classmethod
def IS_CHANGED(cls, speaker_name):
return hash(speaker_name)
class KokoroSpeakerCombiner:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"speaker_a": ("KOKORO_SPEAKER", ),
"speaker_b": ("KOKORO_SPEAKER", ),
"weight": ("FLOAT", {"default": 0.5, "min": 0, "max": 1, "step": 0.05}),
},
}
RETURN_TYPES = ("KOKORO_SPEAKER",)
RETURN_NAMES = ("speaker",)
FUNCTION = "combine"
CATEGORY = "kokoro"
def __init__(self):
self.kokoro = None
self.node_dir = os.path.dirname(os.path.abspath(__file__))
self.voices_path = os.path.join(self.node_dir, VOICES_FILENAME)
self.model_path = os.path.join(self.node_dir, MODEL_FILENAME)
def combine(self, speaker_a, speaker_b, weight):
download_model(self.node_dir)
download_voices(self.node_dir)
weight = weight * 100.0
weight_a = weight
weight_b = 100.0 - weight
speaker = np.add(speaker_a["speaker"] * (weight_a / 100.0), speaker_b["speaker"] * (weight_b / 100.0))
return ({"speaker": speaker},)
@classmethod
def IS_CHANGED(cls, speaker_a, speaker_b, weight):
return hash((speaker_a, speaker_b, weight))
class KokoroGenerator:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {"multiline": True, "default": "I am a synthesized robot"}),
"speaker": ("KOKORO_SPEAKER", ),
"speed": ("FLOAT", {"default": 1, "min": 0.1, "max": 4, "step": 0.05}),
"lang": (
supported_languages_display,
{"default": "English"
}),
},
}
RETURN_TYPES = ("AUDIO",)
RETURN_NAMES = ("audio",)
FUNCTION = "generate"
CATEGORY = "kokoro"
def __init__(self):
self.kokoro = None
self.node_dir = os.path.dirname(os.path.abspath(__file__))
self.model_path = os.path.join(self.node_dir, MODEL_FILENAME)
self.voices_path = os.path.join(self.node_dir, VOICES_FILENAME)
def generate(self, text, speaker, speed, lang):
download_model(self.node_dir)
download_voices(self.node_dir)
# np_load_old = np.load
# np.load = lambda *a, **k: np_load_old(*a, allow_pickle=True, **k)
lang = supported_languages[lang]
if lang is None:
lang = "en-us"
try:
kokoro = Kokoro(model_path=self.model_path, voices_path=self.voices_path)
except Exception as e:
logger.error(f"ERROR: could not load kokoro-onnx in generate: {e}")
# np.load = np_load_old
return (None,)
try:
audio, sample_rate = kokoro.create(text, voice=speaker["speaker"], speed=speed, lang=lang)
except Exception as e:
logger.error(f"{e}")
# np.load = np_load_old
return (None,)
if audio is None:
logger.error("no audio is generated")
# np.load = np_load_old
return (None,)
# np.load = np_load_old
audio_tensor = torch.from_numpy(audio).unsqueeze(0).unsqueeze(0).float() # Add a batch dimension AND a channel dimension
return ({"waveform": audio_tensor, "sample_rate": sample_rate},) #return as tuple
@classmethod
def IS_CHANGED(cls, text, speaker, speed, lang):
return hash((text, speaker, speed, lang))
NODE_CLASS_MAPPINGS = {
"KokoroGenerator": KokoroGenerator,
"KokoroSpeaker": KokoroSpeaker,
"KokoroSpeakerCombiner": KokoroSpeakerCombiner,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"KokoroGenerator": "Kokoro Generator",
"KokoroSpeaker": "Kokoro Speaker",
"KokoroSpeakerCombiner": "Kokoro Speaker Combiner",
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596# Comfy UI Kokoro
<a href="https://www.buymeacoffee.com/stavsapq" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="40" width="174"></a>
<img src="https://img.shields.io/badge/v1.0-green.svg?style=for-the-badge&labelColor=gray&label=Kokoro&color=blue" alt=""/>
<img src="https://img.shields.io/badge/0.5.0-green.svg?style=for-the-badge&labelColor=gray&label=Kokoro-onnx&color=blue" alt=""/>
Kokoro TTS nodes, wrapping this [kokoro onnx](https://github.com/thewh1teagle/kokoro-onnx) that is based on [hexgrad/Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M).

**note**: This picture is also a workflow, just download and drop it into comfy.
## Install
Install Via ComfyUI Manager, by `stavsap`.

Or
Clone the repo into `custom_nodes` folder
```shell
git clone https://github.com/stavsap/comfyui-kokoro.git
```
Then cd into `comfyui-kokoro`, and install requirements.
```shell
pip install -r requirements.txt
```
And finally reboot Comfy.
The onnx model and speakers meta-data will be automatically downloaded on the first run.
If using windows portable version and experience issues with dependencies, check the following:
[](https://youtu.be/O6qYvUN7vIc?si=loCoMD5ou2eeGL30)
## Nodes
Currently, there are 3 nodes that can be combined for TTS workflow.
### Kokoro Speaker

Select supported speakers.
### Kokoro Speaker Combiner

Combiner node to combine 2 given speakers to new speaker.
- **weight**: [1, 0], select the weight of `speaker a`.
Example:
`weight == 0.7` will result in strength of 70% of `speaker_a` and 30% of `speaker_b`.
### Kokoro Generate

- **speaker**: input a speaker
- **speed**: set the speach speed.
- **lang**: set the language, what ever is supported by kokoro.
## Available Voices
All supported voices can be found [here](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md).
## Use Cases:
1. TTS: Text To Speach, generate voice from test.
2. Lip Sync: sync lips of videos

## License
- [This repo](LICENSE)
- kokoro-onnx: MIT
- kokoro model: Apache 2.0
## Credits
- [Kokoro TTS Engine](https://huggingface.co/hexgrad/Kokoro-82M)
- [ComfyUI](https://github.com/comfyanonymous/ComfyUI)
- [ComfyUI-BS_Kokoro-onnx](https://github.com/Burgstall-labs/ComfyUI-BS_Kokoro-onnx)
- [ComfyUI-KokoroTTS](https://github.com/benjiyaya/ComfyUI-KokoroTTS)12345678910111213141516171819202122# ---------------------------------------------------------------------------# PARROT ENGINE FORK (phonemizer compat) — 2026-08-15# kokoro_onnx's Tokenizer calls EspeakWrapper.set_data_path(), which exists# only in phonemizer-FORK. This machine keeps VANILLA phonemizer 3.3.0# (Zonos depends on it; the fork claims the same module namespace and# installing it would overwrite shared files). The shim below adds a# compatible set_data_path that points espeak-ng at its data via the# ESPEAK_DATA_PATH env var, which espeak-ng honors natively. Additive,# vanilla-safe, and a no-op wherever the fork IS installed.# A pack update wipes this file — re-apply by symptom: ComfyUI import error# "AttributeError: ... EspeakWrapper ... set_data_path" on comfyui-kokoro.# ---------------------------------------------------------------------------from phonemizer.backend.espeak.wrapper import EspeakWrapperif not hasattr(EspeakWrapper, 'set_data_path'): def _parrot_set_data_path(path): import os os.environ['ESPEAK_DATA_PATH'] = str(path) EspeakWrapper.set_data_path = staticmethod(_parrot_set_data_path)# --------------------------- end PARROT ENGINE FORK ------------------------
from .ComfyUIKokoro import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']123version https://git-lfs.github.com/spec/v1oid sha256:7d5df8ecf7d4b1878015a32686053fd0eebe2bc377234608764cc0ef3636a6c5size 325532387123456789101112131415[project]
name = "comfyui-kokoro"
description = "Custom ComfyUI Nodes for TTS with Kokoro, genenrate and merge speakers for new style generations."
version = "1.1.4"
license = { file = "LICENSE" }
dependencies = ["kokoro-onnx", "onnxruntime", "numpy", "requests", "tqdm"]
[project.urls]
Repository = "https://github.com/stavsap/comfyui-kokoro"
# Used by Comfy Registry https://comfyregistry.org
[tool.comfy]
PublisherId = "stavsap"
DisplayName = "comfyui-kokoro"
Icon = ""12345kokoro-onnx
onnxruntime
numpy
requests
tqdm123version https://git-lfs.github.com/spec/v1oid sha256:a6d439ed196348d1a3529619db4939487619e6155c726a5fb0fd00538d373385size 28214398.gitattributes+4
engines/kokoro/.github/workflows/publish.ymlAdded+25
engines/kokoro/.gitignoreAdded+175
engines/kokoro/.meta/generator.pngAdded

engines/kokoro/.meta/img.pngAdded

Large File Pointer Details
- SHA256: d746119ca562ba35cc36bc1900c4a7109789200b6bb7ce59605901c207df39b3
- Pointer size: 131 Bytes
- Size of remote file: 114 kB
engines/kokoro/.meta/lipsync.pngAdded

Large File Pointer Details
- SHA256: bdebab6196c825d11b55c2b99c176899223892f2784aaa6fc12eb94ea0c94f06
- Pointer size: 131 Bytes
- Size of remote file: 367 kB
engines/kokoro/.meta/speaker.pngAdded

engines/kokoro/.meta/speaker_combiner.pngAdded

engines/kokoro/.meta/workflow.pngAdded

Large File Pointer Details
- SHA256: dc1750c4e60d7cf13e421abfdec1faca447f6b121539b328acff57043b83dd5a
- Pointer size: 131 Bytes
- Size of remote file: 126 kB
engines/kokoro/.meta/yt_img.pngAdded

Large File Pointer Details
- SHA256: f32f0c8a45bcb8a9d6786983a3624c1b145dcf58f8b71812e4b25da511d4124e
- Pointer size: 131 Bytes
- Size of remote file: 297 kB
engines/kokoro/CHANGE_LOG.mdAdded+19
engines/kokoro/ComfyUIKokoro.pyAdded+292
engines/kokoro/LICENSEAdded+201
engines/kokoro/README.mdAdded+96
engines/kokoro/__init__.pyAdded+22
engines/kokoro/__pycache__/ComfyUIKokoro.cpython-312.pycAdded
engines/kokoro/__pycache__/__init__.cpython-312.pycAdded
engines/kokoro/kokoro_v1.onnxAdded+3
engines/kokoro/pyproject.tomlAdded+15
engines/kokoro/requirements.txtAdded+5
engines/kokoro/voices_v1.binAdded+3