SRT FILE Loader
The 15-line helper that feeds subtitles into FishSpeech
- SRT
LoadSRT is not where the magic happens - it's the utility that makes the magic possible. ComfyUI has no built-in subtitle type, so this pack defines its own SRT type, and LoadSRT is how you get a subtitle file into the graph. It lists every .srt and .txt file in your ComfyUI input folder, you pick one from a dropdown, and it hands a reference to that file to the FishSpeech nodes that know what to do with it.
You'll reach for it every time you use this pack. The two inference nodes both want an SRT: FishSpeech_INFER_SRT takes two of them (the script to speak and a transcript of the reference voice), and FishSpeech_INFER takes one through its deceptively named prompt_text_by_srt field. In all three places the thing you're wiring in is a LoadSRT output.
How it works
It's barely a node. On load it scans folder_paths.get_input_directory() (your ComfyUI/input folder) for files ending in .srt or .txt, sorts them, and offers them as a dropdown. Pick one and it resolves the full path and returns it. That's the entire job - the type is just a string path wearing a custom type's hat so the graph knows it's a subtitle, not a random file. The actual parsing happens later, inside the FishSpeech nodes, which read the file and pull out the cue timings and text with Python's srt library.
Using it
Drop your subtitle files into ComfyUI/input, and they show up in the dropdown. One gotcha: the file list is built when the node initializes, so if you add a new SRT after ComfyUI is already running, you may need to reload the node or restart before it appears. And the .txt option is a quiet lifesaver - if a transcript doesn't need timing, you can hand the node a plain text file and the downstream nodes still treat it as a single subtitle block. That's handy for the plain FishSpeech Inference node, where timing is irrelevant anyway.
Installing it
LoadSRT ships inside the ComfyUI-FishSpeech pack, so you don't install it on its own:
cd ComfyUI/custom_nodes
git clone https://github.com/AIFSH/ComfyUI-FishSpeech
cd ComfyUI-FishSpeech
pip install -r requirements.txt
Then restart ComfyUI. (ComfyUI Manager: search "ComfyUI-FishSpeech".) The pack also needs ffmpeg on your PATH, though that's for the audio side - LoadSRT itself is just file I/O.
If you're troubleshooting a connection error on a FishSpeech node, check this one first. Nine times out of ten the problem is that the SRT input is a LoadSRT output, not a text box - the plain FishSpeech node's prompt_text_by_srt field has a misleading default that isn't a real file, and people type prose into it and wonder why nothing runs. When in doubt, wire the file through LoadSRT.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| srt | COMBO | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SRT | SRT | — |