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

πŸŽ™οΈ Save Transcript JSON

The output node that makes sure your transcript actually lands on disk

By aadebugerΒ·Created 3 months agoΒ·Updated 3 months agoΒ· 0
πŸŽ™οΈ Save Transcript JSON
    • file_path
    β—„transcript_jsonβ€”β–Ί
    β—„filename_prefixtranscriptβ–Ί
    β—„include_timestamptrueβ–Ί
    β—„subfolderβ–Ί

    Every ASR pipeline ends in the same problem: the text you just spent real GPU time producing is sitting in a node's string output, one misplaced click away from being gone. VTT_SaveTranscript is the last node in this pack, and it exists to make sure that doesn't happen. It takes the transcript_json string from VTT_BuildTranscriptJSON, validates that it's actually JSON, and writes it to ComfyUI/output/ as a nicely formatted .json file - timestamped by default, so you never overwrite a previous run.

    How it works

    It's marked as an output node, which in ComfyUI-land means two practical things. First, ComfyUI treats it as a terminal node - the workflow's result - so the saved file shows up in the history/sidebar panel instead of vanishing into the void. Second, it returns the full path of the file it wrote, which is handy if a later step or a CLI wrapper needs to know where the transcript went.

    The mechanism is deliberately fail-fast. Before writing anything, it parses the incoming string with json.loads - if what you fed it isn't valid JSON, you get a clear ValueError instead of a corrupt file on disk. Then it sanitizes your filename bits (anything outside alphanumerics, dots, dashes, and underscores becomes an underscore), appends a YYYYMMDD_HHMMSS timestamp when include_timestamp is on, and writes with indent=2 and ensure_ascii=False so the Chinese text stays intact. The subfolder input lets you tuck transcripts into a subdirectory of output/ if you archive by project.

    Inputs and output

    • transcript_json (required) - wire this from VTT_BuildTranscriptJSON.
    • filename_prefix - defaults to transcript; set it to the lecture name and you get lecture_20260816_....json.
    • include_timestamp - on by default. Keep it on; turning it off means every run overwrites the same file, which is a reliable way to lose a transcript.
    • subfolder - optional, for organization.

    Output: file_path (STRING) - the absolute path of what you just wrote.

    How to install it

    This node is dependency-light too: ComfyUI's built-in folder_paths plus the stdlib, no torchaudio, no ffmpeg. If you've already got the pack loaded for the earlier nodes, this one just works. The real install story for this whole pipeline lives upstream - the ComfyUI-MiMoASR companion pack with its 24 GB VRAM requirement and the transformers==4.49.0 pin that breaks Sonic and Qwen3TTS. The README's advice is to run MiMo + VideoToText on a dedicated ComfyUI instance precisely because of that pin; on such a box, SaveTranscript is the quiet, reliable last step.

    cd ComfyUI/custom_nodes
    git clone https://github.com/aadebuger/ComfyUI-VideoToText.git
    # restart ComfyUI
    

    Common issues

    The one behavior that trips people is the timestamp: because it's on by default, every run writes a new file. That's the point - it's a transcript archive, not a scratch file - but if your output/ folder starts filling with transcript_*.json from test runs, this node is doing exactly what it says on the tin. rm the ones you don't need and move on. The other thing to remember is that garbage in means a hard error out: feed it a non-JSON string and it refuses to write rather than saving junk. That's a feature.

    CategoryπŸŽ™οΈ VideoToText

    Inputs (4)

    NameTypeDefaultDescription
    transcript_jsonSTRINGβ€”
    filename_prefixSTRINGtranscriptβ€”
    include_timestampoptBOOLEANtrueβ€”
    subfolderoptSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    file_pathSTRINGβ€”