Subtitle Source (字幕输入源)
Feed it an SRT, a CSV, or a sticky note — it always spits out the same subtitle data
- subtitle_data
- preview
Every subtitle workflow in ComfyUI has the same boring first step: getting your words into something a renderer can use. If you've poked around the subreddit, you know the well-trodden path is transcription - WhisperSRT and friends turn speech into an .srt - and then everybody shrugs about what to do with that file. SubtitleSource is the part that connects the two. It's the input node for the ComfyUI-Subtitle-Effects pack, and its whole job is to take subtitles in whatever shape they're in and hand back a single structured SUBTITLE_DATA that every animated-subtitle node in the pack understands.
It's a plumbing node in the best sense - one input, five formats, one output - and once you've met it you'll use it in every workflow the pack touches.
What it actually does
The node parses subtitles and packs them into a custom SUBTITLE_DATA type: a list of entries (each with a start, an end, and text) plus the fps you gave it, so downstream nodes know which frame a subtitle belongs to. That's the whole trick. Because the effect nodes accept the same type, you can parse once and wire the result into several renderers, or shove a SubtitleTextReplace node in the middle and edit before anything touches pixels.
It auto-detects five formats, so usually you don't even have to think:
- SRT - the standard
1\n00:00:01,000 --> 00:00:03,000\nTextblock format - Bracket timeline -
(0.0, 1.5) First line, handy for quick manual entry - JSON -
[{"start": 0.0, "end": 1.5, "text": "..."}] - CSV -
start,end,textcolumns - Plain text - one line per subtitle, timed for you automatically
The format dropdown defaults to auto and sniffs which one you pasted. If you set it to auto and point it at a file, it'll read the file and detect from the contents.
The inputs that matter
You've got three required inputs: format, fps, and text. Set fps to match your frame sequence - it drives the frame math for every entry, and mismatches are the classic way subtitles drift.
Two optional inputs earn their keep:
srt_path- a path to a subtitle file. If it's set and the file exists, it wins over thetextbox. Handy when you're batch-processing folders or your subtitles came from Whisper.duration_per_line- for plain text with no timestamps: each line gets this many seconds (default 3). There's alsototal_duration; if you set it, the lines are evenly spread across the whole clip instead.
The two outputs are subtitle_data (the SUBTITLE_DATA you wire into effect nodes) and preview - a plain-text bracket-format rendering of what got parsed, which you can feed into a text display node to eyeball without rendering.
Install
It ships as part of one pack with all the other subtitle nodes, so there's nothing special here:
cd ComfyUI/custom_nodes
git clone https://github.com/liaowu-boos/ComfyUI-Subtitle-Effects.git
cd ComfyUI-Subtitle-Effects
pip install "Pillow>=9.0.0" "jieba>=0.42"
Or use ComfyUI Manager and search for liaowu-boos/ComfyUI-Subtitle-Effects. Restart ComfyUI and you'll find everything under the Subtitle Effects category. The renderer runs on CPU via Pillow - zero VRAM - and no model files are downloaded for this node. hanlp>=2.1 is in the manifest but only the podcast scroller needs it, and it degrades gracefully if missing.
Common issues
- File isn't reading. The node tries
utf-8,utf-8-sig,gbk, andgb2312in turn, so Chinese-language SRTs saved in GBK usually just work. If your file still comes back empty, make sure the path is absolute and the file actually exists - a typo'd path silently falls back to the text box. - Subtitles appear at the wrong time. Almost always an
fpsmismatch between this node and your renderer. Keep them in sync. - Blank
preview. Means nothing parsed - checkformatif you're pasting something exotic, and remembersrt_pathoverridestextentirely when both are set.
One honest note: this pack is young and small, so don't expect a crowd of prebuilt workflows to copy. The upside is the pieces are simple enough that the pipeline above is the whole tutorial.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| format | COMBO | auto | 6 options: auto, srt, bracket, json, csv, plain |
| fps | FLOAT | 30.001–120 | — |
| text | STRING | — | |
| srt_pathopt | STRING | — | |
| total_durationopt | FLOAT | 0.00–36000 | — |
| duration_per_lineopt | FLOAT | 3.00.5–30 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| subtitle_data | SUBTITLE_DATA | — |
| preview | STRING | — |