TS CosyVoice Dialog
Write a script, get a four-voice scene with every speaker on its own track
- model
- speaker_A_Audio
- speaker_B_Audio
- speaker_C_Audio
- speaker_D_Audio
- dialog_audio
- speaker_a_audio
- speaker_b_audio
- speaker_c_audio
- speaker_d_audio
- message
TS CosyVoice Dialog is the multi-speaker scene node: paste a script in SPEAKER A: ... / SPEAKER B: ... format, feed it a reference clip for each voice, and it renders the whole conversation - plus every speaker on its own track. It's the node you reach for when your visual novel, animated short, or radio-play mockup needs two to four distinct voices trading lines without you stitching audio together by hand.
The script format is the whole interface:
SPEAKER A: Hi, how are you?
SPEAKER B: I'm great, thanks for asking!
SPEAKER A: What did you do today?
SPEAKER B: Recorded a new podcast episode.
How it works
The node parses your dialog_text line by line, mapping SPEAKER A: through SPEAKER D: to the reference clips you provide. Each speaker's reference audio is prepared (trimmed to a 30-second max, and transcribed for the prompt text via Whisper if you didn't supply it elsewhere), then every line is generated individually with that speaker's voice. Lines are synthesized one at a time and assembled twice: once into a per-speaker track, once into a single mixed dialog_audio. It's deliberately built so each speaker's track is a separate output - that's what makes it usable in a DAW afterward instead of being stuck with one merged file.
The inputs that matter
dialog_text- the script. Must use theSPEAKER A:/SPEAKER B:prefixes; mislabelled lines are skipped with a warning, and a script with no valid lines returns an explicit error instead of a silent short render.speaker_A_Audio/speaker_B_Audio- required references. The tooltips suggest 3–10 seconds, hard max 30.speaker_C_Audio/speaker_D_Audio- optional. Two-voice scenes only need A and B; a line for an un-supplied speaker gets skipped and logged.speedandseed- the usual suspects.
Outputs
Six of them, and they're the point:
dialog_audio- the final mix.speaker_a_audio/speaker_b_audio/speaker_c_audio/speaker_d_audio- each voice isolated.message- a status string with diagnostics like line counts and duration.
Wire the mix straight to Save Audio, or grab the individual tracks if you're mixing in a DAW. Cancellation works between lines, so a long script isn't a single uninterruptible inference.
Installing
ComfyUI Manager (search TS CosyVoice) or:
cd ComfyUI/custom_nodes
git clone https://github.com/AlexYez/comfyui-ts-cosyvoice.git
cd comfyui-ts-cosyvoice
pip install -r requirements.txt
Plus one ONNX Runtime (onnxruntime-gpu on NVIDIA, onnxruntime otherwise) and CUDA torch before the pack's deps. If you want the per-speaker auto-transcription, pip install openai-whisper and ffmpeg on PATH - optional, but the prompt anchor matters for clone quality.
Troubleshooting
- A line vanishes from the render - check the log for "no audio reference provided" or "unrecognised line." Fix the prefix or wire in the missing speaker.
- Output comes back with empty speaker tracks - you referenced a
SPEAKER C:line but never suppliedspeaker_C_Audio. - Voices sound off - same reference-quality rules as the rest of the pack: clean, one speaker, no music or reverb.
- It's slow - a long script is many separate inferences. That's the design; each line is its own generation.
If you've ever hand-stitched four TTS takes together in an editor, this node deletes that whole job. Write the script, pick the voices, export the stems.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COSYVOICE_MODEL | Загруженная модель CosyVoice из ноды загрузчика. | |
| dialog_text | STRING | SPEAKER A: Hello, how are you? SPEAKER B: I'm doing great, thanks for asking! | Текст диалога с репликами вида SPEAKER A:, SPEAKER B: и так далее. |
| speaker_A_Audio | AUDIO | Референсный голос для SPEAKER A; желательно 3-10 секунд, максимум 30 секунд. | |
| speaker_B_Audio | AUDIO | Референсный голос для SPEAKER B; желательно 3-10 секунд, максимум 30 секунд. | |
| speed | FLOAT | 1.000.5–2 | Множитель скорости речи для всех реплик в диалоге. |
| speaker_C_Audioopt | AUDIO | Необязательный референсный голос для SPEAKER C. | |
| speaker_D_Audioopt | AUDIO | Необязательный референсный голос для SPEAKER D. | |
| seedopt | INT | 42-1–2147483647 | Зерно случайности; значение -1 использует случайный seed. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| dialog_audio | AUDIO | — |
| speaker_a_audio | AUDIO | — |
| speaker_b_audio | AUDIO | — |
| speaker_c_audio | AUDIO | — |
| speaker_d_audio | AUDIO | — |
| message | STRING | — |