Nodes/APZmedia Qwen TTS Nodes/APZmedia: Voice Library Loader
ComfyUI Node

APZmedia: Voice Library Loader

Turn a saved folder back into a speaker embedding

By APZmedia·Created 5 months ago·Updated 5 months ago· 1
APZmedia: Voice Library Loader
  • model_base
  • reference_audio
  • voice_prompt
library_path
voice_name
x_vector_only_modefalse

APZmedia: Voice Library Loader is the "later" half of the pack's flagship workflow. You designed a voice, saved it with Voice Library Save, and now - in a fresh workflow, maybe days later - you want that voice back. This node reads the saved folder and rebuilds the speaker embedding so you can speak as that voice again.

It's worth being precise about what "rebuilds" means, because it's the mechanism that makes this whole library system work. The embedding itself is not saved to disk - the WAV is. So the loader takes the saved reference.wav, reads the transcript from metadata.json, and runs it through the Base model's create_voice_clone_prompt() to recompute the embedding on the spot. That's why this node needs a model_base input while the save node didn't: rebuilding a fingerprint requires the model that makes fingerprints.

Inputs

  • model_base - a Base model from APZmedia: Model Loader. Non-negotiable, and validated.
  • library_path - the library folder. Empty defaults to ComfyUI/output/apzmedia_voice_library/, which matches the save node's default. If you saved somewhere custom, put the same absolute path here.
  • voice_name - the subfolder name you gave the voice at save time. This one is a plain text field, not a dropdown - the pack's author points you at Voice Library List to see what's available before you type.
  • x_vector_only_mode - default False. Keep it False if your saved voice has a good transcript in metadata.json (it should, if you wired ref_text when saving). Flip it to True to skip the transcript and use just the speaker x-vector - the escape hatch for voices saved without a transcript.

Outputs

Two sockets: reference_audio (the saved WAV back as ComfyUI AUDIO, handy for a sanity check or preview) and voice_prompt (the rebuilt embedding). Wire voice_prompt straight into Voice Clone Generate and you're back in business.

[Model Loader: Base] → [Voice Library Loader]  voice_name: "narrator"
                                ↓ voice_prompt
                     [Voice Clone Generate]  text: "Any line you want"

Gotchas

Two failure modes to know about. If voice_name doesn't match a subfolder, the node raises a FileNotFoundError and - nice touch - lists the voices that are available, so the error message is itself a mini Voice Library List. And if you're in non-x-vector mode but the saved metadata.json has an empty ref_text, you get a clear "set ref_text when saving or use x_vector_only_mode" error. Both are the pack being helpful, not broken.

The loader also hashes the library contents and recalculates when they change, so if you add or rename a voice, the node won't serve you a stale cached embedding. Give it a moment to re-run after editing the folder on disk.

Install is the pack-wide clone (git clone https://github.com/APZmedia/ComfyUI-APZmedia-qwen-TTS into custom_nodes, restart). First run downloads the Base model from Hugging Face - a few minutes, then it's resident and fast.

CategoryAPZmedia/TTS

Inputs (4)

NameTypeDefaultDescription
model_baseQWEN_TTS_MODEL
library_pathSTRINGFolder containing voice subfolders (each with reference.wav + metadata.json).
voice_nameSTRINGSubfolder name of the voice (see library_path).
x_vector_only_modeBOOLEANfalse

Outputs (2)

NameTypeDescription
reference_audioAUDIO
voice_promptVOICE_PROMPT