Fat Mex Dataset Saver
Save straight into a LoRA-ready dataset folder
- images
- save_path
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 isimg. - Numbering is automatic: if you leave
start_indexat 0, it counts existing files with your prefix and continues from there, so re-running the batch appends instead of overwriting. Setstart_indexif you want to force a starting number. - Captions: put text in
captionand each image gets a matching<name>.txtwith 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, orwebpwith ajpg_qualitysetting 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
captionfield 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/, notmodels/. Your trainer usually wants a dataset path; you'll typically copy or point atComfyUI/output/datasets/<name>/. Knowing it's underoutput/datasetssaves you a confused ten minutes. jpg_qualityis ignored for PNG - that's by design (PNG is lossless), but people set it and wonder why nothing changes.- Caption is optional. If
captionis empty, no.txtfiles are written. A folder of unlabeled images is a folder of unlabeled images - decide whether you need captions before you burn a hundred generations.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Images to save to the dataset folder. | |
| dataset_name | STRING | my_dataset | Name of the dataset folder. |
| filename_prefix | STRING | img | Prefix for each image file. |
| captionopt | STRING | Caption/description. Saved as .txt alongside each image. | |
| output_formatopt | COMBO | png | Image format. |
| jpg_qualityopt | INT | 951–100 | JPEG/WebP quality (ignored for PNG). |
| start_indexopt | INT | 00–999999 | Starting index for file numbering. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| save_path | STRING | — |