create from LISTs
Zip two lists into a dict — keys from one, values from the other
- keys
- values
- DICT
"create from LISTs" builds a dictionary by pairing two parallel lists: a list of keys and a list of values, position by position. It's dict(zip(keys, values)) with a ComfyUI face on it. You'd reach for this when you already have data as two aligned columns - a get keys values node gave you keys and values separately, a spreadsheet-style source produced two lists, or a batch node split your data down the middle - and you want them married back into key→value form.
This is one of the few create nodes here that takes two inputs instead of dynamic pairs, which makes it both simpler and more rigid: no partial pairs, no skipping, just position 0 with position 0, position 1 with position 1, and so on.
How it works
Two required inputs:
keys(LIST) - the key names.values(LIST) - the corresponding values.
The node pairs them with zip, which is the detail that matters: if the lists are different lengths, only pairs up to the shorter list are kept. Extra keys are dropped, extra values are dropped. There's no warning - your 12 keys and 11 values quietly become an 11-entry dict.
The common failure mode
Mismatched list lengths is the thing that bites everyone who uses this. The symptom isn't an error; it's a dict that's mysteriously missing the last entry or two. If you're building this from upstream lists that can vary, put a list length node on both sides first and reconcile, or accept the truncation deliberately. Also worth knowing: if a key appears twice, the later pair wins - standard dict overwrite behavior.
When it's the right tool
- Reassembling a dict from
get keys values, after you've filtered or reordered one of the lists. - Converting two-column data (names + scores, tags + weights) into a lookup dict in one step.
- Building a dict from generated sequences - a
create LISTof keys paired with acreate LISTof values.
For anything where keys and values naturally travel together, the pair-based create from items (LIST) is usually a better fit - it keeps each pair intact so they can't drift out of alignment. This node is for when the split has already happened and you need the join back.
Install
Ships in Basic data handling - pure Python, no dependencies, no model downloads. ComfyUI Manager → search "Basic data handling", or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
then restart ComfyUI. Small node, sharp edges (the silent truncation), but the cleanest way to zip two lists into a dict in the whole pack.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| keys | LIST | — | |
| values | LIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |