Nodes/ComfyUI_AIIA/AIIA Podcast Script Parser
ComfyUI Node

AIIA Podcast Script Parser

From Raw Script Text to Structured Dialogue, With Pauses and Emotions

By havvk·Created about a year ago·Updated 6 months ago· 13
AIIA Podcast Script Parser
    • dialogue_json
    • speaker_list
    • full_script_json
    script_textA: 大家好,欢迎收听我们的播客。 B: 是的,今天我们要聊一个很有趣的话题。 (Pause 0.5) A: [开心] 没错,就是关于 AI 的未来!
    speaker_mappingA=Speaker_A B=Speaker_B

    The whole AIIA podcast pipeline starts with a plain text script that looks like a screenwriting fragment - A: 大家好, then B: 是的, with the occasional pause and emotion tag thrown in. AIIA Podcast Script Parser turns that loose text into the structured JSON that every downstream TTS and stitching node speaks. It's the entry ramp to the pack's multi-speaker generation, and it doubles as the syntax reference for how to write your scripts.

    How it works

    You paste your script into script_text. It parses line by line into a JSON dialogue array, recognizing four kinds of input:

    • Dialogue - 角色名: 台词 (either ASCII or full-width colon). Becomes a speech entry with speaker and text.
    • Pauses - a line like (Pause 0.5) (or (Wait 1)) becomes a pause entry. This is how you breathe life into a back-and-forth instead of machine-gun timing.
    • Emotion tags - [开心] 台词 or [Happy] 台词 at the start of a line becomes that line's emotion. Downstream, CosyVoice reads these inline, IndexTTS-2 maps them to emotion vectors, and Qwen3-TTS converts them to instruct commands.
    • Visual tags - (Visual: https://example.com) or a relative path attaches a visual URL to the next speech line. That's the input for the pack's interactive Web Export workflow (you can change visuals without re-running TTS).

    There's also speaker_mapping - a small mapping block like Teacher=A / Student=B - so your script can use human names and the parser renames them to the A/B/C roles the TTS nodes expect. Lines starting with # are treated as comments.

    The outputs

    Three strings, each useful in different places:

    • dialogue_json - the cleaned dialogue (visuals stripped) that feeds the TTS nodes. This is the one you'll connect 90% of the time.
    • speaker_list - a comma-separated list of the speakers found.
    • full_script_json - the complete structure including visual tags, which pairs with AIIA Segment Merge to re-attach visuals to the generated timeline.

    Writing scripts that parse cleanly

    • Keep the format strict: Speaker: text per line. A line with no colon is silently ignored, which is the classic "my line vanished" bug - put a speaker name on every line.
    • [Emotion] goes before the text, right after the colon.
    • Pauses are their own line, not inline.
    • Multi-line dialogue for one speaker? The parser expects one line per utterance; if a paragraph has to survive, keep it on one line or split it.

    Install

    Standard pack install: havvk/ComfyUI_AIIA via ComfyUI Manager or git clone https://github.com/havvk/ComfyUI_AIIA.git into custom_nodes/, restart. No models, no dependencies - it's a pure text parser, so you can build your whole script pipeline before ever downloading a TTS weight.

    CategoryAIIA/Podcast

    Inputs (2)

    NameTypeDefaultDescription
    script_textSTRINGA: 大家好,欢迎收听我们的播客。 B: 是的,今天我们要聊一个很有趣的话题。 (Pause 0.5) A: [开心] 没错,就是关于 AI 的未来!
    speaker_mappingoptSTRINGA=Speaker_A B=Speaker_B

    Outputs (3)

    NameTypeDescription
    dialogue_jsonSTRING
    speaker_listSTRING
    full_script_jsonSTRING