MOSS 字幕后处理 · T8star-Aix
Turn raw MOSS segments into subtitles a human can actually read
- transcript
- 后处理 MOSS_TRANSCRIPT
- 字幕后处理报告 JSON
Raw transcription output is not subtitles. MOSS will hand you a transcript where one segment blazes past in half a second, the next lingers on screen for nine, and a single cue carries a 40-character wall of text. If you fed that straight to an export node you'd get technically-valid SRT that nobody can read. T8_MOSS_SubtitlePostprocess is the clean-up pass: it merges, splits, and line-wraps cues to fit sane subtitle conventions, then tells you - with a reading-speed report - exactly where the output is still too fast to follow.
The design constraint that separates this node from a generic text-reflow tool: it will not expand the original total time range. A segment that starts at 12.4s and ends at 18.1s will still span 12.4 to 18.1 when it comes out, no matter how the cue boundaries move. That means it can't "fix" an audio file that genuinely rushes through words - what it does is fit the text into the time that actually exists.
Here are the knobs, and honestly only a few of them matter for most people:
- min_duration / max_duration (default 1.0 / 6.0) - the acceptable cue length window. Shorter cues get merged with neighbors (when the same speaker and a
merge_gapof 0.3s or less separates them); longer ones get split. - max_chars_per_line (24) and max_lines (2) - the classic subtitle shape: at most two lines of at most 24 characters. This is the thing that actually makes output readable, and 24×2 is a fine starting point for CJK and Latin alike.
- max_chars_per_second (20, and 0 disables the check) - the reading-speed ceiling. It doesn't rewrite anything; it measures each processed cue and reports violations.
Feed it a T8_MOSS_TRANSCRIPT and you get back the processed transcript (same type, so it flows straight into the style/export nodes) plus a postprocess report JSON with source vs. output segment counts, the settings you used, and a readability breakdown - including the number of cues that exceeded your CPS ceiling. Those violations also land as a subtitle_reading_speed warning on the transcript's diagnostics, so a quality gate downstream can catch them even if you forget to look at the report.
The one hard rule it enforces: min_duration can't exceed max_duration - set them backwards and you get a clear error, which is the pack's style (it would rather yell than silently produce garbage).
Where people get burned: the default 20 CPS ceiling is tuned for typical subtitle reading speed, but it's a blunt instrument. A burst of short English words can trip it while long polysyllabic words wouldn't; dense CJK text has different norms than Latin. Don't treat a violation as a bug - treat it as a flag that you should either shorten the subtitle or accept that viewers will pause. And if you want forced line breaks exactly where you want them, this node isn't that - it wraps by character count, so anything more art-directed belongs in the export/styling side of the pack.
It's also the quiet workhorse of the pack: the basic example workflow includes it by default, because the author knows raw segments aren't ready for prime time. Wire it in after transcription (and after word alignment or speaker linking, if you use those - it operates on the same enriched transcript object, which keeps riding down the wire), and you've turned a dump of segments into something you'd actually ship.
Installing the pack
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-MOSS-Transcribe-Diarize-T8.git comfyui-MOSS-Transcribe-Diarize-T8
In the ComfyUI Python environment (..\..\python_embeded\python.exe on Windows Portable): pip install -r requirements.txt, run scripts/check_transformers.py (needs Transformers >= 5.5.0, < 6), restart. ComfyUI Manager users: search comfyui-moss-transcribe-diarize-t8. This node needs no model of its own - it's pure text processing, so if you're testing the pack's subtitling chain, this is the cheapest node to experiment with after you've got a transcript.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| transcript | T8_MOSS_TRANSCRIPT | — | |
| min_duration | FLOAT | 1.000.05–20 | — |
| max_duration | FLOAT | 6.00.1–60 | — |
| max_chars_per_line | INT | 244–200 | — |
| max_lines | INT | 21–4 | — |
| merge_gap | FLOAT | 0.300–5 | — |
| max_chars_per_second | FLOAT | 20.00–100 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 后处理 MOSS_TRANSCRIPT | T8_MOSS_TRANSCRIPT | — |
| 字幕后处理报告 JSON | STRING | — |