Load Image (With Subfolders):
The EnhancementUtils_ImageLoadWithSubfolders node is designed to enhance the image loading capabilities within the ComfyUI framework by allowing you to load images from a specified directory, including all its subfolders, and extract embedded metadata. This node extends the functionality of ComfyUI's built-in image loader by supporting recursive subfolder browsing, which means you can easily access images stored in nested directories without manually navigating through each folder. Additionally, it extracts metadata from PNG and WebP files, which can include prompts or workflow information, making it particularly useful for AI artists who work with complex image datasets. The node retains the robustness of the original loader, handling multi-frame images, recovering truncated files, and supporting various image formats, including those with palette transparency and 16-bit depth. This makes it a versatile tool for managing and utilizing large collections of images with embedded metadata.
Load Image (With Subfolders) Input Parameters:
image
The image parameter allows you to select an image from the input directory, with full support for subfolders. This parameter is crucial as it determines which image file will be loaded and processed by the node. The selection is facilitated through a dropdown menu that lists all available images in the specified directory and its subfolders. This parameter does not have minimum, maximum, or default values, but it provides a comprehensive list of options based on the directory's contents. By selecting an image, you enable the node to load the file and extract any embedded metadata, which can be used for further processing or analysis.
Load Image (With Subfolders) Output Parameters:
image
The image output provides the loaded image file, ready for further processing or display. This output is essential as it represents the primary data that the node is designed to handle, allowing you to work with the image in subsequent nodes or workflows.
mask
The mask output delivers any mask data associated with the loaded image. This can be particularly useful for tasks that involve image segmentation or require specific areas of the image to be highlighted or processed differently.
prompt
The prompt output contains any embedded prompt information extracted from the image file. This is valuable for AI artists who use prompts to guide or influence the generation of new images, as it allows them to access and utilize the original prompts associated with the loaded images.
metadata
The metadata output provides a JSON string containing all extracted metadata from the image file. This includes file-level information such as filename, resolution, and size, as well as any additional metadata stored within the image. This output is crucial for understanding the context and details of the image, enabling more informed decisions and processing steps.
Load Image (With Subfolders) Usage Tips:
- Ensure that your input directory is well-organized, with images stored in logical subfolders, to take full advantage of the node's recursive browsing capabilities.
- Use the metadata output to gain insights into the images you are working with, such as their resolution and embedded prompts, which can help tailor your processing workflows.
Load Image (With Subfolders) Common Errors and Solutions:
FileNotFoundError
- Explanation: This error occurs when the specified image file cannot be found in the directory or its subfolders.
- Solution: Verify that the image file exists in the specified directory and that the directory path is correct. Ensure that the file is not excluded by any filters or settings.
UnsupportedImageFormatError
- Explanation: This error indicates that the selected image file is in a format that is not supported by the node.
- Solution: Convert the image to a supported format such as PNG or WebP, and ensure that the file is not corrupted or improperly formatted.
MetadataExtractionError
- Explanation: This error arises when the node fails to extract metadata from the image file.
- Solution: Check if the image file contains valid metadata. If the file is a WebP format, ensure that the
piexiflibrary is installed for EXIF metadata extraction.
