Nodes/ComfyUI_Lam/IndexTTS2高级参数
ComfyUI Node

IndexTTS2高级参数

IndexTTS2 advanced knobs, bundled into one node you can reuse

By yanlang0123·Created 2 years ago·Updated about a month ago· 76
IndexTTS2高级参数
    • 高级参数
    do_sampletrue
    temperature0.8
    top_p0.80
    top_k30
    num_beams3
    repetition_penalty10.0
    length_penalty0.0
    max_mel_tokens1500

    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 LamIndexTTS2Node03. 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.

    Categorylam

    Inputs (8)

    NameTypeDefaultDescription
    do_sampleCOMBOtrue是否使用采样
    temperatureFLOAT0.80.1–2采样温度
    top_pFLOAT0.800–1采样概率
    top_kINT300–100采样数量
    num_beamsINT31–10num_beams
    repetition_penaltyFLOAT10.00.1–20repetition_penalty
    length_penaltyFLOAT0.0-2–2length_penalty
    max_mel_tokensINT150050–1815生成Token最大数量,过小导致音频被截断

    Outputs (1)

    NameTypeDescription
    高级参数ADVANCED_PARAMS