Nodes/ComfyUI-ElevenLabs-Pro/ElevenLabs Pro - Subtitle Export (SRT/VTT)
ComfyUI Node

ElevenLabs Pro - Subtitle Export (SRT/VTT)

Caption a video straight from your transcript JSON

By IxMxAMAR·Created 5 months ago·Updated about a month ago· 1
ElevenLabs Pro - Subtitle Export (SRT/VTT)
    • subtitle_text
    timestamps_json
    formatsrt
    max_chars_per_cue42
    max_seconds_per_cue6.0

    Every video you generate eventually needs captions, and pasting JSON timestamps into a subtitle editor is nobody's idea of fun. ElevenLabsPro_SubtitleExport is the pack's local, free bridge: it takes the timing data the pack's other nodes produce - word-level alignment from Speech-to-Text, or character-level alignment from TTS-with-timestamps - and renders it into real SRT or VTT subtitle files, ready to paste into a text display and save.

    The one required input is timestamps_json, and the tooltip is the contract: it accepts the output of the STT node's words_json or the TTS timestamps node's alignment JSON. The node detects which shape it's looking at - a list of word objects, or a dict with character arrays - and groups them into subtitle cues accordingly. format picks SRT or VTT (SRT for near-universal player support, VTT for the web).

    Two knobs control how the cues get carved up:

    • max_chars_per_cue (default 42) - the reading-length ceiling per subtitle. 42 is a solid default; bump it for slower pacing.
    • max_seconds_per_cue (default 6) - how long any single cue can sit on screen. These two together are what keep captions from being either a wall of text or a blink-and-miss-it flash.

    Mechanically it's pure Python: parse the JSON, walk the characters/words, accumulate text until it hits the char or time ceiling, emit a new cue, and format timestamps in SRT's HH:MM:SS,mmm or VTT's dot-decimal style. No API call, no key, no credits, and it returns a single subtitle_text string you can send to a text display or save to a .srt file.

    The workflow it completes: generate narration with TTS → record/import the spoken take → transcribe with STT → feed words_json into this node → wire subtitle_text into a text display → copy out your .srt. Or the TTS-timestamps route, where you get captions aligned to the generated audio without any transcription step at all. Either way, you've gone from audio to captions without leaving the graph.

    Install is the pack standard:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IxMxAMAR/ComfyUI-ElevenLabs-Pro.git
    pip install -r ComfyUI-ElevenLabs-Pro/requirements.txt
    

    Restart ComfyUI, or install "ComfyUI-ElevenLabs-Pro" via ComfyUI Manager. Requirements are just requests and soundfile, and this node needs neither - it's pure string processing.

    Where people get tripped up: the JSON has to be the right shape. The node is deliberately strict - a malformed blob raises a clear "not valid JSON" error, and an unsupported shape raises an "expected TTSTimestamps alignment or STT words list" error rather than guessing. So if you're feeding it JSON from somewhere else, check the shape before you assume the node is broken. And remember it's a formatter, not a transcriber: it can't invent timing where none exists, so a transcript without word timestamps (STT with timestamps_granularity set to "none") has nothing to work with - feed it word-granularity output instead.

    CategoryElevenLabs Pro/Utils/Text

    Inputs (4)

    NameTypeDefaultDescription
    timestamps_jsonSTRINGOutput of TTSTimestamps or STT (words list).
    formatCOMBOsrt2 options: srt, vtt
    max_chars_per_cueoptINT4210–200
    max_seconds_per_cueoptFLOAT6.01–30

    Outputs (1)

    NameTypeDescription
    subtitle_textSTRING