AIIA Podcast Script Parser
From Raw Script Text to Structured Dialogue, With Pauses and Emotions
- dialogue_json
- speaker_list
- full_script_json
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 aspeechentry withspeakerandtext. - Pauses - a line like
(Pause 0.5)(or(Wait 1)) becomes apauseentry. 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'semotion. 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: textper 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| script_text | STRING | A: 大家好,欢迎收听我们的播客。 B: 是的,今天我们要聊一个很有趣的话题。 (Pause 0.5) A: [开心] 没错,就是关于 AI 的未来! | — |
| speaker_mappingopt | STRING | A=Speaker_A B=Speaker_B | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| dialogue_json | STRING | — |
| speaker_list | STRING | — |
| full_script_json | STRING | — |