Nodes/Bjornulf_custom_nodes/๐Ÿ“โžœ๐Ÿ”Š Kokoro - Text to Speech
ComfyUI Node

๐Ÿ“โžœ๐Ÿ”Š Kokoro - Text to Speech

Kokoro Text to Speech (Bjornulf_custom_nodes) โ€” ComfyUI Node Guide

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
๐Ÿ“โžœ๐Ÿ”Š Kokoro - Text to Speech
  • connect_to_workflow
  • AUDIO
  • audio_path
  • audio_full_path
  • audio_duration
โ—„textโ€”โ–บ
โ—„voiceDefault (American Female) - afโ–บ
โ—„languageen-usโ–บ
โ—„speed1.0โ–บ
โ—„autoplaytrueโ–บ
โ—„save_audiotrueโ–บ
โ—„overwritefalseโ–บ
โ—„seed0โ–บ

If you've already fought with Bjornulf's other TTS node (the one built on XTTS), the Kokoro node is the one that just works. No backend server to start, no port to open in a browser to sanity-check, nothing chewing 3GB of VRAM in the background waiting for a request. Kokoro TTS is a genuinely lightweight local model - it runs entirely through ONNX inside the ComfyUI process - and it's popular enough on its own that other people have built standalone ComfyUI wrappers just for it, completely separate from this pack. Bjornulf folded it in as option #2 for text-to-speech, and for a lot of workflows it's the one you'll actually reach for.

The trade you're making versus his XTTS node: Kokoro doesn't do voice cloning from your own sample. You pick from a fixed roster of built-in voices instead of feeding it a .wav of someone talking. In exchange you skip an entire separate backend project, its setup, and its VRAM footprint. If you just need a narrator voice and don't care whose voice it is, Kokoro is less hassle for a very similar result.

Inputs and outputs

The important ones: text (multiline, obviously), voice - an 11-option dropdown mixing American and British, male and female (things like af_bella, am_adam, bf_emma, bm_george), and language, which covers en-us, en-gb, fr-fr, ja, ko, and cmn (Mandarin). speed runs 0.5โ€“2x. autoplay plays the clip the moment the node finishes; save_audio writes it to disk, and overwrite controls whether it regenerates or reuses an existing file of the same name - handy when you're iterating on a line and don't want a hundred near-identical files piling up. There's also seed, and an optional connect_to_workflow input whose only job is to force this node to sit downstream of something else in your graph - it's a plumbing trick, not real data.

Outputs: AUDIO (wire straight into a Preview Audio node), plus audio_path, audio_full_path, and audio_duration as a FLOAT - that duration output is genuinely useful if you're syncing generated speech to a video length elsewhere in the pack.

Installing it

Grab the pack through ComfyUI Manager (search "Bjornulf_custom_nodes") or clone it directly: cd ComfyUI/custom_nodes && git clone https://github.com/justUmen/Bjornulf_custom_nodes, then restart ComfyUI. That gets you the other 160-odd nodes in the pack too - it's a monolithic install, no picking individual nodes.

Here's the part that trips people up: as of pack version 0.76, kokoro_onnx was deliberately pulled out of the bundled requirements.txt. It was conflicting with the numpy version other popular packs - Impact Pack among them - expect to be installed. So this one node needs a manual step the rest of the pack doesn't: pip install kokoro_onnx (inside your ComfyUI venv, or via the embedded python.exe on Windows: .\python.exe -m pip install kokoro_onnx). Skip it and the node will complain about a missing dependency the first time you try to run it, even though the rest of the pack installed clean.

Common issues

The numpy conflict above is the one you're most likely to hit, and it's the reason the author gives for the manual install - if you get a numpy-related import error touching this node specifically, that's almost certainly it; check what other custom nodes are pinning numpy versions before you start downgrading blind. Beyond that, this node is refreshingly low-drama compared to the rest of the pack's audio tooling: because it's fully local and self-contained, none of the "did I forget to start the backend server" or "is it listening on the right port" problems that plague the XTTS-based TTS node apply here. If audio isn't generating at all, confirm kokoro_onnx actually installed into the same Python environment ComfyUI is running in - a common trap on Windows portable installs where a global pip install lands in the wrong python.exe entirely.

CategoryBjornulf/Kokoro

Inputs (9)

NameTypeDefaultDescription
textSTRINGโ€”
voiceCOMBODefault (American Female) - af11 options: Bella (American Female) - af_bella, Nicole (American Female) - af_nicole, Sarah (American Female) - af_sarah, Sky (American Female) - af_sky, Default (American Female) - af, Adam (American Male) - am_adam, +5
languageCOMBOen-us6 options: en-us, en-gb, fr-fr, ja, ko, cmn
speedFLOAT1.00.5โ€“2โ€”
autoplayBOOLEANtrueโ€”
save_audioBOOLEANtrueโ€”
overwriteBOOLEANfalseโ€”
seedINT0โ€”
connect_to_workflowopt*โ€”

Outputs (4)

NameTypeDescription
AUDIOAUDIOโ€”
audio_pathSTRINGโ€”
audio_full_pathSTRINGโ€”
audio_durationFLOATโ€”