ComfyUI  >  Nodes  >  comfyui_tag_filter >  TagReplace

ComfyUI Node: TagReplace

Class Name

TagReplace

Category
text
Author
sugarkwork (Account age: 915 days)
Extension
comfyui_tag_filter
Latest Updated
8/2/2024
Github Stars
0.0K

How to Install comfyui_tag_filter

Install this extension via the ComfyUI Manager by searching for  comfyui_tag_filter
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui_tag_filter in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

TagReplace Description

Streamline tag management by replacing tags based on similarity percentage for AI artists' dataset standardization and accuracy.

TagReplace:

The TagReplace node is designed to streamline and enhance your tag management process by replacing specific tags within a given set of tags based on a matching percentage. This node is particularly useful for AI artists who need to standardize or update tags in their datasets. By normalizing tags (converting them to lowercase and replacing spaces with underscores), the node ensures consistency and accuracy. It then compares each tag against a list of replacement tags, selecting the best match based on category similarity. If a match meets or exceeds a specified threshold, the original tag is replaced; otherwise, it remains unchanged. Additionally, any replacement tags not found in the original set are appended to the result, ensuring comprehensive tag coverage.

TagReplace Input Parameters:

tags

This parameter takes a string of tags separated by commas. These are the original tags that you want to process and potentially replace. The tags will be normalized by converting them to lowercase and replacing spaces with underscores. This ensures that the tags are in a consistent format for comparison. There is no minimum or maximum value for this parameter, but it should be a valid string of tags.

replace_tags

This parameter takes a string of replacement tags separated by commas. These tags will be used to replace the original tags if a match is found. Like the tags parameter, these tags will also be normalized. The node will compare each original tag against these replacement tags to find the best match based on category similarity. There is no minimum or maximum value for this parameter, but it should be a valid string of tags.

match

This parameter is a numerical value that specifies the minimum match percentage required for a replacement to occur. The match percentage is calculated based on the similarity of tag categories. If the best match percentage for a tag meets or exceeds this value, the original tag will be replaced with the best matching replacement tag. The default value is typically set to ensure a reasonable level of similarity, but you can adjust it based on your specific needs.

TagReplace Output Parameters:

result

The output parameter is a string that contains the processed tags, separated by commas. This string includes the original tags, with some potentially replaced by the best matching replacement tags based on the specified match percentage. Additionally, any replacement tags that were not found in the original set are appended to the result. This ensures that all relevant tags are included in the final output.

TagReplace Usage Tips:

  • Ensure that both the tags and replace_tags parameters are well-defined and relevant to your dataset to achieve the best results.
  • Adjust the match parameter to fine-tune the sensitivity of tag replacement. A higher value will result in fewer replacements, while a lower value will allow more replacements.
  • Use this node to standardize tags across different datasets, making it easier to manage and analyze your data.

TagReplace Common Errors and Solutions:

Invalid input format

  • Explanation: The input tags or replacement tags are not in the correct format (e.g., not separated by commas).
  • Solution: Ensure that both the tags and replace_tags parameters are strings of tags separated by commas.

No matching tags found

  • Explanation: None of the original tags meet the specified match percentage with any replacement tags.
  • Solution: Consider lowering the match parameter to allow for more replacements or review the replacement tags to ensure they are relevant.

Empty result

  • Explanation: The input tags and replacement tags are both empty or improperly formatted.
  • Solution: Provide valid strings of tags for both the tags and replace_tags parameters to ensure the node can process them correctly.

TagReplace Related Nodes

Go back to the extension to check out more related nodes.
comfyui_tag_filter
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.