Nodes/MOSS-TTS 1.5/MOSS-TTS Estimate Tokens
ComfyUI Node

MOSS-TTS Estimate Tokens

Make MOSS-TTS talk for exactly as long as you want

By eehrich·Created 2 months ago·Updated 12 days ago· 1
MOSS-TTS Estimate Tokens
    • target_tokens
    text
    words_per_minute150

    MOSSEstimateTokens is the smallest node in the MOSS-TTS 1.5 pack and secretly one of the most useful. It doesn't make a sound. It takes your text and returns a single INT - a target_tokens count you feed into MOSS-TTS Voice Clone or MOSS-TTS Voice Continue. That matters because MOSS obeys its duration hint almost precisely: same text with target_tokens 100, 200, 400 produces roughly 8, 16, 32 seconds of audio. So this node is how you make narration land inside an 8-second video slot, or keep every chapter of an audiobook at the same pace, instead of praying.

    How it works

    It's a deliberately rough heuristic. The node counts words (whitespace split), divides by your assumed speaking rate, converts to seconds, then multiplies by MOSS's fixed 12.5 audio frames per second:

    ceil(word_count / (wpm/60) * 12.5)
    

    For Chinese, Japanese, and Korean it counts non-whitespace characters instead and reads words_per_minute as characters-per-minute. The output is in frames - divide by 12.5 and you get seconds, which is a handy sanity check when a number looks absurd.

    The two inputs that matter

    • text - multiline, whatever you're about to synthesize.
    • words_per_minute - the only real knob. Default 150 = calm audiobook narration, 180 = conversational, 220 = fast. It's a FLOAT with a 60–400 range.

    Output: target_tokens (INT). Wire it straight into a Voice Clone / Voice Continue target_tokens input and you're done.

    Where the estimate drifts

    It assumes clean prose at a steady pace. Heavy punctuation, long compounds, or a deliberately dramatic slow read will push the real duration off - the node's own description admits the wpm assumption drifts. The fix is on purpose: the estimator has no built-in buffer, so you chain a ComfyUI math node after it. Multiply by 1.4 for slow and dramatic, by 0.75 for urgent. That's speech-rate control without fighting the instruction field, and it's cleaner than adjectives in a prompt. For punctuation-heavy text, add a fixed slack.

    Install & gotchas

    This is part of the MOSS-TTS 1.5 pack (eehrich/ComfyUI-MOSS-TTS-1.5). Install via ComfyUI Manager (search "MOSS-TTS 1.5") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/eehrich/ComfyUI-MOSS-TTS-1.5.git MOSS-TTS-ComfyUI
    

    Restart ComfyUI. This particular node needs no model and no download - it's pure math, so it works even before you've ever run the Load Model node. Empty text returns 0, which is harmless: a target_tokens of 0 tells the generator "you decide" (default EOS mode).

    That's the whole thing. Fifteen seconds to understand, and it's the difference between narration that fits your cut and narration you fight in the timeline.

    CategoryMOSS TTS 1.5

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGText to estimate. Word count via whitespace split for space-separated languages; for CJK (Chinese, Japanese, Korean) falls back to non-whitespace character count.
    words_per_minuteFLOAT15060–400Assumed speaking rate. Reference points: 150 wpm = calm audiobook narration, 180 wpm = conversational, 220 wpm = fast/rushed. For CJK this is interpreted as characters per minute. Need slack? Chain a math node after the output.

    Outputs (1)

    NameTypeDescription
    target_tokensINTEstimated MOSS 'tokens' hint. Wire into a Voice Clone / Voice Continue 'target_tokens' input. Divide by 12.5 to get seconds.