Nodes/ComfyUI-LogicUtils/Pyobjects/Set Clear
ComfyUI Node

Pyobjects/Set Clear

Reset a set back to empty without a new Set Create

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Pyobjects/Set Clear
  • py_set
  • SET

Set Clear (SetClearNode) takes a SET and hands back an empty one. It's the graph equivalent of Python's set.clear(). On its own that sounds pointless - you could just wire in a fresh Set Create instead - but it earns its place when you want an "empty this out" step that sits in the same position in the graph as the set it's clearing, rather than introducing a second, disconnected source node. In a loop or a reused sub-graph, that positional consistency is the actual value.

Comes from aria1th's ComfyUI-LogicUtils, a personal utility pack (math, string/list randomizers, and a full set-algebra family) from the same handle behind the Illustrious XL training work. It's a minor, under-documented pack - the README itself says as much - but the set-operations cluster is a straightforward, complete port of Python's set type into node form.

How it works

SetClearNode takes exactly one SET input and returns a new empty SET. There's no widget to configure and nothing conditional about it - every call empties the set, unconditionally. If you wanted "clear only sometimes," you'd gate the connection to this node with a switch/logic node upstream rather than expect a setting on SetClearNode itself, since the schema exposes none.

Inputs and outputs

  • py_set (SET, required) - the set to clear. (Its contents are irrelevant to the result - you could feed it any set and get an empty one back - but the input is still required, since the node needs a set object to operate on.)
  • Output: SET - an empty set.

How to install it

ComfyUI Manager: search "ComfyUI-LogicUtils", install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils

then restart ComfyUI. Pure CPU-side Python - no model downloads, no VRAM impact.

Common issues & troubleshooting

"Missing node type" opening a shared workflow. Same fix as every custom node: ComfyUI Manager's "Install Missing Custom Nodes" installs the whole pack in one pass from the workflow JSON.

Import error on startup. The README documents an opt-in auto-installer for the pack's own dependencies: set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 before launch if a node needs something that wasn't pulled in, or COMFYUI_LOGICUTILS_SKIP_INSTALL=1 if the auto-install hook is itself the problem. SetClearNode has zero external dependencies, so if you're seeing an import error, it's coming from elsewhere in the pack (the WebUI API nodes are the likeliest culprit) - not this one.

"Why is my set already empty every run?" Check that SetClearNode isn't sitting somewhere in the chain you forgot about - it's a one-way operation with no bypass toggle, so if it's wired in, it will clear on every execution.

Can't plug the output into a list-expecting node. SET is a type specific to this pack. Run it through Set to List first if the next node in your graph wants a LIST.

CategoryData

Inputs (1)

NameTypeDefaultDescription
py_setSET

Outputs (1)

NameTypeDescription
SETSET