EZ Prompt Loader:
The EZ_Prompt_Loader node is designed to streamline the process of loading prompt texts from files, making it an invaluable tool for AI artists who work with large collections of text prompts. This node allows you to efficiently browse and select prompt files from a specified directory, including all its subdirectories, ensuring that you can easily access and utilize the text data you need for your creative projects. By offering different selection modes, such as single, multiple, and random, the node provides flexibility in how you choose and apply prompts, catering to various artistic workflows. The node's ability to filter items based on text strings further enhances its utility, allowing you to quickly narrow down your options and focus on the most relevant prompts. Overall, the EZ_Prompt_Loader simplifies the management and retrieval of prompt texts, enabling you to focus more on the creative aspects of your work.
EZ Prompt Loader Input Parameters:
prompt_directory
This parameter specifies the directory where the node will search for prompt files. It searches recursively through all subdirectories, allowing you to organize your prompts in a structured manner without worrying about manually navigating through folders. The directory path should be provided as a string, and it is essential for locating the files you wish to load.
selection_mode
The selection_mode parameter determines how prompts are selected from the available files. It offers three options: single, multiple, and random. The single mode allows you to select one item at a time, multiple mode lets you select several items with the output being comma-separated, and random mode randomly selects one of the visible items, using a seed if provided. The default mode is single, and this parameter significantly impacts how prompts are chosen and used in your workflow.
opt_seed
This optional integer parameter is used in the random selection mode to control the randomness of the selection process. By providing a seed value, you can ensure consistent random selections across different executions. The default value is 0, and it must be a non-negative integer. If not connected, the node will always re-execute on prompt, providing a new random selection each time.
filter_text
The filter_text parameter allows you to filter the available prompt files based on a specific text string. This is particularly useful when you have a large number of files and need to quickly find those that match certain criteria. The default value is an empty string, meaning no filtering is applied unless specified.
selected_files
This optional parameter is a string that can be used to specify particular files you want to select. By default, it is an empty string, and it allows for more precise control over which files are loaded, especially when used in conjunction with the multiple selection mode.
EZ Prompt Loader Output Parameters:
STRING
This output provides the content of the selected prompt file(s). If multiple files are selected, their contents will be delimited by a comma. This output is crucial as it delivers the actual text data that you will use in your AI art projects.
OPT_DIRECTORY
The OPT_DIRECTORY output returns the path to the currently selected directory. This is useful for verifying the source of the loaded prompts and ensuring that the correct directory is being accessed.
BATCH_SELECTED
This output is a list of all selected items, which will include all visible (filtered) items if none or a single item is selected. It provides a comprehensive overview of the prompts that have been chosen, allowing you to review and adjust your selections as needed.
EZ Prompt Loader Usage Tips:
- Utilize the
filter_textparameter to quickly locate specific prompts within large directories, saving time and effort in finding the right text files. - When using the
randomselection mode, connect theopt_seedparameter to maintain consistency in random selections across different sessions, which can be particularly useful for reproducible results.
EZ Prompt Loader Common Errors and Solutions:
"No corresponding files found"
- Explanation: This error occurs when the specified directory does not contain any files that match the criteria set by the node, such as the
filter_text. - Solution: Ensure that the
prompt_directoryis correctly set and that there are files within it that meet the filter criteria. Adjust thefilter_textif necessary to broaden the search.
"Invalid directory path"
- Explanation: This error indicates that the path provided in the
prompt_directoryparameter is incorrect or inaccessible. - Solution: Double-check the directory path for typos or errors, and ensure that the directory exists and is accessible by the node.
