ComfyUI Node

Get Dict String

Pull text out of a dict

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

Get Dict String pulls a string - plain text - back out of a DICT by name. The text you'd carry through a dict is the labeling and prompting kind: a raw prompt string, a filename prefix, a model name, a style tag. Stash it under a key early and this node hands it back wherever it's needed - into a text-encode node, a save-filename, a string concatenation - without a long STRING wire across the graph.

This pairs neatly with the pack's loader nodes, which output a name_string (the checkpoint filename). Stash that in the dict and you can pull it into your save node's filename far downstream, so outputs come out self-labeled with the model that made them. More broadly, keeping shared text in the dict means you edit a prompt fragment or a prefix in one place and every node that reads it updates together.

How it works

It's a typed Get Dict, so per the README it works like the plain Get Dict plus two things: an optional default and type validation. Request a key; if the dict holds a real string there, out it comes. If the key's missing or the stored value isn't text, you get the default instead. Omit the default and the automatic fallback for this type is an empty string.

The inputs and outputs that matter

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

One output: STRING. Wire it into a CLIP Text Encode, a filename input, or a string-combining node.

Installing it

Lightweight pure-Python pack, no model downloads. ComfyUI Manager → Install Custom Nodes → search "antrobots ComfyUI Nodepack" → Install → restart, or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack

then restart. It's under antrobots-ComfyUI-nodepack/dicts/get.

Common issues

The automatic empty-string default is usually harmless but occasionally sneaky: a mistyped key silently yields "", and an empty prompt or empty filename doesn't error - it just produces a blank result you then have to trace back. If a prompt "came out empty" or a save filename lost its prefix, check that the key here matches the Set Dict key exactly. Typos fail quietly across the whole dict system.

Setting an explicit default is a good habit when the string genuinely matters - a fallback prompt or a placeholder filename beats a silent blank. And the DICT input is required, so make sure a real dict reaches this node. It's a small one-person pack, and the README's support model is straightforward: hit a real bug, open a GitHub issue - the author actively wants them.

Categoryantrobots-ComfyUI-nodepack/dicts/get

Inputs (3)

NameTypeDefaultDescription
keySTRING
DICTDICT
defaultoptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING