Nodes/ComfyUI_KokoroTTS_MW/Multi Line Text
ComfyUI Node

Multi Line Text

The unglamorous node that makes Kokoro dialogue actually typeable

By billwuhao·Created 2 years ago·Updated about a year ago· 33
Multi Line Text
    • text
    multi_line_prompt

    Let's be honest about what this node is: a text box. MultiLinePromptKK (shown as "Multi Line Text") takes a multiline string and hands it back stripped of leading/trailing whitespace. That's the entire job. It's the kind of node you'd normally skip past without a thought - except the pack's TTS nodes need it.

    The reason it exists is a design quirk of its siblings. Both KokoroRun and KokoroZHRun declare their text input as forceInput: true, which means there's no typeable text widget on the node - just an empty socket. To get words into them, you have to wire a string from somewhere else. This node is that somewhere. Newer ComfyUI builds ship their own multiline text primitive, so if you already have that, this one is technically redundant - but it's harmless, keeps the pack self-contained, and (crucially for this pack) gives you a proper big text area instead of cramming a script into a single-line box.

    When you actually want it

    For plain one-liners it's overkill. Where it earns its keep is the pack's dialogue feature. Turn on enable_dialogue in KokoroRun/ZHRun and your text becomes a little script:

    [S1] Professor Wang, I've been seeing the term "AI" everywhere lately.
    [S2] You'll be hearing it a lot more. It's not going anywhere.
    [S1] So what do we actually teach the students?
    

    Each [S1]/[S2] tag routes that line to the first or second voice. Doing that inside a single-line widget is miserable - escaping newlines, hunting for the right spot in a tiny field. In a multiline box you just write the thing like a normal conversation. The bundled workflow examples (Dialogue-en.json, Dialogue-zh.json) wire exactly this node into the TTS node's text socket, so it's the intended path.

    Install and notes

    No setup beyond the pack itself - it's pure ComfyUI, no models, no deps. Install via ComfyUI Manager (search ComfyUI_KokoroTTS_MW) or git clone https://github.com/billwuhao/ComfyUI_KokoroTTS_MW into custom_nodes. Input is multi_line_prompt (STRING, multiline); output is text (STRING), which you connect to any node that accepts a string - most commonly the text socket on KokoroRun or KokoroZHRun.

    Two small gotchas. The output is stripped, so deliberate leading spaces on a line survive per-line but the block gets trimmed at both ends - irrelevant for TTS. And remember: if you're not in dialogue mode, the tags do nothing; enable_dialogue must be on, or the node treats [S1] like literal text and says it out loud. As nodes go it's nothing special. As the thing that makes two-person TTS scripts usable, it's quietly the piece that holds the pack together.

    Category🎤MW/MW-KokoroTTS

    Inputs (1)

    NameTypeDefaultDescription
    multi_line_promptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING