IndexTTS2高级参数
IndexTTS2 advanced knobs, bundled into one node you can reuse
- 高级参数
This node doesn't synthesize anything. LamIndexTTS2AdvancedParams collects the sampling settings for IndexTTS2 into a single ADVANCED_PARAMS object you can wire into any of the pack's four TTS nodes (LamIndexTTS2Node0 through Node3). It's a config bundle with a lot of dials and a very small job: bundle them up, pass them along.
It exists because IndexTTS2's synthesis server takes a pile of generation parameters, and nobody wants to re-enter eight values on every TTS node in every workflow. Build the bundle once, branch it to several TTS nodes, tweak in one place. That's the whole point.
The knobs
These map straight to the parameters IndexTTS2's sampling uses (they get forwarded as strings to the server's /generate endpoint):
- do_sample - whether to sample at all. Off means deterministic decoding.
- temperature (default 0.8) - sampling temperature; higher = more varied, less safe.
- top_p (default 0.8) - nucleus sampling probability.
- top_k (default 30) - how many top tokens to consider.
- num_beams (default 3) - beam search width.
- repetition_penalty (default 10.0) - here's a trap: 10 is a very aggressive repetition penalty. Most TTS/LLM setups live around 1.0–1.3. The author's default will suppress repeated phrasing hard, which is usually fine for short lines but can sound robotic if you leave it untouched and hear weirdness. Dial it toward 1.0–2.0 and see.
- length_penalty (default 0) - positive encourages longer utterances, negative shorter.
- max_mel_tokens (default 1500) - the one that actually bites. The tooltip spells it out: too small and your audio gets cut off mid-sentence. If you're synthesizing long paragraphs and hear truncated tails, raise this (up to 1815).
Output
A single 高级参数 output (type ADVANCED_PARAMS). Wire it into the params optional input on LamIndexTTS2Node0–3. Leave it unconnected and those nodes just use their internal defaults - so this node is strictly optional, but it's the only way to change the defaults.
Install
It's part of the ComfyUI_Lam pack:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
or via ComfyUI Manager (search ComfyUI_Lam), then follow the README's install.bat / 修改文件.bat (Linux: install.sh / 修改文件.sh) step. Remember the pack patches a couple of ComfyUI core files - 还原文件 is there to undo it if you ever bail.
Gotchas
The obvious one: this node is pure configuration, so nothing happens until you attach it to a TTS node and that node can reach a running IndexTTS2 server on port 5000. The other trap is the repetition_penalty default - leave it at 10 and you may chase a "why does my TTS sound stilted" mystery that's actually this one slider. If output is getting cut off, max_mel_tokens is your first suspect.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| do_sample | COMBO | true | 是否使用采样 |
| temperature | FLOAT | 0.80.1–2 | 采样温度 |
| top_p | FLOAT | 0.800–1 | 采样概率 |
| top_k | INT | 300–100 | 采样数量 |
| num_beams | INT | 31–10 | num_beams |
| repetition_penalty | FLOAT | 10.00.1–20 | repetition_penalty |
| length_penalty | FLOAT | 0.0-2–2 | length_penalty |
| max_mel_tokens | INT | 150050–1815 | 生成Token最大数量,过小导致音频被截断 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 高级参数 | ADVANCED_PARAMS | — |