TS CosyVoice Save Speaker
Turn a 10-second voice clip into a permanent .pt preset
- model
- reference_audio
- saved_path
TS CosyVoice Save Speaker is the one-time cost that makes the rest of the pack painless. Feed it a reference clip and it extracts the speaker features that define the voice, then writes them to a .pt file in ComfyUI/models/cosyvoice/speaker/. From then on, Speaker Text To Voice reads that file instead of you re-supplying audio, and every line you generate keeps the same voice. It's the difference between loading a reference clip into every single workflow and loading it once, ever.
The mental model: this is the "save the character" button. Narrator, villain, sidekick - you save each once, name it properly, and build a little voice library that every future project draws from.
How it works
The node trims your reference_audio to 30 seconds, downsamples to mono 24 kHz, and runs the model's zero-shot speaker encoder over it to pull out the timbre embedding. Then it needs the text being spoken in that clip - because CosyVoice's cloning uses the reference transcript as a prompt anchor. If you leave reference_text empty, it auto-transcribes the clip with Whisper, which triggers a ~140 MB base model download into ComfyUI/models/whisper/ the first time. If Whisper or ffmpeg isn't installed, it still saves the preset but with an empty reference_text - and the resulting clone is noticeably worse. The pack logs a warning about exactly this. Type the text yourself for anything important.
The inputs that matter
reference_audio- the voice. Same quality rules as everywhere: clean, one speaker, 5–15 seconds, no music or reverb.reference_text- leave blank to let Whisper handle it, or type it for reliability. If the language is rare or the speech is mumbled, definitely type it.speaker_name- the filename, no extension. Name it like you'll find it in six months:narrator_female_warm,villain_male_deep,kid_neutral_v2. The defaultmy_speakeris how voice libraries die.
Output
A saved_path string telling you where the preset landed. The node is marked as an output node, so it also just works as a terminal step in the graph.
The workflow it belongs to
Model Loader ──→ Save Speaker (once) ──→ Speaker Text To Voice (every line) → Save Audio
Save once per voice, then never feed a reference clip into a workflow again.
Installing
Same pack as the whole family - 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 / onnxruntime) and CUDA torch installed before the pack deps. If you want auto-transcription, also pip install openai-whisper and make sure ffmpeg is on PATH. Neither is required - the node degrades gracefully without them, just with a worse clone.
Troubleshooting
- Preset saves but the clone sounds off - almost certainly an empty
reference_text. Check the log for the whisper warning and re-save with the transcript typed in. - It saves with
saved_pathbut the dropdown in Speaker Text To Voice doesn't show it - the preset went somewhere other thanmodels/cosyvoice/speaker/, or ComfyUI's schema cache is stale; restart ComfyUI. - Whisper never runs -
openai-whispermissing, or ffmpeg not on PATH. Install both, restart, retry. - First save downloads a 140 MB whisper model and feels slow - that's one-time.
The whole pack is built around this two-step rhythm. Skip it and you're re-encoding references forever; use it and the hard part of voice consistency is done.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COSYVOICE_MODEL | Загруженная модель CosyVoice из ноды загрузчика. | |
| reference_audio | AUDIO | Референсное аудио для сохранения тембра голоса; будет обрезано до 30 секунд и приведено к mono 24 kHz. | |
| reference_text | STRING | Текст, который произносится в референсном аудио; если оставить пустым, будет использована авторасшифровка Whisper. | |
| speaker_name | STRING | my_speaker | Имя сохраняемого пресета голоса без расширения файла; будет использовано как имя .pt файла. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| saved_path | STRING | — |