int → Dict🗂️
Park a Number in the Dict Without a Wire
- dict
- dict
Seeds, steps, batch sizes, CFG multipliers - the most common values in a ComfyUI graph are integers, and they're usually scattered across half a dozen widgets. DictAddInt lets you collect the important ones into a dict that travels as one connection, so your seed and your steps ride the same wire as everything else.
It's part of the "basic type" trio (bool, int, float) that share a design: the value isn't a wired input, it's a spinner on the node itself. You type the number, name it, and move on. For anyone building the "bus" workflow the Dict Tools README pushes - put all your settings in one dict at the top, pass it around, extract where needed - this is how numbers get on board.
How it works
The value input is a full int widget: default 0, step 1, and the full 64-bit range. The node validates the value, stores it under your key, and returns a new frozendict - the input dict is never mutated, so you can chain Add nodes freely. Keys sort alphabetically on each update, so don't expect insertion order to survive.
The inputs that matter
- key (STRING) - the name you'll use to fetch this number back with DictExtractInt.
- cleanup_key (BOOL, default on) - trims spaces and extra newlines from the key.
- value (INT, default 0) - the spinner on the node. Set your seed or step count here.
- dict (DICT, optional) - an existing dict to extend, or empty for a fresh one.
Output is dict (DICT).
Install
ComfyUI Manager: search Dict Tools, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart after. The only dependency is frozendict, which Manager installs for you.
Gotchas
Pack-wide rule first: this pack is built on ComfyUI's newer node API and needs 0.18.0+. Failed to load in Manager? Update ComfyUI, not the pack.
The widget-only value catches a few people: you can't wire a seed from another node into this one. If the number needs to come from somewhere else in the graph (say, a random seed generator), use DictAddAny or wire the extractor's output where you need it instead. Also note ints and floats are distinct here - an integer key stored via DictAddInt won't validate as a float downstream unless you match the type.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | Key (name) of the item inserted into the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
| value | INT | 0-9223372036854776000–9223372036854776000 | The actual int-type item to add into the Dict. |
| dictopt | DICT | An (optional) Dictionary to work with. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |