π¦ Dict Packer (Infinite)
Bundle Anything Into a Dict, One Key at a Time
- val_1
- dict_out
Sometimes you don't want to drag five wires across the canvas - you want one Python dict carrying them all. π¦ Dict Packer (Infinite) is the node that builds that dict: connect values to val_N ports, name each one with a matching key_N field, and out the other side comes a single dict_out. It's the pack's answer to the context-bundle idea from the plumbing layer, minus the ceremony.
How it works. The input side is a dynamic pattern: you get key_1 (a STRING widget, default param1) paired with val_1 (a * wildcard input). Connect something to val_1 and JavaScript auto-appends key_2/val_2, then key_3/val_3 - hence "Infinite." The node reads every connected val_X, takes the string from the matching key_X, and builds a Python dict. Values keep their types (that's the point), and dict_out is typed * because a dict's type isn't something ComfyUI can nail down.
What it's good for. Bundling a set of related values so a single wire carries them - hand a dict of parameters to PyCode Max, where it lands in IN["custom_in_1"] and you can read IN["custom_in_1"]["strength"] inside your script. That's the natural pairing: Dict Packer feeds the pack's own Python node. It also gives you a named, order-preserving way to group values for anything downstream that consumes dicts. Keys sort by port number, so val_3 stays after val_1 regardless of connection order.
Where people get burned: two silent gotchas in the code. If a key_X field is empty, that entry is skipped entirely - no error, it just doesn't make it into the dict. And if a value is None (unwired optional input), it's skipped too. So an empty key or an unwired port quietly drops data you thought you were bundling. Also, remember the output is *: whatever you connect it to has to be a node that actually understands Python dicts, or it'll choke.
Install. ComfyUI Manager β search "Orion4D_MetaNode", or:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Orion4D_MetaNode
Restart ComfyUI. It lives under Orion4D_MetaNode/Utils. No dependencies beyond what ComfyUI already has.
It's a small utility, but if you use PyCode Max at all, it's the clean way to get structured data into your scripts instead of hardcoding values inside the code.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| key_1opt | STRING | param1 | β |
| val_1opt | * | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict_out | * | β |