Nodes/RUI-Nodes/对白提取器 / Dialogue Extractor
ComfyUI Node

对白提取器 / Dialogue Extractor

Turn a shot script into a clean dialogue list

By rui40000·Created 3 years ago·Updated 13 days ago· 17
对白提取器 / Dialogue Extractor
    • dialogues
    • summary
    input_text

    Dialogue Extractor does one narrow thing and does it well: it reads a storyboard/shot-script text and pulls out all the dialogue and narration lines, returning them as a clean list. In the RUI-Nodes pack's comic/animation pipeline, it's the downstream sibling of Shot Splitter - one node breaks the script into shots, this one harvests what the characters actually say.

    Why would you want that? Because the voiceover lines are exactly what you need for the audio half of the production: feeding a TTS node, building a subtitle file, or handing a narration list to a voice actor. If you've ever manually copy-pasted dialogue out of a long script because some text-processing tool couldn't tell a description from a line of speech, you know the value of a node that just does it.

    How it works

    The input input_text is your multi-line shot script. The node scans for dialogue markers and collects the text that follows them. It understands the two common forms:

    • 旁白:对话内容 - narration/dialogue prefixed with "旁白:" directly on the line.
    • 旁白:[对话内容] - the bracketed variant.

    It also looks inside <SHOT_XXX> tags, so dialogue embedded in a shot description gets found too. The outputs are dialogues, a LIST of the extracted lines in order, and summary, a string with an overview - again handy for logging.

    This node is Chinese-language-oriented by design: "旁白" is the Mandarin term for narration/dialogue in a comic or script. If your scripts are in English, you'd typically have the LLM that writes them emit 旁白: markers too, or this node isn't going to find much. That's a feature for the pack's core audience, just be aware of it.

    Installing it

    Part of the RUI-Nodes pack ("Rui-Node🐶"). Install once via ComfyUI Manager (search "RUI-Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/rui40000/RUI-Nodes
    cd RUI-Nodes
    pip install -r requirements.txt
    

    Restart after. Pure Python string processing - zero extra dependencies.

    Where people get burned

    The failure mode is format mismatch, same as its sibling Shot Splitter: if your script's dialogue doesn't use the 旁白: marker, extraction finds nothing and you get an empty list. Fix the source, not the node - tell your LLM to prefix dialogue with the marker. And know what it's not doing: it's not a smart language model that understands context; it's a pattern matcher. Lines that describe action won't be treated as dialogue, and dialogue that isn't marked won't be found. For a text node that's the right trade - deterministic and fast - just feed it well-marked input.

    CategoryRui-Node🐶/文本处理📝

    Inputs (1)

    NameTypeDefaultDescription
    input_textSTRING分镜描述原文。节点会从中挑出旁白/对白部分, 画面描述、镜头调度等非台词内容会被滤掉。 输出为对白列表,可直接接配音或字幕环节。

    Outputs (2)

    NameTypeDescription
    dialoguesLIST
    summarySTRING