subtitles SRT to Text
Pull plain text and timestamps out of subtitle files
- texts
- timestamps
If you've got a .srt subtitle file and you want an LLM to summarize it, translate it, or answer questions about it, you don't want the raw file - numbered blocks, arrow-timestamps, and blank lines are just noise to a language model. srt2txt (labeled "subtitles SRT to Text" in the pack) strips an SRT down to what an LLM actually wants: the spoken text, plus the timing kept on the side if you need it.
It's a small converter node inside comfyui_LLM_party, the big ComfyUI pack for building LLM agent workflows - this one exists specifically for the video/streaming-adjacent use case the pack's README calls out: LLM plus TTS plus a media pipeline.
How it works
Give it a path to an SRT file and it parses the standard subtitle format - sequence number, timestamp range, text block, repeat - into two separate streams: the dialogue as one string, and the timing kept alongside it as its own value rather than thrown away.
The inputs and outputs that matter
srt_path- the only input, a file path (default placeholderexample.srt). No enable toggle, no options - this node does one thing.
Two outputs: texts (STRING) is the subtitle dialogue with the SRT scaffolding removed, ready to hand to an LLM node for summarizing or translating. timestamps (a TIMESTAMP type specific to this pack) rides alongside it, so if you need to cite when something was said - syncing a translated line back to the original timing, or having the LLM reference a moment in the video - that data isn't discarded.
How to install it
Search comfyui_LLM_party in ComfyUI Manager and install, or clone manually:
cd ComfyUI/custom_nodes
git clone https://github.com/heshengtao/comfyui_LLM_party.git
From inside that folder, run pip install -r requirements.txt using ComfyUI's own Python, then restart. This node itself needs nothing exotic - no model download, no API key - but it ships as part of a pack whose combined requirements.txt covers LLM clients, embeddings, OCR and TTS libraries, so the install step can take a while and occasionally trips over a version conflict with something else already in your environment. The pack's requirements_fixed.txt is there as a pinned-version fallback if that happens.
Common issues & troubleshooting
Parsing fails or comes back empty. SRT is a loosely-enforced format - a file exported by one tool can have a stray BOM character at the top, Windows line endings, or a missing blank line between blocks, and any of those can trip up a strict parser. If a file from one source works and another doesn't, that's usually the culprit; re-saving the file as plain UTF-8 text is the standard fix.
srt_path not found. This is a local file path, not a URL - if you're running ComfyUI on a remote GPU (a cloud/serverless setup rather than your own machine), the SRT has to actually be sitting on that machine's filesystem first. Upload it into the run's working directory before pointing this node at it.
You only need the text, not the timing. That's fine - timestamps is just an extra output, not a requirement. Leave it unwired if nothing downstream needs it; the node still runs and produces texts either way.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| srt_path | STRING | example.srt | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| texts | STRING | — |
| timestamps | TIMESTAMP | — |