Set Dict Image
Stash an image in a dict by name
- IMAGE
- DICT
- DICT
Set Dict Image packs an IMAGE into a DICT under a name you choose, so you can carry it around your graph on one wire and pull it back out by name later. It's part of antrobot's dict system - a looser, name-your-own-slots alternative to fixed pipes. Where a BASIC_PIPE always holds the same five things, a DICT holds whatever you put in it, keyed by strings you pick. This is the node for stashing pictures in that bag.
The use case that makes it click: a workflow that juggles several images - an input photo, a reference, a mask preview, an intermediate result - and needs them available in different branches far apart on the canvas. Instead of dragging four IMAGE wires everywhere, you setDict each under a key and pass one tidy DICT along, getDict-ing the one you want where you want it. Same spirit as rgthree's Context wire, but you name the slots.
How it works
Set Dict is the core of the system, and the README describes it plainly: whatever value you feed in gets packaged into a DICT labeled with your key and sent out. Pass an existing DICT in as well and it appends your image to that dict rather than making a new one - which is how you build a bag with multiple entries, by chaining Set Dict nodes and threading the growing DICT through each.
The inputs and outputs that matter
- key (required, text) - the name you'll fetch this image by. Type the identical string into the matching Get Dict Image node later.
- IMAGE (required) - the picture to store.
- DICT (optional) - an existing dict to add to. Empty starts a new bag; wire the previous Set Dict's output in to keep appending.
One output: DICT, the bag with your image added. Chain it onward.
Installing it
Lightweight pure-Python pack - no weights, no heavy dependencies. ComfyUI Manager → Install Custom Nodes → search "antrobots ComfyUI Nodepack" → Install → restart, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack
then restart. It lands under antrobots-ComfyUI-nodepack/dicts/set.
Common issues
Keys are plain strings and mismatches fail quietly. Store under "ref" and later fetch "reference" and the Get node simply falls back to its default (or None) - no red error, just a missing or wrong image downstream. First thing to check when a dict workflow misbehaves is that the key matches exactly on both ends.
If you want several images in one bag, don't forget to feed each Set Dict the previous one's DICT output - skip that and every node starts a fresh dict, leaving you with only the last image. And a DICT only connects to the pack's own get/set/merge nodes; you retrieve the image with Get Dict Image, not a stock node. As with everything in this small solo pack, a genuine bug is best reported as a GitHub issue - the author asks for them in the README.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | — | |
| IMAGE | IMAGE | — | |
| DICTopt | DICT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |