🔵Image → Dict🗂️
Images In, One Wire Out
- dict
- value
- dict
If you're stitching together an img2img pipeline, a reference-image pass, or a multi-stage workflow, images are usually the thing that gets dragged all over the canvas. DictAddImage tucks one into your dict under a named key, so the source image, the upscaled result, or the reference photo all travel as part of a single connection.
It's the media-type Add node you'll reach for most, since images are the currency of the whole ecosystem. The IMAGE value is a wired input - you connect it from Load Image, a VAE Decode, or wherever your image came from - and it gets type-checked before being stored.
How it works
Standard Dict Tools behavior: validate the value against the IMAGE type, store it under your key, return a new frozendict. Your input dict is never mutated in place, so chaining a bunch of Add nodes - image here, mask there, latent somewhere else - is safe and each hands you a fresh updated dict. Keys are sorted alphabetically on every update.
The pattern that makes this worth it: collect your input image and your settings dict at the top of the graph, pass the whole thing to a reusable sub-graph, and use DictExtractImage at the point where you actually need the pixels. Your bus carries both the instructions and the raw material.
The inputs that matter
- key (STRING) - the name you'll fetch the image back by.
- cleanup_key (BOOL, default on) - trims stray spaces/newlines from the key.
- dict (DICT, optional) - an existing dict to extend, or empty to start one.
- value (IMAGE, optional) - the wired image tensor from your loader or decoder.
Output is dict (DICT).
Install
ComfyUI Manager: search Dict Tools, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart ComfyUI after. Only dependency is frozendict, auto-installed by Manager.
Gotchas
Pack-wide rule: the pack is built on ComfyUI's newer node API and needs 0.18.0+. If Manager reports failed to load, update ComfyUI first.
The input being optional is where people trip: leave value unwired and the node silently stores nothing meaningful under that key - you won't notice until DictExtractImage downstream fails or returns nothing. Always double-check you actually connected the image port, not just the dict chain. And if you're storing the output of a VAE Decode, that's the right type; a latent is not, and the type check will tell you.
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. |
| dictopt | DICT | An (optional) Dictionary to work with. | |
| valueopt | IMAGE | The actual Image-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |