DIGIT SRT Tools
Five subtitle-fixing actions in one node — your SRT cleanup drawer
- output_text
- output_filepath
- log
SRT files are text, which means the fixes you need are always the same handful of operations: clean up the timing, convert the format, shift everything, merge the spam, renumber the mess. DIGIT SRT Tools is that handful in a single node. Pick an action, feed it SRT text (or a file path), and it hands you the cleaned result - plus optionally saves it. It's the fix-it companion to SRT Preview (which tells you what's wrong) and the post-processor for anything that came out of SRT Maker or SRT From Video a little rough.
The actions
post_process- the full pipeline: hallucination removal → line-length enforcement → frame padding → snap-to-frame. Same cleanup the transcription nodes run automatically, now available on demand for SRTs from any source.convert_format- SRT to VTT, ASS/SSA, TXT, or all four. ASS output includes full styling (font, color, outline, shadow, position) using the styling inputs.time_offset- shift every timestamp bytime_offset_ms(positive = later, negative = earlier). The fix for "the edit changed and now every subtitle is 300ms late." Range is generous: ±600,000 ms.merge- combine adjacent entries whose gap is undermerge_gap_ms(default 500ms). Collapses the choppy one-word-per-line garbage into readable blocks.renumber- re-number all entries sequentially from 1, repairing gaps left by manual editing or merging.
The inputs
srt_input/srt_filepath- paste text or give a file path; the file wins if both are set.save_filepath- where to write the output. Leave it empty and you get the result as text only, no file touched - handy for a quick transform in the middle of a graph.time_offset_msandmerge_gap_ms- the two action-specific params above.- Then the post-processing inputs (
pad_frames,frame_rate,snap_to_frames,max_chars_per_line,max_lines,remove_hallucinations) and the styling inputs (font, color, outline, shadow, position) thatconvert_format's ASS output uses. Most are ignorable for most actions.
Outputs: output_text (the processed file), output_filepath (where it saved, if you set one), and log (a summary of what was done).
How it works and gotchas
It's pure Python text processing - no API, no credentials, works offline, deterministic. Note it also lists language and translate_to in its inputs; those only apply to the post-processing path that mirrors the transcription nodes, and translation is the one action that does reach out to Gemini, so if you're offline or haven't set up GCP, stick to the text actions.
One trap worth naming: renumber doesn't re-time anything, it just re-numbers, and merge only merges by gap, not by content - run merge after any timing shifts or the thresholds behave differently than you expect. Install is the same pack as everything else here (ComfyUI Manager, search comfyui-digit, restart), and like SRT Preview, no model files or keys needed for the core actions.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| srt_input | STRING | — | |
| action | COMBO | post_process | post_process: apply line-length, hallucination removal, padding, snap. convert_format: convert to VTT/ASS/TXT. time_offset: shift all timestamps. merge: merge adjacent entries with small gaps. renumber: re-number all entries sequentially. |
| srt_filepathopt | STRING | Path to an SRT file. If provided, overrides srt_input text. | |
| save_filepathopt | STRING | Path to save output. Leave empty to not save (output via text only). | |
| time_offset_msopt | INT | 0-600000–600000 | Milliseconds to shift all timestamps (positive = later, negative = earlier). Used with time_offset action. |
| merge_gap_msopt | INT | 5000–5000 | Merge adjacent subtitles with gaps smaller than this (ms). Used with merge action. |
| pad_framesopt | INT | 00–120 | Extend each subtitle by this many frames on both sides (head and tail). |
| frame_rateopt | FLOAT | 23.9761–120 | Frame rate of the video. Used for pad_frames and snap-to-frame. |
| snap_to_framesopt | BOOLEAN | false | Snap all timestamps to nearest frame boundary. Prevents subtitle flicker on frame-accurate systems. |
| max_chars_per_lineopt | INT | 420–80 | Max characters per subtitle line. 42 = Netflix/broadcast standard. 0 = no enforcement. |
| max_linesopt | INT | 21–4 | Max lines per subtitle entry. Entries exceeding this get split. |
| remove_hallucinationsopt | BOOLEAN | true | Detect and remove repeated/hallucinated subtitle entries. |
| output_formatopt | COMBO | srt | Output format(s). 'all' saves SRT + VTT + ASS + TXT. |
| languageopt | COMBO | auto | Language of the audio. 'auto' lets Gemini detect. Improves accuracy when specified. |
| translate_toopt | COMBO | none | Translate subtitles to this language after transcription. 'none' = no translation. |
| font_nameopt | STRING | Arial | Font family for burn-in subtitles. |
| font_sizeopt | INT | 248–120 | Font size for burn-in subtitles. |
| font_coloropt | COMBO | white | Subtitle text color. |
| outline_coloropt | COMBO | black | Subtitle outline/border color. |
| outline_widthopt | INT | 20–8 | Outline thickness around subtitle text. |
| shadow_depthopt | INT | 10–8 | Shadow depth behind subtitle text. |
| positionopt | COMBO | bottom_center | Where to place subtitles on screen. |
| margin_vopt | INT | 300–200 | Vertical margin from screen edge (pixels at 1080p). |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output_text | STRING | — |
| output_filepath | STRING | — |
| log | STRING | — |