ComfyUI Node

create DICT

Build config dicts without leaving the graph

By StableLlama·Created about a year ago·Updated 4 days ago· 48
create DICT
  • value_0
  • DICT
key_0

"create DICT" is the workhorse of the whole DICT section in Basic data handling, and the one you'll reach for first. A lot of the other nodes in this pack - merge, get, filter, pop - only exist because this one can build a dictionary in the first place. If you've ever wished you could carry a bundle of related values down a single wire instead of dragging five separate ones, this is the node that lets you.

A DICT here is just a Python dictionary: a set of key: value pairs, like {"style": "cinematic", "steps": 8}. ComfyUI doesn't have a native dict type, so the pack defines its own DICT port type and this node is how you create one. Wire the result into another Basic-data-handling node - or any node that accepts a DICT - and the whole bundle travels together.

How it works

The node starts with a single key_0 (a STRING) and value_0 (anything, type *) pair, then uses the pack's dynamic-input system to let you add more pairs as you need them - key_1/value_1, key_2/value_2, and so on. On execution it walks every pair that's actually connected and builds the dict from them. Two things to notice:

  • A pair is only included if both its key and value are connected. An unconnected value_3 with a connected key_3 just gets skipped - no error.
  • The key is a plain string, so everything ends up string-keyed. That's fine for config and metadata; it's why the type-specific siblings (create DICT from INTs, etc.) exist for when you need typed values.

Inputs and outputs

  • key_0 (STRING) - the name of the entry.
  • value_0 (*) - the value, any type.
  • Output: DICT - the assembled dictionary.

Both inputs are optional, so an empty dict is technically a valid output. In practice you'll always wire in at least one pair.

Install

This ships inside Basic data handling, which has zero external dependencies and downloads no models - it's pure Python. Easiest path:

cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling

then restart ComfyUI. Or use ComfyUI Manager: search "Basic data handling" and hit install.

Where you'd use it

The classic case is assembling a metadata or settings dict that other nodes read back: gather a checkpoint name, a seed, a CFG, and dump them into one dict for a save node or a text formatter. It's also the glue for the pack's own flow - merge several of these together, then get specific values back out downstream. For video work it shows up in shared workflows that need to bundle prompt parts and timings before passing them along, which is exactly the pattern you'll see in community workflows that list basic_data_handling as a dependency.

One honest caveat: this is a tooling node, not a magic one. If you only ever need two hardcoded values in a workflow, a couple of reroutes do the same job with less ceremony. The dict pays off when the bundle gets reused, merged, or passed to a node that wants a dict - that's when it stops being fiddly and starts being the cleanest wire in your graph.

CategoryBasic/DICT

Inputs (2)

NameTypeDefaultDescription
key_0optSTRING
value_0opt*

Outputs (1)

NameTypeDescription
DICTDICT