MOSS 字幕导出 · T8star-Aix
SRT/ASS/JSON out of the graph, with speaker names that line up
- transcript
- style
- JSON 内容
- TXT 内容
- SRT 内容
- ASS 内容
- 导出文件路径 JSON
- WebVTT 内容
- RTTM 说话人标注
Every transcription workflow ends the same way: you want a file you can burn in, drop in an editor, or hand to someone. T8_MOSS_SubtitleExport is the pack's final node - the one that turns a MOSS_TRANSCRIPT into JSON, TXT, SRT, and ASS, and optionally writes them to disk. It's an output node, so it sits at the end of the graph and produces nothing for other nodes to consume except the text it hands back.
Where it earns its keep is speaker naming. The model gives you anonymous S01, S02 labels. This node is where you turn those into "主持人" (host), "嘉宾" (guest), or whatever your cast actually is - and where long-audio's per-chunk namespaces finally get reconciled.
The inputs that matter
- transcript - the
MOSS_TRANSCRIPTfrom transcribe, smart-long-audio, validate, or the quality gate. - speaker_names_json - a rename map, defaulting to
{"S01": "主持人", "S02": "嘉宾"}.S01stays the stable ID in the JSON export, andspeaker_nameis added when a rename is configured. So you get"speaker": "S01", "speaker_name": "主持人"- traceable, not lost. - cross_chunk_speaker_map_json - the advanced input that fixes long audio's one real weakness. Keys are
"实际分片 ID:局部说话人编号", e.g.{"part001:S01": "主持人", "part002:S02": "主持人"}. This is how you tell the exporter thatS01in chunk one andS02in chunk two are the same human. Without it, those stay separate labels - by design, since the model can't know. - show_speaker - prefixes speaker names in TXT/SRT/ASS. Affects all three formats, not just one.
- filename_prefix - base name for written files.
- write_files - on by default, writing to
ComfyUI/output/moss_transcribe_diarize/. Turn it off if you only want the strings. - chunk_id - advanced; scopes the cross-chunk mapping to a specific chunk when you're exporting per-chunk.
- style - optional
T8_MOSS_SubtitleStyleobject; gives the ASS output real styling (fonts, colors, layout) instead of defaults.
Outputs: JSON 内容, TXT 内容, SRT 内容, ASS 内容 strings, plus 导出文件路径 JSON listing exactly where files landed.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-MOSS-Transcribe-Diarize-T8.git comfyui-MOSS-Transcribe-Diarize-T8
cd comfyui-MOSS-Transcribe-Diarize-T8
pip install -r requirements.txt
python scripts/check_transformers.py # requires Transformers >= 5.5.0
python scripts/download_models.py --comfyui-root ..\..
Restart, then load example_workflows/ui/01_basic_transcribe.json to see it wired in.
Gotchas
- SRT and ASS are written with a UTF-8 BOM (
utf-8-sig). Some players and editing tools misdetect encoding without it, so the BOM is a feature - but if your downstream tool chokes on a BOM, that's what you're seeing. - Malformed rename JSON errors out.
speaker_names_jsonandcross_chunk_speaker_map_jsonmust be valid JSON objects; a typo throws a clear error rather than silently exporting wrong names. It's strict on purpose. - The cross-chunk map keys are exact.
part001:S01- that's the chunk ID the long-audio node actually produced, plus the local speaker label. Copy the keys from the chunk report JSON (T8_MOSS_SmartLongAudio's last output) rather than guessing the chunk naming. - Not idempotent, but safe. Because it can write files, it's marked
not_idempotentin the schema - it won't be skipped as an unchanged node. If you re-run, it writes a new uniquely-suffixed file rather than silently overwriting your existing export.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| transcript | T8_MOSS_TRANSCRIPT | — | |
| speaker_names_json | STRING | {"S01": "主持人", "S02": "嘉宾"} | — |
| show_speaker | BOOLEAN | true | — |
| filename_prefix | STRING | moss_transcript | — |
| write_files | BOOLEAN | true | — |
| chunk_id | STRING | — | |
| cross_chunk_speaker_map_json | STRING | {"part001:S01": "主持人", "part002:S02": "主持人"} | — |
| styleopt | T8_MOSS_SUBTITLE_STYLE | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| JSON 内容 | STRING | — |
| TXT 内容 | STRING | — |
| SRT 内容 | STRING | — |
| ASS 内容 | STRING | — |
| 导出文件路径 JSON | STRING | — |
| WebVTT 内容 | STRING | — |
| RTTM 说话人标注 | STRING | — |