ComfyUI Node

TTS WebUI Kokoro

The 82M-param TTS that's stupidly fast

By rsxdalv·Created 10 months ago·Updated 10 months ago· 5
TTS WebUI Kokoro
    • audio
    • wav_path
    • metadata_json
    textHello
    api_basehttp://127.0.0.1:7778
    voiceaf_heart
    speed1.00
    model_namehexgrad/Kokoro-82M
    api_key
    use_gputrue
    timeout_sec120
    channels_firsttrue
    also_save_wavfalse
    save_prefixtts
    return_metadatatrue

    Kokoro-82M is the small TTS model that won the community over: 82 million parameters, Apache-2.0, and quality that punched absurdly far above its size. Before Chatterbox arrived and took the crown, "Kokoro was the open-source king" was the running consensus - not because it beat every model, but because nothing else got that close to natural speech at that little compute. It's the node most people in this pack actually start with.

    How it works

    Same story as every node in this pack: you type text, the node POSTs an OpenAI-style body to your TTS WebUI server at http://127.0.0.1:7778/v1/audio/speech with model: "kokoro", and converts the returned WAV into a ComfyUI AUDIO object. The actual model - hexgrad/Kokoro-82M - runs inside the server. If the server hasn't loaded it yet, the first call pulls it down, which is exactly why the default timeout_sec of 120 can bite you on request number one.

    The inputs that matter

    • voice - defaults to af_heart. Kokoro names its voices with a scheme that's easy once you know it: two letters for language + gender (af = American female, am = American male, bf = British female, bm = British male), then a personality name - af_heart, am_michael, bm_george, that sort of thing. random works too if you want to gamble.
    • speed - 0.25 to 4.0, default 1.0.
    • model_name - defaults to hexgrad/Kokoro-82M, i.e. the exact Hugging Face repo the server loads. If you're running a fine-tune of Kokoro on the server, point this at it.
    • use_gpu - True by default. Flip it off if you're on a CPU-only box and patient.

    Outputs

    Three, like the rest of the pack: audio (AUDIO) into a preview or save node, wav_path (STRING, filled only when also_save_wav is on - writes to output/audio), and metadata_json (STRING) with request model, api_base, and WAV stats.

    Installing it

    ComfyUI Manager → search "TTS WebUI API nodes for ComfyUI", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/rsxdalv/ComfyUI-TTS-Webui
    

    then restart. The pack only needs requests, numpy, and torch, all of which your ComfyUI already has. The Kokoro weights download to the TTS WebUI server, not into this node.

    When it breaks

    • Connection refused: the server isn't running on 127.0.0.1:7778. Start TTS WebUI and load Kokoro there first; if it's on another machine, set api_base to its address.
    • First call times out: that's the server downloading or loading the 82M model (small, but still). Raise timeout_sec.
    • "Voice not found" type errors: you typed a voice name the server doesn't know. random is the reliable fallback, or check the server's voice list.

    The honest caveat: Kokoro is fast and decent, not the best-sounding TTS anymore. If you need quality above all and have the VRAM, Chatterbox or a cloning model will beat it - but for quick narration, game dialogue, or iterating on a script at speed, Kokoro remains the one you reach for.

    CategoryAudio/TTS

    Inputs (12)

    NameTypeDefaultDescription
    textSTRINGHello
    api_baseSTRINGhttp://127.0.0.1:7778
    voiceSTRINGaf_heart
    speedFLOAT1.000.25–4
    model_nameSTRINGhexgrad/Kokoro-82M
    api_keyoptSTRING
    use_gpuoptBOOLEANtrue
    timeout_secoptINT1201–600
    channels_firstoptBOOLEANtrue
    also_save_wavoptBOOLEANfalse
    save_prefixoptSTRINGtts
    return_metadataoptBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    audioAUDIO
    wav_pathSTRING
    metadata_jsonSTRING