> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# SaveImageTextDataSetToFolder - ComfyUI Built-in Node Documentation

> Save Image-Text (to Folder) saves a dataset of image and text caption pairs to a folder inside ComfyUI's output directory.

Save Image-Text (to Folder) saves a dataset of image and text caption pairs to a folder inside ComfyUI's output directory. Each image is written as a PNG file, and its matching caption is written as a TXT file with the same base filename, so every image ends up paired with its description.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `images` | List of images to save. | IMAGE | Yes | - |
| `texts` | List of text captions to save. This input is optional. | STRING | No | - |
| `folder_name` | Name of the folder to save images to (inside output directory). (default: "dataset") | STRING | Yes | - |
| `filename_prefix` | Prefix for saved image filenames. (default: "image") | STRING | Yes | - |
| `mode` | Whether to overwrite existing files or increment filenames to avoid overwriting. (default: "overwrite") | COMBO | Yes | "overwrite"<br />"increment" |

**Note:** The `images` input is a list, and the node receives both `images` and `texts` as lists. The `texts` input is optional; if provided, it should be a list of text captions and should contain the same number of items as `images`. Each caption is saved as a `.txt` file corresponding to its paired image. In `overwrite` mode, files are named `{filename_prefix}_{index}.png` and replace any existing files with the same name. In `increment` mode, a unique counter is added to the filenames so existing files are not overwritten. The `folder_name` must resolve to a path inside the output directory; folder names that try to escape it (for example with `..`) are rejected.

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| - | This node returns no data. It saves files directly to the filesystem. | - |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/SaveImageTextDataSetToFolder/en.md)

***

**Source fingerprint (SHA-256):** `46c5a04ba1befedf62b75abbff2442dde934048f365fa7e2604ea37e70d8fdcb`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.