Image Loader From Path [LP]| Image Loader From Path [LP]:
The ImageLoaderFromPath| Image Loader From Path [LP] node is designed to facilitate the loading of images from a specified directory path, making it an essential tool for AI artists who need to process multiple images efficiently. This node is capable of reading images from a folder, converting them into a format suitable for further processing, and handling image sequences. It supports various image formats, excluding certain types like MPO, and ensures that images are consistently sized for batch processing. The node also manages image masks, which are crucial for tasks that require transparency handling or background manipulation. By automating the image loading process, this node significantly streamlines workflows, allowing you to focus on creative tasks rather than manual file handling.
Image Loader From Path [LP]| Image Loader From Path [LP] Input Parameters:
start_index
The start_index parameter specifies the starting point in the list of images to be loaded from the directory. It determines which image in the sorted list will be the first to be processed. This parameter is useful when you want to skip a certain number of images at the beginning of the list. The minimum value is 0, and there is no explicit maximum value, but it should be less than the total number of images in the directory.
max_images
The max_images parameter defines the maximum number of images to load from the directory, starting from the start_index. This allows you to control the batch size of images being processed, which can be crucial for managing memory usage and processing time. The minimum value is 1, and the maximum value is determined by the number of images available in the directory.
white_bg
The white_bg parameter is a toggle that determines whether the background of images with transparency should be filled with white. When enabled, it ensures that any transparent areas in the image are replaced with a white background, which can be useful for certain types of image processing where transparency is not desired.
patterns
The patterns parameter specifies the file extensions of the images to be loaded, using a pattern matching system. This allows you to filter and load only specific types of image files, such as .jpg, .png, etc. The patterns are defined as a string with extensions separated by a pipe (|), e.g., *.jpg|*.png.
input_folder
The input_folder parameter specifies the name of the folder within the default input directory from which images should be loaded. This parameter is used when a specific path is not provided, allowing the node to locate the images based on a predefined directory structure.
input_path
The input_path parameter allows you to specify an absolute path to the directory containing the images to be loaded. This parameter takes precedence over input_folder and is useful when images are stored in a non-standard location. If the path does not exist, a warning is issued.
Image Loader From Path [LP]| Image Loader From Path [LP] Output Parameters:
image_list
The image_list output contains the loaded images as tensors, ready for further processing. Each image is converted to an RGB format and normalized to a range of 0 to 1, making it suitable for use in machine learning models and other image processing tasks.
mask_list
The mask_list output provides the masks associated with each image, indicating areas of transparency. These masks are crucial for tasks that involve compositing or background removal, as they allow you to identify and manipulate transparent regions of the images.
filename_list
The filename_list output contains the filenames of the loaded images, preserving the original file names for reference. This is useful for tracking and organizing images, especially when dealing with large batches.
Image Loader From Path [LP]| Image Loader From Path [LP] Usage Tips:
- Ensure that the
input_pathorinput_folderis correctly specified to avoid loading errors. Double-check the directory structure and file permissions. - Use the
patternsparameter to filter out unwanted file types and focus on the specific image formats you need for your project. - Adjust the
start_indexandmax_imagesparameters to manage memory usage effectively, especially when working with large datasets.
Image Loader From Path [LP]| Image Loader From Path [LP] Common Errors and Solutions:
[Warning] Image Loader From Path: The input_path <input_path> does not exist
- Explanation: This error occurs when the specified
input_pathdoes not point to a valid directory. - Solution: Verify that the path is correct and that the directory exists. Check for typos or incorrect directory names.
[Warning] Image Loader From Path: The folder <in_path> is empty
- Explanation: This warning indicates that the specified directory does not contain any images that match the given patterns.
- Solution: Ensure that the directory contains images and that the
patternsparameter is set correctly to match the file types present in the directory.
