Skip to main content
This node loads a dataset of images and their corresponding text captions from a specified folder. It searches for image files and automatically looks for matching .txt files with the same base name to use as captions. The node also supports a specific folder structure where subfolders can be named with a number prefix (like 10_folder_name) to indicate that the images inside should be repeated multiple times in the output.

Inputs

ParameterDescriptionData TypeRequiredRange
folderThe folder to load images and text captions from. The available options are the subdirectories within ComfyUI’s input directory.COMBOYesDynamically loaded from folder_paths.get_input_subfolders()
Note: The node expects a specific file structure. For each image file (.png, .jpg, .jpeg, .webp), it will look for a .txt file with the same name to use as a caption. If a caption file is not found, an empty string is used. The node also supports a special structure where a subfolder’s name begins with a number and an underscore (e.g., 5_cats), which will cause all images inside that subfolder to be repeated that number of times in the final output list.

Outputs

Output NameDescriptionData Type
imagesA list of loaded image tensors.IMAGE
textsA list of text captions corresponding to each loaded image.STRING
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): c505d580b7bfb84ee71aca8fa98c847eeba531da9e578ddfe17818a2fd2ae5e8