Random LoRA Folder Selector:
The RandomLoRAFolder node is designed to facilitate the random selection and application of LoRA (Low-Rank Adaptation) models from specified folders. This node is particularly useful for AI artists who want to experiment with different LoRA models without manually selecting each one. By automating the selection process, it allows for a more dynamic and varied application of LoRA models, enhancing creativity and efficiency. The node can handle multiple folders and apply exclusion rules, ensuring that only the desired models are used. It also supports preloading of LoRA files to optimize performance, making it a powerful tool for managing and utilizing LoRA models in AI art generation.
Random LoRA Folder Selector Input Parameters:
selected_folder
This parameter specifies the folder from which LoRA models will be randomly selected. It is crucial for directing the node to the correct location where the desired LoRA files are stored. The folder path should be relative to the base LoRA directory. If the folder does not exist or is incorrectly specified, the node will not be able to retrieve any LoRA models.
count
This parameter determines the number of LoRA models to be randomly selected from the specified folder. It allows you to control how many models are applied in a single operation. The value should be a positive integer, with the default being 1. If the count exceeds the number of available models in the folder, the node will select as many as possible.
rng
The random number generator (RNG) parameter allows you to specify a custom RNG for the selection process. This can be useful if you want to ensure reproducibility or use a specific randomization method. If not provided, the node will use Python's default random module.
exclude_list
This parameter is a list of LoRA model filenames to be excluded from the selection process. It is useful for preventing certain models from being used, either due to preference or compatibility issues. The filenames should be specified without paths, and the node will automatically filter them out during selection.
Random LoRA Folder Selector Output Parameters:
selected_loras
This output parameter provides a list of the randomly selected LoRA model file paths. These paths are relative to the base LoRA directory and can be used directly in subsequent nodes or processes. The output reflects the models chosen based on the input parameters, including any exclusions applied.
Random LoRA Folder Selector Usage Tips:
- Ensure that the
selected_folderparameter is correctly set to a valid directory containing LoRA models to avoid empty selections. - Use the
exclude_listto manage and refine the selection process by excluding models that do not fit your current project needs. - Consider preloading LoRA files if you frequently use the same models, as this can significantly reduce loading times and improve workflow efficiency.
Random LoRA Folder Selector Common Errors and Solutions:
"No LoRA files found in <folder_path>"
- Explanation: This error occurs when the specified folder does not contain any LoRA files with the expected extensions (e.g.,
.safetensors,.pt). - Solution: Verify that the
selected_folderparameter is set to the correct directory and that it contains valid LoRA files.
"Error processing <lora_path>: <error_message>"
- Explanation: An error occurred while attempting to process a specific LoRA file, possibly due to file corruption or incompatible format.
- Solution: Check the integrity of the LoRA file at the specified path and ensure it is in a supported format. Consider replacing or removing problematic files from the folder.
