ComfyUI Node: filter

Class Name

Basic data handling: DataListFilter

Category
Basic/Data List
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

filter Description

Filters data lists by excluding elements where corresponding boolean is `False`, handling length mismatches.

filter:

The DataListFilter node is designed to streamline the process of filtering data lists based on boolean criteria. Its primary function is to take two lists: a value list containing any type of data and a filter list composed solely of boolean values. The node then generates a new list that includes only those elements from the value list where the corresponding boolean in the filter list is False. This functionality is particularly useful for scenarios where you need to exclude certain items from a dataset based on specific conditions. The node automatically handles cases where the two lists are of different lengths by repeating the last element of the shorter list to match the length of the longer one, ensuring seamless operation without manual adjustments.

filter Input Parameters:

value

The value parameter is a list that can contain any type of data elements. This list represents the dataset from which you want to filter out certain elements. The elements in this list are evaluated against the corresponding boolean values in the filter list. There are no specific minimum or maximum values for this parameter, as it can include any data type and any number of elements. The effectiveness of the filtering process depends on the content of this list, as it determines which elements are subject to exclusion based on the filter list.

filter

The filter parameter is a list consisting exclusively of boolean values (True or False). This list acts as a criterion for filtering the value list. Each boolean value in the filter list corresponds to an element in the value list, determining whether that element should be included in the output list. If the boolean value is False, the corresponding element in the value list is included in the output; if True, it is excluded. The filter list must be provided with the same or fewer elements than the value list, as any discrepancy in length is automatically adjusted by repeating the last element of the shorter list.

filter Output Parameters:

filtered_list

The filtered_list is the output parameter that contains the resulting list after the filtering process. This list includes only those elements from the value list where the corresponding boolean in the filter list is False. The filtered_list provides a streamlined dataset that excludes unwanted elements, making it easier to work with and analyze. This output is crucial for tasks that require a refined dataset based on specific exclusion criteria.

filter Usage Tips:

  • Ensure that the filter list is correctly aligned with the value list to achieve the desired filtering effect. If the lists are of different lengths, remember that the node will automatically repeat the last element of the shorter list to match the longer one.
  • Use the DataListFilter node when you need to exclude specific elements from a dataset based on boolean conditions, such as removing invalid or unwanted entries from a list.

filter Common Errors and Solutions:

Mismatched list lengths

  • Explanation: The value and filter lists have different lengths, which might lead to unexpected results if not handled properly.
  • Solution: The node automatically repeats the last element of the shorter list to match the length of the longer one. Ensure that this behavior aligns with your intended filtering logic.

Invalid filter values

  • Explanation: The filter list contains non-boolean values, which can cause the node to malfunction.
  • Solution: Verify that the filter list contains only boolean values (True or False) to ensure proper operation of the node.

filter Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

filter