Nodes/Comfyui-MOSS-Transcribe-Diarize-T8/MOSS 字幕导出 · T8star-Aix
ComfyUI Node

MOSS 字幕导出 · T8star-Aix

SRT/ASS/JSON out of the graph, with speaker names that line up

By T8mars·Created 25 days ago·Updated about 21 hours ago· 5
MOSS 字幕导出 · T8star-Aix
  • transcript
  • style
  • JSON 内容
  • TXT 内容
  • SRT 内容
  • ASS 内容
  • 导出文件路径 JSON
  • WebVTT 内容
  • RTTM 说话人标注
speaker_names_json{"S01": "主持人", "S02": "嘉宾"}
show_speakertrue
filename_prefixmoss_transcript
write_filestrue
chunk_id
cross_chunk_speaker_map_json{"part001:S01": "主持人", "part002:S02": "主持人"}

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_TRANSCRIPT from transcribe, smart-long-audio, validate, or the quality gate.
  • speaker_names_json - a rename map, defaulting to {"S01": "主持人", "S02": "嘉宾"}. S01 stays the stable ID in the JSON export, and speaker_name is 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 that S01 in chunk one and S02 in 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_SubtitleStyle object; 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_json and cross_chunk_speaker_map_json must 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_idempotent in 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.
CategoryT8star-Aix/Audio/MOSS Transcribe Diarize

Inputs (8)

NameTypeDefaultDescription
transcriptT8_MOSS_TRANSCRIPT
speaker_names_jsonSTRING{"S01": "主持人", "S02": "嘉宾"}
show_speakerBOOLEANtrue
filename_prefixSTRINGmoss_transcript
write_filesBOOLEANtrue
chunk_idSTRING
cross_chunk_speaker_map_jsonSTRING{"part001:S01": "主持人", "part002:S02": "主持人"}
styleoptT8_MOSS_SUBTITLE_STYLE

Outputs (7)

NameTypeDescription
JSON 内容STRING
TXT 内容STRING
SRT 内容STRING
ASS 内容STRING
导出文件路径 JSONSTRING
WebVTT 内容STRING
RTTM 说话人标注STRING