Nodes/ComfyUI-Qwen3-TTS/Qwen3-TTS Smart Script Processor 🧠
ComfyUI Node

Qwen3-TTS Smart Script Processor 🧠

The parser that makes multi-role TTS possible

By wanaigc·Created 7 months ago·Updated 7 months ago· 113
Qwen3-TTS Smart Script Processor 🧠
    • texts
    • instructs
    • roles
    • pauses
    script角色A: [开心] 你好! [pause:1.0] 角色B: [冷酷] 没空。
    default_instruct正常语气说话。

    Here's the thing that makes this pack more than a single-speaker TTS wrapper: you can write a script like a screenplay and get a whole conversation out the other end, different voices per character, with emotional direction and pauses baked in. The ScriptProcessor is the front end of that system - a parser that turns your script text into the four structured lists the dialogue engine consumes. It doesn't touch a model or make any sound; it's pure text surgery, and it's the part that rewards a little formatting discipline.

    The script format

    Write one line per utterance, 角色名: 台词. Add emotions in square brackets and pauses as their own lines:

    角色A: [开心] 这里的风景真好啊!
    [pause:1.5]
    角色B: [冷酷] 是吗?我倒觉得很一般。
    

    The tags aren't arbitrary - [开心] (happy), [冷酷] (cold), [难过] (sad), and a dozen more are mapped internally to full speaking instructions like "speak in a cold, emotionless tone." English tags work too: [happy], [angry], [sad], [whisper], and so on. [pause:1.5] as a whole line inserts 1.5 seconds of silence - you can go down to decimal values, so "毫秒级" rhythm control is literal.

    What it outputs

    Four parallel LIST outputs, one entry per script line:

    • texts - the cleaned spoken lines (tags stripped).
    • instructs - the per-line emotion instruction (mapped from your tags, or the default_instruct if a line has none).
    • roles - the role name from before the colon.
    • pauses - silence durations (0 for speech lines).

    All four feed straight into the AdvancedDialogue node, which matches the role names against a Role Bank and generates each line with the right voice.

    The two inputs you actually touch

    • script - the multiline text field with the default example already in it. This is where your screenplay goes.
    • default_instruct - what every untagged line gets. The default ("正常语气说话。" - speak in a normal tone) is fine; change it if you want a baseline mood for lines that don't carry their own tag.

    There are no optional inputs and no model connection at all, which means you can wire this up and test your script format before you've even loaded a model.

    Gotchas

    • Role names must match the Role Bank exactly. 角色A in the script and RoleA in the bank is a mismatch - and the dialogue engine's fallback (grab the first voice in the bank) can be easy to miss. Keep them identical.
    • Pauses must be their own line, starting with [pause: - inline pauses like text [pause:0.5] aren't parsed here (that's a separate mechanism in the generation nodes). Actually, if you need a mid-sentence beat, the Voice Clone nodes themselves understand [pause:0.5] inline, so you can get it either way.
    • The parser is forgiving, which cuts both ways. A line without a colon becomes role "Default". An unknown tag doesn't crash - it becomes "以{t}的语气说话" (speak in the tone of {t}), which will likely produce a garbled instruction in English. If a line sounds wrong, check your tag spelling first.
    • Install is the shared pack routine - clone wanaigc/ComfyUI-Qwen3-TTS, pip install -r requirements.txt, restart. No per-node setup.
    CategoryQwen3-TTS

    Inputs (2)

    NameTypeDefaultDescription
    scriptSTRING角色A: [开心] 你好! [pause:1.0] 角色B: [冷酷] 没空。
    default_instructSTRING正常语气说话。

    Outputs (4)

    NameTypeDescription
    textsLIST
    instructsLIST
    rolesLIST
    pausesLIST