Nodes/ComfyUI-Replicate/Replicate lucataco/xtts-v2
ComfyUI Node

Replicate lucataco/xtts-v2

Clone a voice and read text in it, from ComfyUI

By replicate·Created 2 years ago·Updated 2 years ago· 207
Replicate lucataco/xtts-v2
  • speaker
  • AUDIO
textHi there, I'm your new voice clone. Try your best to upload quality audio
languageen
cleanup_voicefalse
force_rerunfalse

Give it a short clip of someone talking and some text, and it reads that text back in their voice. This is Coqui's XTTS-v2, a zero-shot voice-cloning TTS model, packaged as a Replicate node by lucataco. "Zero-shot" is the appeal - no training, no fine-tune, just a few seconds of reference audio and it clones the timbre on the spot, in any of 16 languages. Handy for narration, character voices, or dubbing a script in a voice you captured.

Because it's a Replicate node, the work happens in the cloud: your reference audio and text go up to Replicate, the model runs on their GPU, the spoken audio comes back. You need a Replicate account and a REPLICATE_API_TOKEN, you pay per run, and nothing installs on your machine beyond the wrapper.

How it works

XTTS-v2 conditions on your reference clip to extract a speaker embedding - the "fingerprint" of that voice - then synthesizes your text using it. That's why the reference is everything: the model can only clone what it can hear clearly. A clean 6–30 second sample of steady speech gives it a solid embedding; a noisy or clipped one gives it mush.

The inputs and outputs that matter

  • speaker (required, AUDIO) - the reference voice. Clean, single speaker, no music or background noise. This is the input that determines your whole result.
  • text - what you want spoken.
  • language (en) - one of 16 codes (en, es, fr, de, it, pt, and more). Set it to match the language of your text.
  • cleanup_voice (false) - an optional pass to tidy the reference audio before cloning. Worth trying if your sample isn't pristine.

Output is a single AUDIO stream you wire into a save-audio node. force_rerun bypasses Replicate's result cache when identical inputs would otherwise hand back the same clip.

How to install it

One install covers the whole Replicate pack.

  • ComfyUI Manager: search ComfyUI-Replicate, install, restart.
  • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/replicate/comfyui-replicate
    cd comfyui-replicate
    pip install -r requirements.txt
    
    then restart.

No model weights land locally - only the replicate pip package. Set your token before launching ComfyUI: export REPLICATE_API_TOKEN="r8_..." (replicate.com/account/api-tokens).

Common issues & troubleshooting

The AUDIO output misbehaves in the graph. The pack's README is candid that it was built around "simple text or image outputs" and that broader audio support is still a roadmap item. Voice clones come back fine through this node, but audio is the pack's least-polished area - if the output won't preview or save, update ComfyUI for its native AUDIO support and make sure there's a save-audio node downstream.

The clone sounds robotic, wrong, or nothing like the person. This is almost always the reference clip. Give it clean, single-speaker audio - no music, no crosstalk, no heavy compression - ideally 6–30 seconds of natural speech. Turn on cleanup_voice if the sample is imperfect. Garbage in, garbage voice.

Weird pronunciation or an accent that's off. Set language to match your text. Reading English text with the language set to another code will mangle it.

Same clip on every run. Replicate is returning the cached result for identical inputs. Set force_rerun to force a fresh synthesis (XTTS has natural variation run to run).

CategoryReplicate

Inputs (5)

NameTypeDefaultDescription
speakerAUDIO
textoptSTRINGHi there, I'm your new voice clone. Try your best to upload quality audio
languageoptCOMBOen16 options: en, es, fr, de, it, pt, +10
cleanup_voiceoptBOOLEANfalse
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
AUDIOAUDIO