Tag Switcher [LP]| Tag Switcher [LP]:
The TagSwitcher| Tag Switcher [LP] node is designed to dynamically select an image based on the presence of specific tags within a given set of input tags. This node is particularly useful for AI artists who want to automate the process of image selection based on descriptive tags. By evaluating the input tags against predefined sets of tags, the node can determine which image to return, allowing for a flexible and automated workflow. The node supports multiple sets of tags, each associated with a different image, and can be configured to match any or all tags within each set. This functionality enables users to create complex decision-making processes in their creative projects, enhancing efficiency and creativity.
Tag Switcher [LP]| Tag Switcher [LP] Input Parameters:
input_tags
This parameter accepts a string of tags that will be evaluated against the predefined sets of tags. The tags should be separated by commas and can include spaces, which will be normalized by the node. The input tags serve as the basis for determining which image to return, making it crucial to provide accurate and relevant tags for effective image selection.
default_image
The default_image parameter specifies the image to be returned if none of the predefined tag sets match the input tags. This ensures that there is always a fallback image, providing a safety net in cases where no specific conditions are met. The default value is an empty image, but it can be set to any desired image.
tags1
This parameter defines the first set of tags to be matched against the input tags. It is a string of tags separated by commas. If any or all of these tags are found in the input tags, depending on the any1 flag, the associated image1 will be returned. This allows for targeted image selection based on specific criteria.
image1
The image1 parameter is the image associated with the first set of tags (tags1). If the conditions specified by tags1 and any1 are met, this image will be returned. It provides a direct link between a set of tags and the corresponding image output.
any1
This boolean parameter determines the matching condition for tags1. If set to True, the node will return image1 if any of the tags in tags1 are present in the input tags. If set to False, all tags in tags1 must be present for image1 to be returned. The default value is True, allowing for more flexible matching.
tags2
Similar to tags1, this parameter defines a second set of tags for matching. It provides an additional layer of conditions for image selection, enabling more complex decision-making processes.
image2
The image2 parameter is the image associated with the second set of tags (tags2). It will be returned if the conditions specified by tags2 and any2 are met, offering another option for image output based on different criteria.
any2
This boolean parameter works like any1, determining the matching condition for tags2. It allows for either any or all tags in tags2 to trigger the return of image2, with a default value of True.
tags3
This parameter provides a third set of tags for matching, further expanding the node's capability to handle multiple conditions and select images accordingly.
image3
The image3 parameter is linked to the third set of tags (tags3). It will be returned if the conditions specified by tags3 and any3 are satisfied, adding another layer of flexibility to the image selection process.
any3
This boolean parameter determines the matching condition for tags3, similar to any1 and any2. It allows for either any or all tags in tags3 to trigger the return of image3, with a default value of True.
tags4
This parameter defines a fourth set of tags for matching, providing even more options for conditional image selection.
image4
The image4 parameter is the image associated with the fourth set of tags (tags4). It will be returned if the conditions specified by tags4 and any4 are met, offering yet another possibility for image output.
any4
This boolean parameter determines the matching condition for tags4, functioning like the previous any parameters. It allows for either any or all tags in tags4 to trigger the return of image4, with a default value of True.
Tag Switcher [LP]| Tag Switcher [LP] Output Parameters:
image
The image output parameter is the result of the tag matching process. It returns the image associated with the first set of tags that meet the specified conditions. If none of the tag sets match, the default_image is returned. This output is crucial for automating image selection based on descriptive tags, streamlining the creative workflow.
Tag Switcher [LP]| Tag Switcher [LP] Usage Tips:
- Ensure that your input tags are well-defined and relevant to the images you want to select. This will improve the accuracy of the node's image selection process.
- Use the
anyparameters to control the strictness of tag matching. Setting them toTrueallows for more flexible matching, whileFalserequires all tags to be present. - Consider setting a meaningful
default_imageto ensure that your workflow continues smoothly even if no specific conditions are met.
Tag Switcher [LP]| Tag Switcher [LP] Common Errors and Solutions:
No image returned
- Explanation: This error occurs when none of the tag sets match the input tags, and no
default_imageis specified. - Solution: Ensure that your input tags are correctly formatted and relevant to the tag sets. Also, specify a
default_imageto avoid this issue.
Incorrect image returned
- Explanation: This may happen if the
anyparameters are not set correctly, leading to unexpected matches. - Solution: Review the
anyparameters for each tag set to ensure they align with your intended matching logic. Adjust them toTrueorFalseas needed to achieve the desired behavior.
