Nodes/ComfyUI-Index-TTS/小说文本结构化
ComfyUI Node

小说文本结构化

Turn plain prose into a multi-character TTS script

By chenpipi0807·Created about a year ago·Updated about a month ago· 720
小说文本结构化
    • structured_text
    novel_textNovel text example. Lin Wei said, "Hello there." Su Qing replied, "Long time no see."

    Feeding a whole novel chapter into Index TTS Pro or Index TTS 2 Pro requires the text tagged by speaker - <Narrator> around the descriptive parts, <Character1> through <Character5> around each character's dialogue. Hand-tagging a chapter line by line is exactly the kind of tedious you'd rather automate, and that's this node's entire job: paste in plain prose, get back the tagged structure the Pro nodes expect.

    It's a text-only utility node - no audio in, no model to download, nothing GPU-related about it at all. It sits at the very front of the multi-character narration pipeline: raw text in here, tagged script out, straight into a Pro node's structured_text input.

    How it works, and its real limitation

    The parser tries to auto-detect dialogue (quote marks, typically) and figure out who's speaking from context - Chinese character-name recognition included, per the pack's own changelog. It handles straightforward prose reasonably well: clear paragraph breaks, clean quotation marks, dialogue tags like "he said" right next to the line.

    Where it struggles is exactly where you'd expect a heuristic text parser to struggle: complex scenes with more than a couple of speakers, dialogue without clear attribution, or unconventional formatting. The pack's own documentation is upfront about this - it calls the algorithm imperfect and explicitly recommends that for text you actually care about getting right, you either hand-check the output or use an LLM to do the character-splitting instead, formatting it directly into the <Narrator>/<CharacterN> tags this node (and the Pro nodes) expect. The pack even ships a prompt template file for exactly that LLM-assisted workflow. Treat this node as a fast first pass for drafts and rough cuts, not a guarantee for anything going into a final render.

    Inputs and outputs that matter

    There's really one input that matters: novel_text, a multiline string field where you paste your raw chapter or scene. No formatting requirements beyond normal prose - the node does the interpreting.

    The single output is structured_text - a string with your content wrapped in <Narrator> and <Character1><Character5> tags, ready to plug straight into the structured_text input on Index TTS Pro or Index TTS 2 Pro.

    Install

    ComfyUI Manager: search ComfyUI-Index-TTS, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chenpipi0807/ComfyUI-Index-TTS.git
    cd ComfyUI-Index-TTS
    pip install -r requirements.txt
    

    Nothing else to install for this specific node - it's pure text processing, no model weights involved. You only need the heavier IndexTTS or IndexTTS-2 downloads once you wire its output into an actual TTS Pro node.

    Where people get burned

    The failure mode isn't an error, it's a silently wrong parse: a character misattributed, dialogue folded into the narrator, or a fifth speaker that gets merged into someone else's tag because the node only supports five character slots. None of that throws - it just quietly produces a script that reads wrong once you generate audio from it. Always skim the structured_text output before sending a long piece into a full Pro-node render; catching a misattributed line here costs you thirty seconds, catching it after a ten-minute multi-character generation costs you the whole render.

    Categorytext/novels

    Inputs (1)

    NameTypeDefaultDescription
    novel_textSTRINGNovel text example. Lin Wei said, "Hello there." Su Qing replied, "Long time no see."

    Outputs (1)

    NameTypeDescription
    structured_textSTRING