MOSS 声纹跨分块关联 · T8star-Aix
Linking voices across chunks
- speaker_model
- audio
- transcript
- 声纹关联后的 MOSS_TRANSCRIPT
- 声纹关联报告 JSON
Transcribe anything longer than a couple of minutes with this pack and the "smart long audio" path slices it at silence boundaries, transcribes each chunk, and - by default - keeps each chunk's speakers isolated from every other chunk. So your final transcript has part001:S01, part002:S01, part003:S01, and absolutely no information about whether those three labels are one person or three. If you're producing a meeting transcript or a podcast where who-said-what matters across the whole file, that's a real problem. T8_MOSS_SpeakerEmbeddingLink is the pack's answer: it takes actual audio from each local speaker, extracts a WavLM X-Vector embedding from it, and links speakers across chunks by voice similarity.
The mechanism is straightforward and honest about what it can't do. For every local speaker label in your transcript, the node pulls that speaker's real audio spans (respecting min_speech_seconds and max_reference_seconds - a speaker with under a second of speech gets a thin embedding and knows it), runs the embedding model, then clusters the resulting vectors by cosine similarity against your similarity_threshold. One constraint is hard-coded and worth appreciating: it will never merge two different speakers from the same chunk, because those were separated by real diarization and are definitionally distinct people. Everything else is an auditable guess, and the node says so - its second output is a JSON report listing the links it made, the links it rejected, and any failures, all tagged wavlm_xvector_cosine.
What you actually wire in:
- speaker_model - the
T8_MOSS_SPEAKER_EMBEDDING_MODELhandle from the WavLM loader. If you haven't run that loader, this node refuses. - audio - the original audio, the same
AUDIOyou fed the transcription. It re-reads it to pull per-speaker spans. - transcript - the
T8_MOSS_TRANSCRIPTfrom the (possibly long-audio) transcription path. - similarity_threshold - the only setting you'll realistically tune. Default 0.86, range 0.5–0.99. Higher = fewer, safer merges; lower = more aggressive linking.
It outputs the linked transcript (same T8_MOSS_TRANSCRIPT type, so it flows straight into subtitle postprocessing or export) plus the link report JSON. In the pack's 30-minute, four-chunk benchmark, the default threshold produced 7 links with 0 failures - useful signal that the default is sane for clean speech.
Where people get burned: the threshold is recording-dependent, full stop. Clean studio audio can tolerate a high threshold; a noisy room with similar-sounding voices will either under-link (too high) or wrongly merge (too low). The pack's docs are refreshingly blunt that voice linking is not a substitute for human review on anything important. Also remember this node is only useful after the long-audio path - feed it a single-pass transcript and there are no cross-chunk links to make, just a report full of "nothing to do."
One thing that's easy to miss: this is a pipe-style consumer node in the same family as the context nodes you see everywhere in ComfyUI - it takes a typed object (T8_MOSS_TRANSCRIPT) down one wire, pushes back an enriched version of the same type down another. That's the whole trick of the pack: the transcript object travels the graph and every post-processing node fattens it up, so you can add word alignment, speaker linking, and quality gating without re-transcribing.
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. The WavLM model is pulled automatically on the linked loader's first run - no manual download. The example workflow 04_word_alignment_voice_link.json shows the full chain wired up if you'd rather start from something that already works.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| speaker_model | T8_MOSS_SPEAKER_EMBEDDING_MODEL | — | |
| audio | AUDIO | — | |
| transcript | T8_MOSS_TRANSCRIPT | — | |
| similarity_threshold | FLOAT | 0.860.5–0.99 | — |
| min_speech_seconds | FLOAT | 0.80.2–10 | — |
| max_reference_seconds | FLOAT | 201–120 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 声纹关联后的 MOSS_TRANSCRIPT | T8_MOSS_TRANSCRIPT | — |
| 声纹关联报告 JSON | STRING | — |