Visit ComfyUI Online for ready-to-use ComfyUI environment
Dynamic label filtering based on predefined mapping for selective inclusion/exclusion, enhancing data processing efficiency.
The FilterdLabel
node is designed to dynamically filter labels based on a predefined mapping, allowing you to selectively include or exclude certain labels from processing. This node is particularly useful in scenarios where you need to manage and control the flow of data by filtering out unwanted labels, thus streamlining the processing pipeline. By leveraging a boolean input for each label, it provides a flexible mechanism to customize which labels are considered in the output, enhancing the efficiency and relevance of the data being processed. The primary function of this node is to generate a list of class IDs that are not filtered out, which can then be used in subsequent processing steps.
<label_name_1>
Each label name corresponds to a key in the LABELS_CLASSIDS_MAPPING
dictionary and is associated with a boolean input. This input determines whether the label should be filtered out or included in the output. If set to True
, the label is filtered out; if False
, the label is included in the whitelist of class IDs. The default value for each label is True
, meaning that by default, all labels are filtered out unless explicitly set to False
.
<label_name_2>
Similar to <label_name_1>
, this parameter represents another label from the LABELS_CLASSIDS_MAPPING
dictionary. The boolean input for this label functions in the same way, allowing you to control its inclusion in the output. The default setting is True
, and changing it to False
will include the label in the whitelist.
...
The output parameter FILTERED_LABELS
is a tuple containing a list of class IDs that have not been filtered out. This list is generated based on the boolean inputs provided for each label, and it represents the labels that are allowed to pass through the filter. This output is crucial for subsequent processing steps that require a specific set of labels to be included, ensuring that only relevant data is processed further.
FilterdLabel
node, start by identifying the labels you want to include in your processing pipeline and set their corresponding boolean inputs to False
. This will ensure they are not filtered out.LABELS_CLASSIDS_MAPPING
dictionary to reflect any changes in your label set, ensuring that the node remains accurate and effective in filtering the desired labels....
<label_name>
'LABELS_CLASSIDS_MAPPING
dictionary.LABELS_CLASSIDS_MAPPING
dictionary. Update the dictionary if necessary to include any new labels.LABELS_CLASSIDS_MAPPING
dictionary is not properly initialized or is empty.LABELS_CLASSIDS_MAPPING
dictionary is correctly defined and populated with the necessary label-to-class ID mappings before using the node.
...RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.