SaveCaptionToTextFile
SaveCaptionToTextFile doesn't save a text file (read this before you wire it up)
- STRING
Let's get the important part out of the way: in the code that actually ships in this pack, SaveCaptionToTextFile does not save anything to disk. It has a text input and a filename input, but if you read the source, the filename is never used. The function just prints the caption to the ComfyUI console and passes the text straight through. So if you wired this up expecting .txt files to appear, you're not doing anything wrong - the node just isn't doing what its name promises.
So what is it for? Two genuinely useful things, once you know the truth:
- A console logger. It prints whatever text you feed it to the ComfyUI terminal, prefixed with
SaveCaptionToTextFile:. That's handy when you're debugging a caption workflow and don't want to build a whole display-node contraption just to see what the model returned. - A passthrough. It returns the text unchanged, so you can drop it into a graph to keep a caption flowing to wherever it needs to go without having to rewire. It's an identity node with a side effect, essentially.
Its inputs are exactly two: text (the string you want to keep in the graph / print) and filename (a string that is, in the shipped code, decorative). Its output is a STRING - the same text that went in.
What to do instead when you actually want files. If you're captioning a folder for dataset prep, OneVision Caption Folder in the same pack writes <image>.txt files itself as it goes - that's the real file-saver, and it's the node you want. If you're captioning one image at a time via LLaVA-OneVision Run and want the result saved, skip this node and use a text-save node from another pack, or let OneVision Caption Folder handle the batch. There's no per-file writer hiding in this pack beyond that one.
Why does the discrepancy exist? The pack is a small kijai side-project, and the README literally opens with "WORK IN PROGRESS." The author's focus was clearly the captioning loop in OneVisionCaptionFolder; this node looks like a stub that was named for the intended feature and never finished. That's not a reason to avoid the pack - the caption folder alone is worth the install - but it's a reason to check node behavior against its name before you build a workflow around it. A two-minute skim of a node's source beats an hour of wondering why your output folder is empty.
Install is the same as the rest of the pack: ComfyUI Manager → search "ComfyUI Llava-OneVision", or git clone https://github.com/kijai/ComfyUI-LLaVA-OneVision into custom_nodes and restart. There are no extra dependencies specific to this node beyond the pack's minimal requirements.txt (huggingface_hub, pillow, transformers>=4.57.0).
Bottom line: it's a thin node with a misleading name. Know that going in, use it as a passthrough or console logger if you like, and don't count on it for persistence. Your actual output file is the one OneVisionCaptionFolder wrote.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| filename | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |