Save_Image_And_Caption
Image-plus-prompt pairs in one pass
- images
- file_path
- folder_path
Standard Save Image nodes write the PNG and bury your prompt in the file's metadata, where nothing can read it without a special viewer. This node writes the PNG and a plain-text .txt sidecar with your caption, every time. If you're collecting keeper images, or feeding a dataset to a caption-trained LoRA run, that sidecar is exactly what you want - and nothing else in the default node set does it.
What it is. Save_Image_And_Caption from the comfyui-snek-nodes pack saves each image in your batch as a PNG, and alongside it a .txt file containing the caption. The caption also gets embedded in the PNG metadata (along with the workflow prompt and any extra_pnginfo), so you get both worlds: a human-readable sidecar and the standard metadata. Each file gets a zero-padded counter so filenames never collide.
How it works. Before saving, it runs any [time(...)] tokens in the path and filename prefix - that's how the default output_path of [time(%Y-%m-%d)] becomes a dated folder like 2026-08-16. A relative output path is resolved under your ComfyUI output directory; an absolute path is used as-is and created if missing. Then it scans that folder for existing files matching prefix_delimiter<digits>, starts the counter one above the highest, and writes each image plus its .txt companion.
Inputs and outputs that matter.
images(IMAGE) - your batch. Every frame gets its own numbered PNG and caption.caption(STRING) - the text written to the sidecar and into the PNG metadata. Whatever you feed it - your positive prompt, a manual note, a re-caption from a VLM node - is what gets saved.output_path(STRING, default[time(%Y-%m-%d)]) - subfolder underoutput, or an absolute path if you want files elsewhere. Tokens supported.filename_prefix(STRING, defaultComfyUI) andfilename_delimiter(default_) - together they form the base of every filename, e.g.ComfyUI_00001.png.file_pathandfolder_path(STRING outputs) - the absolute path of the first saved image and of its folder. Wire these to a Show Text node, or into the SQLite logger in the same pack.
Installing it. It's in sneccc/comfyui-snek-nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/sneccc/comfyui-snek-nodes
or search "comfyui-snek-nodes" in ComfyUI Manager and restart. Pure file I/O, no model downloads, no heavy dependencies.
Where people get burned.
- The counter is per-folder and per-prefix. Change the prefix and the counter restarts from 1. Change the
output_path(say, a new date) and it restarts there too. That's usually what you want - the dated-folder default keeps every day self-contained - but it means "keep counting across runs" only works if you keep both the folder and the prefix constant. - Absolute paths escape your output folder. Intended if you want files on another drive, but a typo like a stray
:on Windows can land files somewhere surprising. If nothing appears where you expected, check whether youroutput_pathis being treated as absolute. - Sidecars only appear if the caption is set. An empty caption still produces a
.txt- it just contains nothing. For dataset work, make sure your caption source is actually connected before you batch out a thousand pairs.
Bottom line. It's a modest utility, but it fills a real gap: plain-text image/caption pairs with zero fuss and a sane auto-incrementing name scheme. If you build training sets or keep a running log of "image + what I asked for," this is the save node to reach for.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| caption | STRING | — | |
| output_path | STRING | [time(%Y-%m-%d)] | — |
| filename_prefix | STRING | ComfyUI | — |
| filename_delimiter | STRING | _ | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |
| folder_path | STRING | — |