Nodes/ComfyUI-WhisperX/SRT to String
ComfyUI Node

SRT to String

That subtitle file as plain text, for whatever the rest of your workflow wants

By AIFSH·Created 2 years ago·Updated about a year ago· 64
SRT to String
  • srt
  • STRING

SRT to String is the bridge node in the ComfyUI-WhisperX pack. The WhisperX node hands you a path to an .srt file, and this node turns that file into a plain STRING that the rest of your graph can actually use. Subtitles are nice on their own, but they get interesting when you can pipe them somewhere - into a text display, into a summary or LLM node, into anything downstream that eats strings.

It's a two-second node: one input, one output, no knobs, no models. The whole job is reading the file and handing the contents forward.

How it works

Nothing clever here, and that's fine. The node opens the .srt file with UTF-8 encoding, reads the whole thing, and returns it as a STRING. Because an SRT file is just plain text with cue numbers, timestamps, and the subtitle lines interleaved, what you get out is the raw file - timestamps and all, not a cleaned-up transcript.

One quirk worth knowing: the node's category is AIFSH_FishSpeech, which is clearly leftover copy-paste from the author's FishSpeech pack. Ignore it - the node lives in this pack, works exactly as advertised, and the category label doesn't change anything.

Inputs and outputs

  • srt - an SRT path, typically from the WhisperX node's ori_SRT or trans_SRT output.
  • Output: STRING - the full file contents as one string, UTF-8.

Wire that string into a text display node to eyeball the transcript, or into anything that wants text. If your goal is a clean transcript without the 1\n00:00:00,000 --> ... scaffolding, this node won't strip it for you - you'll want a text-processing or regex node downstream. If you just want to see the subtitles, PreView SRT is the friendlier stop.

Install

It ships with the pack, so there's nothing separate to install - if ComfyUI-WhisperX is in your custom nodes folder, this one is already there. The only failure mode worth mentioning: like the preview node, it reads a file, so the WhisperX node has to have run and written the .srt first. Wire it up, run the graph, and the text appears.

CategoryAIFSH_FishSpeech

Inputs (1)

NameTypeDefaultDescription
srtSRT

Outputs (1)

NameTypeDescription
STRINGSTRING