ComfyUI Node

Set Dict String

Stash a text value in a ComfyUI dict bundle

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

Say you're bundling up a pile of workflow values to carry across the graph on one wire, and one of them is a piece of text: a filename prefix, a trigger word, a caption, a snippet of positive prompt. That's what Set Dict String is for. It's the text-flavored member of the antrobots dict family, and it drops a string into a DICT bundle under a name you choose so you can pull it back out later somewhere else.

If you've read the plain Set Dict page, the concept's identical. The whole point of these nodes is to pack a bunch of values into one container and pass that around instead of running a rat's nest of individual wires - the same job rgthree's Context nodes do, just as an open-ended keyed grab-bag rather than fixed typed slots. Set Dict String is the same node with the value slot locked to text.

Why the typed version instead of plain Set Dict

Fair question, since the base Set Dict already takes any type and would happily accept a string. The difference is convenience: Set Dict String gives you an actual text field on the node, so you can type the value right there without wiring in a separate primitive. There's a symmetry to it too - you set a string with this and fetch it later with the string-typed Get Dict, which validates that what comes back really is text and hands you a safe default if it isn't. Set with a type, get with a type.

How it works

A "dict" here is a Python dictionary riding on a custom DICT wire. Give the node a key, a STRING value, and nothing else, and it makes a fresh one-key bundle. Give it a key, a STRING, and an existing DICT, and it appends to that bundle and passes the whole thing on. You chain these - output of one into the DICT input of the next - to build a bundle up piece by piece.

The inputs and outputs that matter

  • key (string) - the label you'll fetch this text by later. Get Dict matches it as an exact string, so mind the spelling and the capitals.
  • STRING - the text itself. Single-line (not a multiline box), typed inline or wired in from another node.
  • DICT (optional) - an existing bundle to append to; leave it empty to start a new one.

Output is a single DICT, headed for the next Set Dict or, eventually, a Get Dict.

Installing it

Grab the whole pack, not just the node. Via ComfyUI Manager, open Install Custom Nodes, search antrobots ComfyUI Nodepack, install, restart. Or manually:

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

and restart. No model downloads, no dependency drama - it's plain Python, so installation is about as painless as custom nodes get.

Common issues

The classic gotcha is the exact-key match. If the Get Dict on the other end reads a key that doesn't match what you set here, character for character, it silently returns the default instead of your text. No error, just the wrong string. Check both ends when something looks off.

Note also that the field is single-line. If you're trying to carry a big multi-paragraph prompt through, this widget isn't built for comfortable editing of that - you're better off wiring your text in from a dedicated multiline node and letting Set Dict String just bundle the reference.

And remember the DICT type is antrobots-only. It won't plug into a stock node; the bundle has to come back out through a Get Dict. Since this is a small, quiet, single-maintainer pack with next to no community chatter, the README's advice to open a GitHub issue is genuinely your best bet if you hit a bug.

Categoryantrobots-ComfyUI-nodepack/dicts/set

Inputs (3)

NameTypeDefaultDescription
keySTRING
STRINGSTRING
DICToptDICT

Outputs (1)

NameTypeDescription
DICTDICT