Nodes/ComfyUI-xiaozhuguang/小珠光 LongCat
ComfyUI Node

小珠光 LongCat

Offline voice cloning TTS that never phones HuggingFace

By xiaozhuguang·Created 2 months ago·Updated a day ago· 56
小珠光 LongCat
  • prompt_audio
  • audio
model_path
tokenizer
text这是用参考音色克隆出来的语音,可以自由改变要说的文本内容。
prompt_text
steps16
guidance_strength4.0
guidance_methodapg
deviceauto
dtypeauto
attentionauto
seed0
unload_modeoffload_cpu
pause_between_segments0.3
volume_protecttrue

Voice cloning in ComfyUI means the LongCat-AudioDiT stack: a diffusion TTS model that takes a 3–15 second reference clip of a voice plus its transcript, and reads your text in that voice. It's genuinely good - and the original plugin has one maddening flaw. Even after you've downloaded the models, if HuggingFace is unreachable, the tokenizer check still tries to phone home and the whole thing hangs or dies. This node (小珠光 LongCat) is the pack's strict-offline fork of that voice-clone workflow: it reuses the LongCat modeling code but strips out every network call, so once your models are local, it runs forever without touching the internet.

Mechanically it's a careful fork. Where the original loader lists phantom "auto-download" model entries and calls snapshot_download on a miss, this node scans ComfyUI/models/audiodit/ and lists only what's actually on disk, throws a clear FileNotFoundError with the path and download instructions if nothing's there, and forces local_files_only=True on the transformers loads so nothing sneaks out to the network. It also has a 4-level fallback chain for the UMT5 tokenizer - your models folder, the sibling directory, your HF cache, then the original plugin's bundled copy - before it gives up. If you've had the LongCat plugin sit frozen on "loading tokenizer" for five minutes, this is the fix.

The inputs are the meat of any TTS node, and the tooltips do the explaining:

  • text - what you want read aloud, in the cloned voice. Auto-splits long text into sentences.
  • prompt_audio - the reference clip whose voice you're cloning; 3–15 seconds is the sweet spot.
  • prompt_text - the transcript of that clip. Strongly recommended - without it, cloning quality drops noticeably.
  • steps - ODE Euler steps, default 16 (4–64).
  • guidance_strength - CFG/APG strength, default 4. Voice cloning is recommended at apg (see next).
  • guidance_method - cfg or apg (default). The author recommends apg for cloning.
  • device - auto / cuda / cpu / mps.
  • dtype - auto / bf16 / fp16 / fp32; the tooltip warns fp16 numerically overflows, so bf16 is the clone recommendation.
  • attention - auto / sdpa / sage_attention / flash_attention.
  • seed, unload_mode (full_unload / offload_cpu / keep_gpu - the VRAM-management ladder), pause_between_segments (silence between auto-split sentence segments, 0.3s default), and volume_protect (optional, on by default: matches output RMS to the reference and guards against clipping).

One output: audio (AUDIO) - wire it to a save/combine node, and it pairs perfectly with the pack's video combine for muxing voice onto a clip.

The catch, and it's the important one: this is not self-contained. It deliberately reuses the ComfyUI-LongCat-AudioDIT-TTS plugin's modeling library, so you need that original plugin installed alongside, plus the LongCat model and UMT5 tokenizer in ComfyUI/models/audiodit/. The recommended path (from the README): install the original plugin once, let it download the models, then switch to this node and never look at the network again. librosa is in the pack's deps; registry install handles it.

Install the pack (ComfyUI Manager → ComfyUI-xiaozhuguang) and the LongCat plugin, drop the models in place, restart. If the dropdowns are empty, that's the strict-offline design telling you the files aren't where it expects - that's the feature, not a bug. For an offline voice-clone pipeline that just works, this is the one to reach for.

Categoryxiaozhuguang

Inputs (15)

NameTypeDefaultDescription
model_pathCOMBO【严格离线】仅列出 ComfyUI/models/audiodit/ 下的本地模型。
tokenizerCOMBO文本分词器目录(UMT5 tokenizer)。仅列出本地已存在的目录。
textSTRING这是用参考音色克隆出来的语音,可以自由改变要说的文本内容。目标文本(用克隆出来的音色朗读)。自动分句,支持长文本。
prompt_audioAUDIO参考音频(要克隆的音色)。3–15 秒效果最佳。
prompt_textSTRING参考音频的文字转录(强烈建议提供,会显著提升克隆质量)。
stepsINT164–64ODE Euler 步数。
guidance_strengthFLOAT4.00–10CFG/APG 引导强度。
guidance_methodCOMBOapg音色克隆推荐 apg。
deviceCOMBOauto4 options: auto, cuda, cpu, mps
dtypeCOMBOauto音色克隆推荐 bf16,fp16 会数值溢出。
attentionCOMBOauto4 options: auto, sdpa, sage_attention, flash_attention
seedINT00–2147483647
unload_modeCOMBOoffload_cpu模型卸载模式: full_unload: 完全卸载(彻底释放显存,下次推理重新加载,最慢但显存最干净) offload_cpu: offload 到 CPU(释放显存但保留权重,下次推理快速 resume,平衡) keep_gpu: 完全保持 GPU(永不离开 GPU,占显存换最快连续推理速度)
pause_between_segmentsFLOAT0.30–2自动分句时各段之间的静音秒数。长文本分句拼接时使用。
volume_protectoptBOOLEANtrue响度保护:输出 RMS 对齐参考音频 RMS(输入输出音量相等), 同时长文本各段天然对齐到同一目标,段间音量一致。 含 ±12dB 增益钳制与防削波保护。

Outputs (1)

NameTypeDescription
audioAUDIO