XB-BOX - 🌐 CosyVoice3 跨语言合成
Clone a voice once, then make it speak any of ten languages
- model
- reference_audio
- audio
The flagship trick of CosyVoice3 is cross-lingual synthesis: you feed it a reference clip of a voice in one language - English, Mandarin, whatever - and it speaks your target-language text in that same voice, retaining the timbre and cadence. XB_CosyVoice3_CrossLingual is XB_ToolBox's wrapper for exactly that: reference voice in, text in, AUDIO of that voice speaking your words out. It's the node that turns "one decent sample of a person" into "a local multi-language voice actor."
It's part of the CosyVoice3 suite bundled in the pack, alongside zero-shot cloning, instruct control, and dialog generation. If you've ever envied the API TTS voices, this is the local alternative the community has been running for a while now - CosyVoice clones have real reddit presence in the ComfyUI space, and multi-language is one of its calling cards.
How it works
The node takes the loaded model (a COSYVOICE_MODEL object from the pack's XB_CosyVoice3_ModelLoader), extracts speaker characteristics from reference_audio, and synthesizes text in the target language conditioned on that voice. The knobs that matter:
- target_language -
auto(detect from the text) or explicitzh,en,ja,ko,de,es,fr,it,ru.autois the default and usually right. - speed - 0.5–2.0×, default 1.0. Small changes read as energy; big ones can get artifacty.
- seed - default 42;
-1for random. TTS models are famously seed-finitely - if you get a take with a weird pronunciation, bump the seed before rephrasing. - text_frontend - on by default: normalizes text (numbers → words, etc.). Turn it off if you're feeding in CMU phonemes or special tags like
<slow>, which the frontend would mangle.
Output: audio - the synthesized AUDIO, ready for a save/preview node or the rest of your pipeline.
The inputs that matter
- model - from
XB_CosyVoice3_ModelLoader. There's no standalone model load here; wire the loader's output in. - text - the words to speak, in the target language.
- reference_audio - the voice to clone. Keep it clean and short (the family recommendation is 3–10s).
Installing
In XB_ToolBox:
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
then restart, and install the pack's dependencies - this is the real install story for all CosyVoice3 nodes. requirements.txt pulls in transformers, librosa, soundfile, modelscope/huggingface_hub, conformer, omegaconf, x-transformers, diffusers, pyworld, openai-whisper and friends. The ModelLoader downloads the model on first use (default Fun-CosyVoice3-0.5B, from HuggingFace or ModelScope - pick ModelScope if HF is throttled in your region). First run will quietly download a few GB; don't panic at the wait.
Common issues
- Reference too long - the nodes validate duration (max ~30s). Crop with
XB_CosyVoice3_AudioCropfirst. - Weird pronunciation on a great seed - try another
seed. These models can nail or butcher a sentence on adjacent seeds. - Numbers/text read wrong - keep
text_frontendon unless you know you need phonemes. - "Model not loaded" / install failure - the dependency stack is the #1 CosyVoice pain point in the community; a version conflict in
transformersusually surfaces as an import error. A clean venv for the pack or aligning versions with ComfyUI's own env is the standard fix.
The honest caveat: quality is voice- and seed-dependent - CosyVoice's multi-language output is genuinely good, but not ElevenLabs-smooth on every clip. Feed it a clean reference and it's a legit local multi-language voice; feed it a noisy one and no wrapper will save you.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COSYVOICE_MODEL | — | |
| text | STRING | Hello, this is cross-lingual speech synthesis. | — |
| reference_audio | AUDIO | — | |
| speed | FLOAT | 1.000.5–2 | — |
| target_languageopt | COMBO | auto | 10 options: auto, zh, en, ja, ko, de, +4 |
| seedopt | INT | 42-1–2147483647 | — |
| text_frontendopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |