File Loader Crawl (CRT):
The FileLoaderCrawl node is designed to efficiently scan and load files from a specified directory, offering a streamlined way to manage and access file data within your projects. This node is particularly beneficial for users who need to handle large volumes of files, as it incorporates smart caching logic to minimize redundant operations and enhance performance. By caching file metadata, it ensures that only modified or new files are re-scanned, saving time and computational resources. The node supports both recursive and non-recursive directory scanning, allowing you to tailor its behavior to your specific needs. Additionally, it employs a deterministic selection process based on a seed value, ensuring consistent and predictable file selection across different runs. This makes it an invaluable tool for AI artists who require reliable and efficient file management in their workflows.
File Loader Crawl (CRT) Input Parameters:
folder
The folder parameter specifies the directory path where the node will search for files. It is crucial for defining the scope of the file search operation. The node will scan this directory to find files that match the specified criteria. Ensure that the path is correct and accessible to avoid errors during execution.
crawl_subfolders
The crawl_subfolders parameter determines whether the node should include subdirectories in its search. When set to True, the node will recursively search through all subfolders within the specified directory, allowing for a comprehensive file search. If set to False, only the files in the top-level directory will be considered. This parameter is essential for controlling the depth of the file search.
file_extension
The file_extension parameter defines the type of files to be searched for within the specified directory. By setting this parameter, you can filter files based on their extensions, such as .txt, .jpg, or any other format relevant to your project. This helps in narrowing down the search to only the files of interest, improving efficiency.
seed
The seed parameter is used to deterministically select a file from the list of found files. It ensures that the same file is selected consistently across different runs, provided the file list remains unchanged. This is particularly useful for maintaining consistency in workflows that require repeated access to the same file.
File Loader Crawl (CRT) Output Parameters:
selected_file
The selected_file output parameter provides the path to the file that has been selected based on the seed value. This output is crucial as it allows you to access and utilize the content of the selected file in subsequent operations or nodes within your workflow.
file_content
The file_content output parameter contains the actual data read from the selected file. This output is essential for processing or analyzing the file's content, enabling you to integrate the file data into your project seamlessly.
File Loader Crawl (CRT) Usage Tips:
- Ensure that the
folderpath is correctly specified and accessible to avoid any file access errors. - Use the
crawl_subfoldersparameter wisely based on your needs; enabling it can significantly increase the number of files processed, which might impact performance. - Set the
file_extensionparameter to target specific file types, which can help in reducing unnecessary processing of irrelevant files. - Utilize the
seedparameter to maintain consistency in file selection across different runs, especially in scenarios where reproducibility is important.
File Loader Crawl (CRT) Common Errors and Solutions:
"No files with extension '<file_extension>' found in '<folder>'."
- Explanation: This error occurs when the node does not find any files matching the specified extension in the given directory.
- Solution: Verify that the
folderpath is correct and that files with the specifiedfile_extensionexist in the directory. Also, check if thecrawl_subfolderssetting aligns with your directory structure.
"Folder changed or not cached. Scanning '<folder>' for '<file_extension>' files..."
- Explanation: This message indicates that the folder's contents have changed since the last scan, or the folder was not previously cached.
- Solution: This is an informational message rather than an error. It signifies that the node is updating its cache. Ensure that the folder is accessible and contains the expected files.
