ComfyUI  >  Nodes  >  ComfyUI-0246 >  Tag

ComfyUI Node: Tag

Class Name


Trung0246 (Account age: 3389 days)
Latest Updated
Github Stars

How to Install ComfyUI-0246

Install this extension via the ComfyUI Manager by searching for  ComfyUI-0246
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-0246 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

Tag Description

Manage and manipulate data tags efficiently with exact and regex-based matching for organizing and filtering data elements.


The 0246.Tag node is designed to manage and manipulate tags within your data workflow. This node allows you to apply, check, remove, or clear tags from your data elements, providing a flexible way to handle metadata or identifiers associated with your data. By using this node, you can efficiently organize and filter your data based on tags, making it easier to manage complex workflows. The node supports both exact and regex-based tag matching, giving you the ability to perform precise or pattern-based operations on your tags. This functionality is particularly useful for AI artists who need to categorize and process large datasets with specific attributes.

Tag Input Parameters:


This parameter accepts the input data that you want to process. It is a required parameter and expects a list of data elements. Each element can be a wrapped object containing tags and associated IDs. The node will perform the specified operation on these elements based on the provided tags and modes.


This parameter determines the operation mode of the node. It accepts one of the following options: apply, check, remove, or clear. The apply mode adds a tag to the data, check mode verifies the presence of a tag, remove mode deletes a specific tag, and clear mode removes all tags from the data. The default value is apply.


This is a boolean parameter that, when set to True, inverts the operation's effect. For example, in check mode, it will return data elements that do not have the specified tag. The default value is False.


This parameter specifies the matching mode for tags. It accepts either exact or regex. The exact mode matches tags exactly as specified, while the regex mode allows for pattern-based matching using regular expressions. The default value is exact.


This parameter is a string that represents the tag to be applied, checked, removed, or cleared. It supports multiline input, allowing you to specify complex tags or patterns. The default value is tag.


This hidden parameter is used internally to store prompt information. It is not intended to be modified by the user.


This hidden parameter is used internally to store a unique identifier for the operation. It is not intended to be modified by the user.


This hidden parameter is used internally to store workflow-related information. It is not intended to be modified by the user.

Tag Output Parameters:


This parameter returns the processed data after the specified tag operation has been applied. The output is a list of data elements, which may be wrapped or unwrapped depending on the operation performed. This allows you to easily integrate the results back into your workflow for further processing or analysis.

Tag Usage Tips:

  • Use the apply mode to add new tags to your data elements, which can help in categorizing and filtering data in subsequent steps.
  • Utilize the check mode to verify the presence of specific tags before performing operations, ensuring that only relevant data is processed.
  • The remove mode is useful for cleaning up tags that are no longer needed, helping to maintain a tidy and organized dataset.
  • Leverage the clear mode to remove all tags from data elements, which can be useful when resetting or reinitializing your data for a new workflow.
  • Experiment with the regex tag mode to perform advanced pattern matching, which can be particularly powerful for complex tagging schemes.

Tag Common Errors and Solutions:

Tag not found

  • Explanation: This error occurs when the specified tag is not found in the data element during a check or remove operation.
  • Solution: Ensure that the tag you are looking for exists in the data element. Double-check the tag name for any typos or mismatches.

Invalid regex pattern

  • Explanation: This error occurs when the provided regex pattern is invalid or cannot be compiled.
  • Solution: Verify that your regex pattern is correctly formatted and adheres to the syntax rules of regular expressions.

Data type mismatch

  • Explanation: This error occurs when the input data type does not match the expected type for the operation.
  • Solution: Ensure that the input data is a list of elements, and each element is either a wrapped object or a compatible data type.

Operation mode not supported

  • Explanation: This error occurs when an unsupported operation mode is specified.
  • Solution: Check the ops_mode parameter and ensure it is set to one of the supported values: apply, check, remove, or clear.

Tag Related Nodes

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

© 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.