Skip to main content
Save Image-Text (to Folder) saves a list of images and their matching text captions to a specified folder inside ComfyUI’s output directory. For each image saved as a PNG file, a matching TXT file with the same base name is created to store its caption, which makes it useful for creating organized datasets of generated images paired with their descriptions.

Inputs

Note: The images input is a list. 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

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub

Source fingerprint (SHA-256): 46c5a04ba1befedf62b75abbff2442dde934048f365fa7e2604ea37e70d8fdcb