π Array Filter
Your prompt list minus the duplicates and the junk
- Array
- Count
First, the thing that confuses everyone
The honda-nodes "array" nodes don't pass Python lists around. An array in this pack is a plain string with newlines in it - "cat\ndog\ncat\n" - and every node in the π Array group parses that string, does one thing, and hands back another newline-joined string. Once that clicks, the whole group makes sense: it's a text-processing toolkit disguised as a collection library.
Which makes Array Filter the workhorse of the group. You reach for it when the list arrived from somewhere you don't control - a tag dump pasted into a text node, a π List Files result full of absolute paths, a prompt bank where somebody left blank lines and repeats in it. Filter is where you clean that up before anything downstream has to deal with it.
What it actually does, in order
The source is refreshingly honest about the sequence: trim β remove empty β dedupe β pattern. That order is the whole node, and it matters. Trimming first means " cat" and "cat" collapse into one duplicate instead of two near-misses. Deduping keeps first occurrence, so your original ordering survives - no alphabetical surprise.
The pattern field is a glob, matched with Python's fnmatch, not a regex. Two consequences people trip on:
catdoes not matcha cat on a mat.fnmatchmatches the whole item, so you need*cat*. The bare word only matches an item that is exactlycat.*matches slashes too, unlike a shell glob. So*.pngon a list of absolute paths will happily matchD:/outputs/run7/x.png. That's usually what you want here, and it's why this node is a decent pre-filter before hashing or deleting files.
On Windows, fnmatch normalises case, so *.PNG matches .png. On Linux it doesn't, and that difference will bite you the day you move a workflow from your desktop to a rented GPU box. Leave Invert Pattern alone for a "keep only these" filter, enable it for "drop everything that looks like this" - dropping *.tmp off a file list, say.
The inputs and outputs you'll touch
Array is socket-only. You cannot click into it and paste your list - the pack marks it force_input, so it appears as an input socket and nothing else. That's deliberate (arrays are supposed to come from a producer), but it's the number one "why can't I type anything" moment with these nodes. Feed it from π Array From Text, π List Files, π Read File, or a text node.
Of the booleans, Remove Empty and Trim Items are on by default and should probably stay that way. Remove Duplicates is off, which is the right call - silently deleting user data is worse than the occasional dupe.
Two outputs: Array (the cleaned string, wired onward to Slice, For Each, To Text, or straight into a prompt encoder) and Count (an INT of how many items survived). Count is the underrated one - it's how you tell a filter that worked from a filter that ate everything.
Installing it
ComfyUI Manager is the path of least resistance: Extensions β Node Pack β search "Honda Nodes" β Install β restart. The pack is in the official registry under publisher avaray.
Manually:
cd ComfyUI/custom_nodes
git clone --depth 1 https://github.com/Avaray/honda-nodes.git
The pack also ships an install.py that downloads two CLI binaries (jq and ime) into honda-nodes/bin. Array nodes don't need either of them, but the JSON and metadata nodes do, so run it anyway while you're here:
# ComfyUI portable on Windows
..\..\..\python_embeded\python.exe install.py
# Linux / macOS / venv
python install.py
One real requirement: this pack is written entirely against ComfyUI's V3 node schema (comfy_api.latest) and declares requires-comfyui >= 0.38.0. On an older install you get zero nodes and no error worth reading.
Where it goes wrong
"I set it up and nothing happened." Array Filter is not an output node, and ComfyUI only executes what an output node needs - it works backwards from Save Image, Preview Image and friends. A filter dangling into nowhere is never run, so the Count you were watching never updates. Terminate the chain in something: a π€ Text Preview, π JSON Preview, π οΈ Print to Console, or a save node further down.
Everything vanished. A pattern that matches nothing returns an empty Array and Count = 0, quietly. If you're filtering and the count drops to zero, the pattern is wrong, not the node. Blank means no filter; a glob means filter hard.
Stale results. Because the string is the input, editing the upstream text node changes the cache key and re-runs - but if you're pulling from a file, the file changing does not. If a re-run gives you yesterday's file list, that's the engine's cache, not the filter.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| array | STRING | Newline-separated array string. | |
| remove_empty | BOOLEAN | true | Remove empty lines from the array. |
| remove_duplicates | BOOLEAN | false | Remove duplicate items, keeping the first occurrence. |
| pattern | STRING | Optional glob pattern. Items matching the pattern are kept (or removed if Invert Pattern is enabled). | |
| invert_pattern | BOOLEAN | false | If enabled, items matching the pattern are removed instead of kept. |
| trim_items | BOOLEAN | true | Strip leading and trailing whitespace from each item. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Array | STRING | β |
| Count | INT | β |