Visit ComfyUI Online for ready-to-use ComfyUI environment
Filter unwanted tags from tokenizer vocab for AI art gen by specifying banned tags to exclude from output.
The BanTags| Ban Tags 🍌 node is designed to help you filter out unwanted tags from a given tokenizer's vocabulary. This can be particularly useful in AI art generation where certain tags or keywords need to be excluded to maintain the desired quality or theme of the generated content. By specifying a list of tags to ban, the node ensures that any tags matching the provided patterns are identified and excluded from the output. This functionality is essential for maintaining control over the content and avoiding any undesired elements in your AI-generated art.
The tokenizer
parameter expects a tokenizer object, specifically of type DART_TOKENIZER
. This tokenizer is used to process and manage the vocabulary from which the tags will be filtered. The tokenizer's vocabulary is scanned to identify and exclude tags that match the patterns specified in the ban_tags
parameter. This parameter is crucial as it provides the context and the set of tags that need to be filtered.
The ban_tags
parameter is a multiline string where you can specify the tags you want to ban. Each line in this string represents a different tag pattern that will be compiled into a regular expression. These patterns are then used to match against the tags in the tokenizer's vocabulary. The impact of this parameter is significant as it directly determines which tags will be excluded from the output. There are no specific minimum or maximum values, but the patterns should be valid regular expressions.
The output parameter is a single string that contains the list of banned tags, separated by commas. This string represents the tags from the tokenizer's vocabulary that matched the patterns specified in the ban_tags
parameter. The importance of this output lies in its ability to provide a clear and concise list of excluded tags, which can be used to verify that the unwanted tags have been successfully filtered out.
ban_tags
parameter contains valid regular expressions to avoid any errors during the matching process.ban_tags
list to adapt to new unwanted tags that may appear in your tokenizer's vocabulary.ban_tags
parameter contains an invalid regular expression.ban_tags
parameter and ensure they are valid regular expressions.tokenizer
parameter is not a valid DART_TOKENIZER
object.DART_TOKENIZER
.ban_tags
.ban_tags
are correct and that the tags you want to ban are present in the tokenizer's vocabulary.© Copyright 2024 RunComfy. All Rights Reserved.