Nodes/ComfyUI-MAINodes/Partition (list)
ComfyUI Node

Partition (list)

Splits a list into kept and rejected by the expression. Feed the expensive branch only kept, and guard that branch with a Gate on kept_count > 0: an empty list does not map zero times.

By matlowai·Created 3 months ago·Updated about 24 hours ago· 241
Partition (list)
  • items
  • values
  • kept
  • rejected
  • kept_count
  • rejected_count
◄expressionitem > 0►
CategoryMAINodes/Flow

Inputs (3)

NameTypeDefaultDescription
items*—
expressionSTRINGitem > 0—
valuesoptCOMFY_AUTOGROW_V3—

Outputs (4)

NameTypeDescription
kept*—
rejected*—
kept_countINT—
rejected_countINT—