Nodes/Fat Mex Nodes/Fat Mex Dataset Saver
ComfyUI Node

Fat Mex Dataset Saver

Save straight into a LoRA-ready dataset folder

By FatMex·Created 7 months ago·Updated 7 months ago· 3
Fat Mex Dataset Saver
  • images
  • save_path
dataset_namemy_dataset
filename_prefiximg
caption
output_formatpng
jpg_quality95
start_index0

If you've ever built a training dataset by hand - generating a hundred images, renaming them 001.png, 002.png, writing captions - you know how quickly that turns into a chore. This node does it as a side effect of generation: images land in a structured dataset folder with sequential filenames and an optional caption .txt next to each one. Same job as SaveImage + manual folder management, minus the manual part.

It fits the pack's stated goal (it ships a "pro influencer dataset" workflow), but honestly it's the most generally useful node here if you train LoRAs at all. ai-toolkit, OneTrainer, kohya - they all want the same thing: a folder of images plus a text file per image describing it. This produces exactly that shape.

How it works

  • Images are saved to ComfyUI/output/datasets/<dataset_name>/ - a subfolder of ComfyUI's normal output, so your training set never mixes with your generation dump.
  • Filenames are <filename_prefix>_00000.png (zero-padded to five digits), incrementing per batch. Default prefix is img.
  • Numbering is automatic: if you leave start_index at 0, it counts existing files with your prefix and continues from there, so re-running the batch appends instead of overwriting. Set start_index if you want to force a starting number.
  • Captions: put text in caption and each image gets a matching <name>.txt with that text. One caption applies to the whole batch - per-image captions still mean running the node per caption, which is a real limitation to know about.
  • Formats: png (default, and the one that embeds the ComfyUI prompt/workflow metadata), jpg, or webp with a jpg_quality setting for the lossy ones.

Output is a single save_path STRING - the folder you just wrote to - which you can feed to a text display node or use downstream.

The caption strategy that matters

The KB's LoRA training doc is blunt: dataset curation beats every other knob, and the caption is where you decide what stays fixed. Describe what should vary; leave what should be fixed undescribed. If you're training an outfit LoRA, caption the scene and pose but not the outfit. This node just writes the file - the captioning strategy is on you, and it's the difference between a LoRA that works and one that quietly overfits.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/FatMex/ComfyUI-FatMex-Nodes.git FatMex-Nodes
pip install -r FatMex-Nodes/requirements.txt

Or ComfyUI Manager → search "Fat Mex Nodes" → Install → restart. No extra models.

Where people get burned

  • One caption per batch. The caption field applies to every image in the run. Generating a varied dataset with unique captions means running this per prompt, or pairing it with a per-image captioning pass afterward. Don't expect per-image captions out of the box.
  • It saves to output/, not models/. Your trainer usually wants a dataset path; you'll typically copy or point at ComfyUI/output/datasets/<name>/. Knowing it's under output/datasets saves you a confused ten minutes.
  • jpg_quality is ignored for PNG - that's by design (PNG is lossless), but people set it and wonder why nothing changes.
  • Caption is optional. If caption is empty, no .txt files are written. A folder of unlabeled images is a folder of unlabeled images - decide whether you need captions before you burn a hundred generations.
CategoryFat Mex

Inputs (7)

NameTypeDefaultDescription
imagesIMAGEImages to save to the dataset folder.
dataset_nameSTRINGmy_datasetName of the dataset folder.
filename_prefixSTRINGimgPrefix for each image file.
captionoptSTRINGCaption/description. Saved as .txt alongside each image.
output_formatoptCOMBOpngImage format.
jpg_qualityoptINT951–100JPEG/WebP quality (ignored for PNG).
start_indexoptINT00–999999Starting index for file numbering.

Outputs (1)

NameTypeDescription
save_pathSTRING