Y7 Caption Saver
The boring node that finishes your captioning pipeline
Caption Saver is the end of the line for batch captioning: it takes a caption string and writes it to a .txt file next to the source image, using the same filename stem. cat.jpg becomes cat.txt in the same directory. That's the whole job, and it's the kind of node you don't appreciate until you've spent an afternoon saving captions by hand for a LoRA dataset.
It ships in the Y7Nodes pack, a collection the author cheerfully describes as "probably only useful to me." This node is the exception - if you train, you'll probably actually want it.
Why this node exists
Auto-captioning for training has settled into a pretty clear recipe. For LLM-encoder models - Flux, Flux.2 Klein, Z-Image, Qwen-Image - you want natural-language captions, and JoyCaption is the community favorite for generating them. But generating captions is only half the job. The other half is getting a matching .txt file into the right folder, which is where most homegrown pipelines quietly fall apart.
Caption Saver is designed to be the tail end of a specific three-node chain, all in this same pack:
- Y7 Image Batch Path loads a directory of images and hands you both the image tensors and their full file paths.
- Y7 JoyCaption (or any VLM that outputs a STRING - the docs explicitly call out Florence2, MiniCPM, LLaVA, Qwen-VL) generates the caption.
- Caption Saver writes it next to the source image.
The key insight is that the node needs the actual file path, not a folder - that's what makes it drop the caption in exactly the right place instead of dumping everything into one directory.
The inputs that matter
string- the caption text. Must be connected.image_path- the full path to the source image. Must be connected (this is where Image Batch Path'sIMAGE_PATHoutput comes in).overwrite- a boolean, default true. If true it clobbers any existing.txt. If false, it appends a counter instead -cat_01.txt,cat_02.txt- so you never nuke a caption you already wrote.
That overwrite toggle is the one to actually think about. If you're re-running a pipeline over a dataset you've partially hand-tuned, leave it off so your manual edits survive. If you're regenerating a fresh set, leave it on so stale captions don't linger.
It has no outputs - it's a terminal node, the final stop in the graph.
A captioning note worth keeping
The LoRA-training lore has one rule that applies directly here: describe what you want to remain adjustable, and leave what should be permanent undescribed. Auto-captioning tools like JoyCaption lean toward describing everything, so the captions you get are a starting point, not gospel - that's precisely why the overwrite switch matters, and why the node's counter behavior exists. Batch-caption, then go back and fix the ones that matter.
Installing it
It's one node in the Y7Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/yushan777/ComfyUI-Y7Nodes
cd ComfyUI-Y7Nodes
pip install -r requirements.txt
Then restart ComfyUI. Or install via ComfyUI Manager (search "Y7Nodes").
Verdict
Nothing flashy, but it closes a loop that's genuinely annoying to close any other way. The only trap is wiring - if string or image_path isn't connected, the node has nothing to write, and it'll fail loudly rather than silently, which is the right behavior. Pair it with Image Batch Path and JoyCaption and you have a working dataset-captioning rig in three nodes.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| string | STRING | — | |
| image_path | STRING | — | |
| overwrite | BOOLEAN | true | If false, appends a number to avoid overwriting existing files |
Outputs (0)
No outputs