Nodes/ComfyUI-Kimi-VL/Save Kimi VL Text
ComfyUI Node

Save Kimi VL Text

Where the model's answer actually goes

By Yuan-ManX·Created about a year ago·Updated about a year ago· 1
Save Kimi VL Text
    • STRING
    response
    save_path./output_kimi.txt
    print_to_console

    The last node in the ComfyUI-Kimi-VL chain, and the one that makes the whole thing useful. Kimi VL hands you a STRING with the model's answer, but a string floating in a graph is nothing - it evaporates when the workflow ends. Save Kimi VL Text writes that answer to disk, optionally prints it to the console, and passes it through untouched so the rest of your workflow can keep using it.

    What it does

    Three inputs:

    • response - the STRING from the Kimi VL node's response output. This is the thing being saved.
    • save_path - where to write it, default ./output_kimi.txt. Relative paths resolve against the directory you launched ComfyUI from, not the pack's folder.
    • print_to_console - a disable/enable toggle. Flip it to enable and the node dumps the answer into ComfyUI's console output with a [Kimi-VL] prefix, plus a line saying where it saved. Handy for quick debugging before you bother pointing it at a real file.

    It writes the file as UTF-8 (open(save_path, "w", encoding="utf-8")), which matters - vision model answers can include characters that plain ASCII writes mangle. The output, also named STRING, is the same response passed straight through, so you can chain Save Kimi VL Text into a text-reuse node or another model without losing the value.

    Why you'd reach for it

    ComfyUI's built-in Preview Text node shows you a string, but it doesn't persist it. If you want the caption Kimi VL generated to actually live somewhere - a file you can feed into a LoRA training run, a tag list for a dataset, a log of what the model said about a batch of frames - you need a save node, and this is the pack's one. The passthrough is the quiet winner: you can save the answer and keep using it in the same graph.

    Gotchas

    • It overwrites without asking. Same filename twice, and the second run silently clobbers the first. If you're batch-processing images with a fixed save_path, you'll end up with one file, not fifty - give each run a unique path or accept that you're writing over it.
    • No directory creation. If save_path points into a folder that doesn't exist, the write raises an error. Create the folder first.
    • It doesn't append. It's "w", not "a". That's the same overwrite behavior as above, but worth saying plainly: this node saves the latest answer, not a log.

    For a node that's essentially f.write(response), that's the whole story. It's thin, it's honest, and it does the one job the Kimi VL pack needs at the end of the line.

    Installing it

    Same pack, same steps as the rest: ComfyUI Manager → search "Kimi" → install, or

    cd ComfyUI/custom_nodes
    git clone https://github.com/Yuan-ManX/ComfyUI-Kimi-VL.git
    cd ComfyUI-Kimi-VL
    pip install -r requirements.txt
    

    then restart ComfyUI.

    CategoryKimi-VL

    Inputs (3)

    NameTypeDefaultDescription
    responseSTRING
    save_pathSTRING./output_kimi.txt
    print_to_consoleCOMBO2 options: disable, enable

    Outputs (1)

    NameTypeDescription
    STRINGSTRING