Nodes/comfyui-timesaver/TS Silero Stress
ComfyUI Node

TS Silero Stress

The Russian text fixer that stops TTS from saying the wrong word

By AlexYez·Created 2 years ago·Updated about 22 hours ago· 12
TS Silero Stress
    • text
    text
    run_devicecpu
    stress_markerunicode
    use_accentortrue
    use_homosolvertrue
    put_stresstrue
    put_yotrue
    put_stress_homotrue
    put_yo_homotrue
    stress_single_voweltrue
    words_to_ignore

    Russian is a language where the pronunciation lives in the stress marks - and those aren't written down. за́мок is a castle, замо́к is a lock, and a text-to-speech engine that guesses wrong will happily read you the wrong word. TS Silero Stress is a one-input text preprocessor that fixes this: it places stress marks and restores ё (which Russian writing also mostly drops) so the TTS downstream pronounces things right. If you've ever had a Russian voiceover stumble over an ordinary sentence, this is the node that was missing.

    How it works

    It wraps the silero-stress library, which is actually two independent passes you can toggle:

    • use_accentor - a rule-based accentor that handles stress and ё placement for ordinary, non-homograph words.
    • use_homosolver - a neural disambiguation model for homographs, the words where stress actually changes meaning (that castle/lock problem). This is the expensive, smart pass.

    Each pass has its own put_stress / put_yo pair, so you can, say, restore ё but skip stress marks, or fix only the homographs. stress_single_vowel (on) even marks single-vowel words, which is pedantic but occasionally exactly what an educational worksheet wants. words_to_ignore takes a comma/newline list to skip completely - proper nouns you don't want mangled.

    The inputs that matter

    • text - your Russian text. That's the one you'll actually type.
    • run_device - cpu by default, which is right: this is a small model and CPU is instant. No need to burn GPU on it.
    • stress_marker - the output format: unicode (Unicode combining acute accents, the default, which renders cleanly anywhere) or Silero's plus sign notation. Pick unicode unless you're feeding it to something that specifically expects +.
    • The put_* / use_* toggles above.

    The single output is text - your input with stress marks and ё restored, ready to paste into TS Silero TTS, an SSML block, or a document.

    Install

    silero-stress is an optional dependency, deliberately outside the core requirements (the Silero packages can conflict with your ComfyUI torch version).

    cd ComfyUI/custom_nodes
    git clone https://github.com/AlexYez/comfyui-timesaver
    cd comfyui-timesaver
    python -m pip install -r requirements.txt
    python -m pip install silero-stress
    

    Weights land in models/silero-stress/ on first use. Skip the install and the node tells you what's missing from the startup log's optional-imports report.

    Common issues

    • "It left my homographs alone." That's use_homosolver being off, or the homosolver genuinely can't tell from context (it happens with truly ambiguous sentences). Check the toggle first.
    • "Output looks like za\\u0301mok garbage in my editor." Those are combining acute accents - the unicode marker. If your downstream tool doesn't render them, switch stress_marker to plus, or use the output only as a pronunciation hint for the TTS (which reads them fine).
    • "It marked my brand name." Add it to words_to_ignore.

    The honest scope: this is a preprocessor, not a TTS - it produces text, not sound. Chain it in front of TS Silero TTS and you get the full pipeline: correct Russian, pronounced correctly, on your machine, for free.

    CategoryTS/Text

    Inputs (11)

    NameTypeDefaultDescription
    textSTRINGRussian text for automatic stress and yo restoration.
    run_deviceCOMBOcpuExecution device for silero-stress.
    stress_markerCOMBOunicodeStress mark output format: Unicode combining acute or native Silero plus sign.
    use_accentorBOOLEANtrueRun the common accentor for non-homograph stress and yo placement.
    use_homosolverBOOLEANtrueRun the homograph disambiguation model.
    put_stressBOOLEANtruePlace stress marks in non-homograph words.
    put_yoBOOLEANtrueRestore letter yo in non-homograph words where needed.
    put_stress_homoBOOLEANtruePlace stress marks in homographs.
    put_yo_homoBOOLEANtrueRestore letter yo in homographs where needed.
    stress_single_vowelBOOLEANtruePlace stress marks even in words with a single vowel.
    words_to_ignoreSTRINGComma or newline separated words that should be skipped completely.

    Outputs (1)

    NameTypeDescription
    textSTRINGInput text with stress marks and yo restored.