Nodes/comfyui-videototext/πŸŽ™οΈ Build Transcript JSON
ComfyUI Node

πŸŽ™οΈ Build Transcript JSON

Turn a raw ASR string into a transcript JSON you can actually ship

By aadebugerΒ·Created 3 months agoΒ·Updated 3 months agoΒ· 0
πŸŽ™οΈ Build Transcript JSON
    • transcript_json
    β—„textβ€”β–Ί
    β—„audio_pathβ–Ί
    β—„duration_sec0.000β–Ί
    β—„model_nameMiMo-V2.5-ASRβ–Ί
    β—„tokenizer_nameMiMo-Audio-Tokenizerβ–Ί
    β—„languageAutoβ–Ί
    β—„source_video_pathβ–Ί

    Speech-to-text models hand you one thing: a plain string. Everything after that - saving it, searching it, feeding it to some downstream tool - wants structure. VTT_BuildTranscriptJSON is the node that adds the structure. You feed it the text coming out of MiMoASRTranscribe, optionally a bit of metadata about where that audio came from, and it emits a single STRING containing a JSON document in the pack's schema v2.0 format.

    The honest trade-off

    MiMo-V2.5-ASR returns plain text only. No word-level timestamps, no segment boundaries, no confidence scores - the README says so plainly. So schema v2.0 is deliberately thin: top-level text, source info, model info. It even dropped the segments[] array that the earlier v0.1.0 format carried. If your goal is time-aligned subtitles (SRT/VTT), this pack is the wrong tool - the author points you at a faster-whisper backend, or the planned v0.3.0 hybrid mode that pairs MiMo's text quality with whisper's alignment. But if your goal is "transcribe a two-hour lecture into a clean, searchable text file," this is exactly right. It's worth knowing which goal you have before you build the graph.

    How it works

    It wraps your text and metadata into this shape:

    {
      "schema_version": "2.0",
      "source": { "audio_path": "...", "duration_sec": 1834.5 },
      "model": { "name": "MiMo-V2.5-ASR", "tokenizer": "MiMo-Audio-Tokenizer", "language": "Auto" },
      "text": "δ½ ε₯½οΌŒδ»Šε€©ζˆ‘δ»¬θŠδΈ€δΈ‹β€¦"
    }
    

    It serializes with ensure_ascii=False and indent=2, which matters more than it sounds: the Chinese and code-switched Mandarin/English text the model produces stays readable instead of getting escaped into \uXXXX soup.

    Inputs and output

    • text (required) - the transcript string from MiMoASRTranscribe.
    • duration_sec - optional FLOAT. Feed it the duration_sec output from VTT_AudioFromPath and your JSON gets an accurate length instead of a 0.0.
    • language - Auto / Chinese / English, matching what you set on the transcribe node. Defaults to Auto.
    • model_name / tokenizer_name - metadata defaults that already match the MiMo stack; you'd only change them if you swapped ASR backends.
    • audio_path / source_video_path - optional provenance strings, mostly for your own records.

    Single output: transcript_json (STRING), wired straight into VTT_SaveTranscript.

    How to install it

    The fun thing here is that this node has no heavy dependencies of its own - it's pure Python stdlib (json). The entire install burden of this workflow lives upstream in the companion ComfyUI-MiMoASR pack: the 24 GB GPU, the MiMo-V2.5-ASR weights, the transformers==4.49.0 pin that breaks Sonic and Qwen3TTS. If you're already running MiMoASR, this node costs you nothing - same pack (ComfyUI-VideoToText, via ComfyUI Manager or git clone into custom_nodes/), same restart.

    Common issues

    Not much can break here - it's a formatter. The one sloppy failure mode is leaving duration_sec unwired, which quietly stamps 0.0 into every transcript. It's cosmetic, but if you're archiving these, wire the AudioFromPath duration in and your JSON is complete.

    CategoryπŸŽ™οΈ VideoToText

    Inputs (7)

    NameTypeDefaultDescription
    textSTRINGβ€”
    audio_pathoptSTRINGβ€”
    duration_secoptFLOAT0.000β€”
    model_nameoptSTRINGMiMo-V2.5-ASRβ€”
    tokenizer_nameoptSTRINGMiMo-Audio-Tokenizerβ€”
    languageoptCOMBOAuto3 options: Auto, Chinese, English
    source_video_pathoptSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    transcript_jsonSTRINGβ€”