A simple ComfyUI custom node that filters arrays based on boolean masks.
Comfy Bool Filter takes an input array and a boolean mask array of the same length, returning only the elements where the corresponding boolean value is True.
| Input | Type | Description |
|---|---|---|
value_array |
LIST | The input array to filter |
bool_mask |
LIST | A boolean array of the same length as array |
| Output | Type | Description |
|---|---|---|
FILTERED_ARRAY |
LIST | Array containing only elements where bool_mask is True |
Input:
array: ["apple", "banana", "cherry", "date"]
bool_mask: [True, False, True, False]
Output:
filtered_array: ["apple", "cherry"]
- The
arrayandbool_maskmust have the same length - If lengths don't match, an error will be raised
- An empty result is returned if all boolean values are
False
MIT License