Nodes/ComfyUI_Fill-Nodes/FL Image Caption Saver
ComfyUI Node

FL Image Caption Saver

Dump a batch to disk with matching caption files

By filliptm·Created 3 years ago·Updated about 18 hours ago· 628
FL Image Caption Saver
  • images
  • STRING
folder_nameoutput_folder
caption_textYour caption here
overwritetrue

If you've ever generated a batch of images in ComfyUI and then had to manually save each one and hand-type a matching .txt caption file next to it for a LoRA training set, FL_ImageCaptionSaver is the node that ends that chore. Point it at a folder, hand it a batch, give it a caption, and it writes every image out to disk with a caption file alongside each one - the exact image.png + image.txt layout most fine-tuning trainers expect to ingest.

What it does, plainly. Take images - a batch tensor, however many you generated - and folder_name (default output_folder), and it converts each image to a file and writes it into that folder. caption_text (default "Your caption here") gets written to a matching .txt file per image, with special characters sanitized out before it's saved. overwrite (default on) controls whether it clobbers existing files at that path or generates unique filenames instead so nothing gets silently replaced.

One thing worth being explicit about, since it's easy to assume otherwise: caption_text is a single string applied to the whole batch, not a separate caption per image. If you generated ten variations and want ten different captions, this isn't the node for that - the pack ships a more advanced sibling, FL_CaptionSaver_V2, that supports either a single caption or a list of per-image captions plus mask-saving and downsize options. FL_ImageCaptionSaver is the simple, one-caption-for-the-batch version, and honestly that covers a lot of real use - batches where every image is the same subject/pose/style and only the reference differs.

The single STRING output (it's an output node, so this prints on the node itself) reports back what it did - useful as a quick confirmation without having to go check the filesystem.

Installing it follows the pack's standard pattern: search "Fill-Nodes" in ComfyUI Manager, or clone it directly -

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
  • then restart ComfyUI. No extra dependencies beyond PIL and standard tensor handling, which the pack already needs everywhere.

Where to watch your step. The sanitization is aggressive by design - it's stripping special characters so your caption doesn't break the saved text file - so if your caption text relies on unusual punctuation, quotation marks, or symbols, don't be surprised if the saved .txt looks slightly different from what you typed. It's not corrupting your data, it's just cleaning it. Beyond that, the biggest trap is reaching for this node when you actually need per-image captions: if you catch yourself wishing you could vary the text across the batch, that's your cue to switch to FL_CaptionSaver_V2 instead of fighting this simpler node into doing something it's not built for.

Category🏵️Fill Nodes/Captioning

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
folder_nameSTRINGoutput_folder
caption_textSTRINGYour caption here
overwriteBOOLEANtrue

Outputs (1)

NameTypeDescription
STRINGSTRING