Nodes/comfyui-misc/Combine Primitives (misc)
ComfyUI Node

Combine Primitives (misc)

Bundle a seed, a step count, and a prompt onto one wire

By wraith-executioner-year-2·Created 3 months ago·Updated 2 months ago· 1
Combine Primitives (misc)
  • primitive_01
  • combined
  • length

Every big ComfyUI graph has the same disease: a dozen loose wires for a seed, a steps value, a prompt, a boolean toggle, each dragged across half the canvas. Combine Primitives (misc) is the tiny cure - it gathers any number of primitive values (INT, FLOAT, STRING, BOOLEAN, and COMBO) into a single combined package that travels down one wire, plus a length output telling you how many values got packed.

If you've read about the "context object" pattern in the plumbing layer - the design where a bundle of related values travels as one object and each node pulls off what it needs - this is that pattern at the smallest scale. It's not a full context bus like rgthree's Context; it packs exactly the primitive values you hand it, no magic, and its natural partner is this same pack's Split Primitives (misc), which unpacks it at the far end.

The inputs. primitive_01, primitive_02, … are dynamic optional slots that accept INT,FLOAT,STRING,BOOLEAN,COMBO. They appear as you wire them, so there's no fixed arity. The node is strict about what you connect: it has a VALIDATE_INPUTS that refuses non-primitive types with a "only primitive types may be connected" error rather than silently accepting a latent or an image. That's a genuinely nice guard in a pack where most sockets are untyped *.

Under the hood the package is a small dict - {"values": (...), "types": (...)} - where each value is paired with the type it came in as, tracked so the receiving side can restore typed outputs later. Type info comes from the graph's links when available and is inferred from the value otherwise.

The outputs. combined is your PRIMITIVES bundle, and length is the INT count. Wire combined into Split Primitives (misc) to recover the values, into ForEach (misc) to loop over them, or into any other node that understands this pack's PRIMITIVES type. length is the cheap validation: if you expect 3 values and get 2, you know an input silently didn't connect (unwired or empty inputs are skipped).

Install. From ComfyUI/custom_nodes:

git clone https://github.com/wraith-executioner-year-2/comfyui-misc/

Restart ComfyUI; it's in the misc category. No requirements to install, no models to download - it's a Python node plus a web extension that manages the dynamic slots.

Where people get burned: the PRIMITIVES type is this pack's own type. A combined output won't plug into another pack's bundle node, and a node from another pack that emits a similar bundle won't plug into Split Primitives. That lock-in is the standard cost of the bundle pattern - it's fine as long as you stay inside this pack's little world, and it's a wall if you try to mix. Also, empty inputs are dropped from the package, so the order of what survives is the order of the non-empty slots - if you leave primitive_02 unwired, don't expect INT_02 on the way out.

Categorymisc

Inputs (1)

NameTypeDefaultDescription
primitive_01optINT,FLOAT,STRING,BOOLEAN,COMBO

Outputs (2)

NameTypeDescription
combinedPRIMITIVES
lengthINT