ComfyUI Node

Get Dict Image

Pull an image out of a dict

By antrobot1234·Created 3 years ago·Updated about a year ago· 28
Get Dict Image
  • DICT
  • default
  • IMAGE
key

Get Dict Image pulls an IMAGE back out of a DICT by name - the retrieval partner to Set Dict Image. It's how a picture you stashed early in a workflow reaches a branch far away without a long dedicated wire snaking across the canvas. In a graph that juggles several images - an input photo, a reference, a mask preview, an intermediate result - stashing each under a key and fetching the one you want here keeps the wiring sane.

The dict approach really pays off when images need to be available in multiple, distant branches. A reference image consumed by both a ControlNet stage and a final composite, for instance: stash it once, getDict it in each place. One tidy DICT wire instead of forked IMAGE cables everywhere.

How it works

It's a typed Get Dict, so per the README it acts like the plain Get Dict with two additions: the default is optional, and the value is type-validated. Give it a key; if the dict holds a real image there, out it comes. If the key's missing or the stored value isn't an image, you get the default instead - no crash, just the fallback.

The inputs and outputs that matter

  • key (required, text) - the name the image was stored under. Match the Set Dict key exactly.
  • DICT (required) - the bag to read from.
  • default (optional) - an IMAGE to fall back on if the key is missing or the wrong type.

One output: IMAGE. Wire it into a preview, a sampler's img2img input, a compositing node - wherever the picture's needed.

Installing it

Lightweight pure-Python pack, no model downloads or heavy deps. 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. Find it under antrobots-ComfyUI-nodepack/dicts/get.

Common issues

For an image, the optional default is doing real work. If the key isn't found and you left the default empty, the automatic fallback is essentially "no image" - and most downstream nodes (a compositor, a sampler) can't do anything useful with that and will error. So either guarantee the key exists in the dict, or wire in a genuine placeholder image as the default.

The rest are the standard dict pitfalls: keys are case-sensitive strings and a typo silently returns the default rather than raising an error, and the DICT input is required. When a stashed image "vanishes," check that the key here matches the one on the Set Dict Image node character-for-character. It's a small solo pack, and the README asks you to open a GitHub issue for genuine bugs.

Categoryantrobots-ComfyUI-nodepack/dicts/get

Inputs (3)

NameTypeDefaultDescription
keySTRING
DICTDICT
defaultoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE