Nodes/comfyui-snek-nodes/Save_Image_And_Caption
ComfyUI Node

Save_Image_And_Caption

Image-plus-prompt pairs in one pass

By sneccc·Created 2 years ago·Updated 12 months ago· 1
Save_Image_And_Caption
  • images
  • file_path
  • folder_path
caption
output_path[time(%Y-%m-%d)]
filename_prefixComfyUI
filename_delimiter_

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 under output, or an absolute path if you want files elsewhere. Tokens supported.
  • filename_prefix (STRING, default ComfyUI) and filename_delimiter (default _) - together they form the base of every filename, e.g. ComfyUI_00001.png.
  • file_path and folder_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 your output_path is 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.

Category🐍 Snek Nodes

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
captionSTRING
output_pathSTRING[time(%Y-%m-%d)]
filename_prefixSTRINGComfyUI
filename_delimiterSTRING_

Outputs (2)

NameTypeDescription
file_pathSTRING
folder_pathSTRING