Skip to main content
This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub
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

ParameterData TypeRequiredRangeDescription
folderCOMBOYesDynamically loaded from folder_paths.get_input_subfolders()The folder to load images from. The available options are the subdirectories within ComfyUI’s input directory.
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 NameData TypeDescription
imagesIMAGEA list of loaded image tensors.
textsSTRINGA list of text captions corresponding to each loaded image.