Nodes/TTS Audio Suite/๐Ÿ”ง SRT Advanced Options
ComfyUI Node

๐Ÿ”ง SRT Advanced Options

The readability rulebook behind clean, watchable subtitles

By diodiogodยทCreated about a year agoยทUpdated 22 days agoยท 1,098
๐Ÿ”ง SRT Advanced Options
    • srt_options
    โ—„srt_presetBroadcastโ–บ
    โ—„srt_modesmartโ–บ
    โ—„tts_ready_modefalseโ–บ
    โ—„tts_ready_paragraph_modefalseโ–บ
    โ—„heuristic_language_profileAutoโ–บ
    โ—„srt_max_chars_per_line42โ–บ
    โ—„srt_max_lines2โ–บ
    โ—„srt_max_duration6.0โ–บ
    โ—„srt_min_duration1.0โ–บ
    โ—„srt_min_gap0.6โ–บ
    โ—„srt_max_cps20.0โ–บ
    โ—„dedupe_overlapstrueโ–บ
    โ—„dedupe_window_ms1500โ–บ
    โ—„dedupe_min_words2โ–บ
    โ—„dedupe_overlap_ratio0.60โ–บ
    โ—„punctuation_grace_chars12โ–บ
    โ—„min_words_per_segment2โ–บ
    โ—„min_segment_seconds0.40โ–บ
    โ—„merge_trailing_punct_wordtrueโ–บ
    โ—„merge_trailing_punct_max_gap1.00โ–บ
    โ—„merge_leading_short_phrasetrueโ–บ
    โ—„merge_leading_short_max_words2โ–บ
    โ—„merge_leading_short_max_gap2.00โ–บ
    โ—„merge_dangling_tailtrueโ–บ
    โ—„merge_dangling_tail_max_words3โ–บ
    โ—„merge_dangling_tail_max_gap3.00โ–บ
    โ—„merge_dangling_tail_allowlista,an,the,to,of,and,or,im,i'm,you,you're,we,they,he,she,itโ–บ
    โ—„merge_leading_short_no_puncttrueโ–บ
    โ—„merge_leading_short_no_punct_max_words2โ–บ
    โ—„merge_leading_short_no_punct_max_gap1.50โ–บ
    โ—„merge_incomplete_sentencetrueโ–บ
    โ—„merge_incomplete_max_gap1.20โ–บ
    โ—„merge_incomplete_keywordswhat,why,how,where,who,which,whenโ–บ
    โ—„merge_incomplete_split_nexttrueโ–บ
    โ—„merge_allow_overlongtrueโ–บ
    โ—„normalize_cue_end_punctuationfalseโ–บ

    Auto-generated subtitles are usually either too long to read, flashing by too fast, or broken in awkward places. This node is the rulebook that stops that. It bundles all the subtitle-formatting rules - max characters per line, max reading speed, minimum duration, how to split and merge lines - into an SRT_OPTIONS package that the Text to SRT Builder reads when it constructs your cues. On its own it produces nothing; it's the settings, not the machine.

    If you just want good subtitles and don't care about the details, the good news is there's a srt_preset dropdown, and picking one is often the entire job.

    How it works

    Subtitle quality is really a pile of thresholds: how many characters fit comfortably on a line, how fast a viewer can read (characters per second), how short a cue can be before it flickers, when two fragments should merge into one cue. This node exposes all of them and hands the builder a resolved set. The builder then applies those rules whether it's timing from ASR data or estimating timings from plain text.

    The inputs and outputs that matter

    Start with the preset. The rest are for when a preset is almost right.

    • srt_preset - Netflix-Standard, Broadcast, Fast speech, Mobile, TTS-Ready, TTS-Ready (Paragraphs), or Custom. These are opinionated defaults for common targets. Netflix-Standard and Broadcast follow real captioning conventions; the TTS-Ready ones shape cues so they feed back into TTS cleanly. Pick the closest and you may be done.
    • srt_max_chars_per_line (default 42) - the classic subtitle line-length limit. 42 is the broadcast norm; lower it for mobile.
    • srt_max_cps (default 20) - max characters per second, i.e. reading speed. This is the knob that most affects whether subs feel rushed. Lower = more relaxed.
    • srt_max_lines (default 2), srt_max_duration (default 6s), srt_min_duration (default 1s), srt_min_gap (default 0.6s) - the shape and pacing of each cue.
    • srt_mode (smart / engine_segments / words) - how it decides split points. smart uses the readability heuristics; words splits at word timings; engine_segments trusts the source segmentation.
    • heuristic_language_profile (default Auto) - sets language-aware splitting rules so it breaks lines where the language naturally allows.

    There's also a long tail of merge_* and dedupe_* toggles for gluing dangling fragments and removing overlap duplicates. They're on by default and sensible; leave them unless you see a specific problem.

    The single output is srt_options (SRT_OPTIONS) - wire it into the Text to SRT Builder.

    How to install it

    Part of TTS Audio Suite. ComfyUI Manager: search TTS Audio Suite, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/diodiogod/TTS-Audio-Suite.git
    cd TTS-Audio-Suite
    python install.py
    

    then restart. On Linux, install portaudio19-dev and libsamplerate0-dev first. This node is pure configuration - no model, no download.

    Common issues & troubleshooting

    My subtitles fly by too fast. Lower srt_max_cps (20 โ†’ 15) so cues linger, and/or raise srt_min_duration. This is the most common complaint and the most direct fix.

    Lines are too long / wrap ugly. Drop srt_max_chars_per_line toward 37โ€“42 and confirm srt_max_lines is 2. The Mobile preset does this for you.

    Setting the options changed nothing. This node only takes effect when its output is wired into the Text to SRT Builder. If the builder's srt_options input is empty, it falls back to its own defaults and ignores everything you set here.

    It merged/split lines in places I didn't want. That's the merge_* heuristics. Switch srt_preset to Custom and turn off the specific merge rule that's misbehaving, rather than fighting it with the other knobs.

    CategoryTTS Audio Suite/๐Ÿ“บ Subtitles

    Inputs (36)

    NameTypeDefaultDescription
    srt_presetCOMBOBroadcastReadability preset for subtitle building. Choose a preset to seed the knobs below with recommended values, then edit them as needed. If you change a preset-derived knob, the UI will switch to Custom automatically. Examples: โ€ข Broadcast: conservative timing, safe desktop readability โ€ข Netflix-Standard: similar readability with longer max duration โ€ข Fast speech: denser subtitles for rapid speech โ€ข Mobile: shorter lines for smaller screens โ€ข TTS-Ready: single-line cues that stop by meaning instead of display wrapping โ€ข TTS-Ready (Paragraphs): same TTS-ready behavior, but tuned for longer paragraph-sized cues
    srt_modeCOMBOsmartHow subtitle cues are grouped before final display wrapping: โ€ข smart: rebuild cues from timed words using this node's gap, duration, CPS, and merge rules. Best default for final subtitles. โ€ข engine_segments: keep the incoming ASR/engine segments as the base chunks, then only split later for display if needed. Use this when the source segments are already good. โ€ข words: one timed word per cue. This is mainly for debugging alignment or inspecting bad timing data. Use smart for almost everything.
    tts_ready_modeBOOLEANfalseBuild cues for downstream TTS instead of on-screen subtitles. This disables multi-line display wrapping pressure, keeps each cue on one line, and prefers semantic stopping points over character-count stops.
    tts_ready_paragraph_modeBOOLEANfalseOnly used when TTS-ready is enabled. Prefer one cue per paragraph and only split if a paragraph is genuinely too long for clean TTS playback.
    heuristic_language_profileCOMBOAutoLanguage profile for heuristic defaults. Pick a language to seed the connector and incomplete-sentence lists. Auto uses the ASR timing language when one is available, then falls back to English. This is only a seed. You can still edit the text fields manually after selection.
    srt_max_chars_per_lineINT4210โ€“10000Maximum characters per subtitle line. Lower = shorter lines, more splits. Typical values: 32 mobile, 42 desktop/broadcast.
    srt_max_linesINT21โ€“3Maximum lines per subtitle cue. 2 is the normal default. 3 is denser but harder to read.
    srt_max_durationFLOAT6.00.2โ€“9999Maximum on-screen duration for a subtitle cue in seconds. Higher = fewer splits; too high feels laggy.
    srt_min_durationFLOAT1.00โ€“9999Minimum on-screen duration in seconds. Higher = fewer flash cues; lower = tighter sync.
    srt_min_gapFLOAT0.60โ€“9999Pause length that forces a new subtitle cue. Higher = more merging across short pauses.
    srt_max_cpsFLOAT20.00.1โ€“9999Maximum reading speed in characters per second. Lower = easier reading, more splits. Higher = denser subtitles.
    dedupe_overlapsBOOLEANtrueRemove overlapping duplicate phrases from bad word timing data. Useful for alignment glitches. Can also remove real repetitions like choruses.
    dedupe_window_msINT15000โ€“10000Time window used to detect overlapping duplicates in milliseconds. Higher = more aggressive dedupe.
    dedupe_min_wordsINT21โ€“10Minimum matching word count before a repeated phrase is considered a duplicate. Higher = safer.
    dedupe_overlap_ratioFLOAT0.600.1โ€“1Required timing overlap ratio before duplicate text is removed. Higher = stricter dedupe.
    punctuation_grace_charsINT120โ€“100Allow a sentence-ending punctuation mark to exceed the max line length by this many chars. Helps avoid ugly breaks right before punctuation.
    min_words_per_segmentINT21โ€“10Merge very tiny subtitle segments into neighbors. Higher = fewer one-word cues.
    min_segment_secondsFLOAT0.400โ€“5Merge subtitle cues shorter than this duration. Higher = fewer micro-cues.
    merge_trailing_punct_wordBOOLEANtrueKeep a trailing word with punctuation attached to the previous subtitle when possible. Fixes splits like "beautiful / world."
    merge_trailing_punct_max_gapFLOAT1.000โ€“5Maximum pause allowed when bridging that trailing punctuation word. Higher = more aggressive bridging.
    merge_leading_short_phraseBOOLEANtrueMerge a very short phrase into the previous cue when it follows punctuation. Fixes splits like "I'm a / riddle."
    merge_leading_short_max_wordsINT21โ€“6Maximum word count for that short leading phrase. Higher = more aggressive merging.
    merge_leading_short_max_gapFLOAT2.000โ€“5Maximum pause allowed when merging a short leading phrase. Higher = more merging across pauses.
    merge_dangling_tailBOOLEANtrueMerge a short dangling ending into the next subtitle when it ends on a connector word. Useful for incomplete fragments.
    merge_dangling_tail_max_wordsINT31โ€“8Maximum words allowed in that dangling ending. Higher = more aggressive merging.
    merge_dangling_tail_max_gapFLOAT3.000โ€“6Maximum pause allowed when merging a dangling tail. Higher = more aggressive merging.
    merge_dangling_tail_allowlistSTRINGa,an,the,to,of,and,or,im,i'm,you,you're,we,they,he,she,itComma-separated connector words treated as dangling tails. Example: a, the, to, of, and, I'm
    merge_leading_short_no_punctBOOLEANtrueMerge a very short follow-up into the previous subtitle even without punctuation. Useful for awkward mid-thought splits.
    merge_leading_short_no_punct_max_wordsINT21โ€“6Maximum words in that short follow-up. Higher = more aggressive merging.
    merge_leading_short_no_punct_max_gapFLOAT1.500โ€“5Maximum pause allowed when merging that follow-up. Higher = more aggressive merging.
    merge_incomplete_sentenceBOOLEANtrueMerge short continuations when the previous subtitle clearly looks incomplete. Useful for broken questions and sentence fragments.
    merge_incomplete_max_gapFLOAT1.200โ€“5Maximum pause allowed when merging an incomplete sentence. Higher = more aggressive merging.
    merge_incomplete_keywordsSTRINGwhat,why,how,where,who,which,whenComma-separated keywords that suggest the previous subtitle is incomplete. Example: what, why, how, where
    merge_incomplete_split_nextBOOLEANtrueIf the next subtitle contains multiple sentences, split it and only merge the first sentence. Helps keep merged subtitles readable.
    merge_allow_overlongBOOLEANtrueAllow merges even if the final subtitle exceeds max duration. Good for songs and slow speech. Disable for strict timing limits.
    normalize_cue_end_punctuationBOOLEANfalseOptional subtitle-style cleanup. When enabled, removes trailing commas, periods, semicolons, and colons at the visual end of a subtitle cue. If a cue is cleaned this way, the next cue start is uppercased to keep the subtitle flow visually coherent. Question marks, exclamation points, and ellipses are preserved. This is a style transform, not grammatical truth, so it stays disabled by default.

    Outputs (1)

    NameTypeDescription
    srt_optionsSRT_OPTIONSโ€”