Visit ComfyUI Online for ready-to-use ComfyUI environment
Automates loading images and captions from directory for AI dataset preparation.
The FL_LoadImagesFromDirectoryPath
node is designed to streamline the process of loading images and their corresponding captions from a specified directory. This node is particularly useful for AI artists who need to manage large datasets of images and captions for training purposes. By automating the retrieval and pairing of images with their captions, it significantly reduces the manual effort involved in dataset preparation. The node reads image files in common formats such as PNG, JPG, WEBP, and JPEG, and pairs them with caption files that have a specified extension. This ensures that each image is correctly associated with its descriptive text, facilitating more effective training and data management.
The directory
parameter specifies the path to the folder containing the images and captions you want to load. This should be a string representing the full path to the directory. The node will search this directory for image files and their corresponding caption files. If the directory does not exist, the node will return empty lists for both images and captions. The default value is "X://path/to/images"
.
The caption_extension
parameter defines the file extension of the caption files associated with the images. This should be a string and can be either .caption
or .txt
. The node will look for caption files with this extension that match the base name of each image file. For example, if an image file is named image1.png
, the node will look for a caption file named image1.txt
if the extension is set to .txt
. The default value is .txt
.
The images
output parameter is a list of image tensors that have been loaded from the specified directory. Each image is converted from its original format to a tensor, which is a data structure commonly used in machine learning for storing multi-dimensional data. These tensors can then be used directly in training models or other processing tasks.
The captions
output parameter is a list of strings, where each string is the content of a caption file associated with an image. These captions provide descriptive text that can be used for training models to understand and generate text based on image content. The captions are read from files with the specified extension and are paired with their corresponding images.
caption_extension
parameter to ensure they are loaded properly.© Copyright 2024 RunComfy. All Rights Reserved.