Pyobjects/Set Intersection
Find what two sets have in common
- py_set_a
- py_set_b
- SET
Set Intersection (SetIntersectionNode) takes two sets and keeps only what's in both. Everything unique to A or unique to B gets dropped; what's left is the overlap. It's the node for "which of these tags/seeds/items showed up in both lists" - the kind of question that's a genuine chore to answer with string splitting and nested loops, and a one-liner with real sets.
Ships in aria1th's ComfyUI-LogicUtils pack, a side project from the same person who trained Illustrious XL. It's obscure - there's almost no discussion of it anywhere online, and the README itself is more apology than documentation - but the set-operations family it includes (Create, Add, Remove, Clear, Union, Intersection, Difference, Symmetric Difference, Set to List) is a straightforward, working port of Python's built-in set type.
How it works
It's py_set_a & py_set_b, Python's intersection operator. If nothing overlaps, you get back an empty set - not an error, not None, just an empty SET that later nodes handle fine (a Set to List on it will give you an empty list). No configuration knobs; the behavior is fixed.
Where this earns a spot in a real workflow: comparing two runs' worth of generated tags to see what's consistent, checking whether a "must include" set and a "candidates" set actually share anything before you build downstream logic on the assumption they do, or as a cheap sanity check between two branches of a graph that are supposed to converge on overlapping content.
Inputs and outputs
py_set_a(SET, required) - the first set.py_set_b(SET, required) - the second set.- Output:
SET- only the items present in both.
How to install it
ComfyUI Manager: search "ComfyUI-LogicUtils", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
then restart. No models to fetch - this is CPU-only Python logic with no GPU or VRAM cost.
Common issues & troubleshooting
"Missing node type" on a shared workflow. Let ComfyUI Manager's "Install Missing Custom Nodes" pull in the whole pack from the graph JSON, rather than tracking SetIntersectionNode down by hand.
Import error on startup. Per the README, the pack's dependency auto-installer is opt-in: set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 before launching if a node needs a package that wasn't installed automatically, or COMFYUI_LOGICUTILS_SKIP_INSTALL=1 to turn the hook off entirely if that's the actual issue. SetIntersectionNode needs nothing beyond the Python standard library, so an import failure here is coming from somewhere else in the pack.
Output is always empty. Before assuming a bug, double-check both sets actually contain items of the same value and type - a set of strings "1" and a set of ints 1 won't intersect, because Python treats them as different values even though they print the same.
Can't wire the result into a core ComfyUI node. SET only talks to LogicUtils' own nodes. Convert with Set to List first if you need a plain LIST.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| py_set_a | SET | — | |
| py_set_b | SET | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SET | SET | — |