ComfyUI Node

Set Dict Int

Park an integer in a ComfyUI dict bus

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

Half the numbers floating around a ComfyUI graph are integers: seeds, step counts, width and height, batch sizes, frame counts. Set Dict Int is the node that scoops one of those up and tucks it into a DICT bundle so it can ride across the workflow on a single wire instead of a long dedicated one. Later, a Get Dict node reads it back out by name.

It's one node in the antrobots dict family, and the family all does the same trick: pack values into one keyed container and pass that around rather than wiring everything point to point. If you've ever used rgthree's Context nodes to keep a big graph legible, this is the same instinct - just an open-ended bag where you name the slots yourself instead of a fixed set of typed ones. Set Dict Int is the version with the value locked to a whole number.

Why not just use plain Set Dict

Base Set Dict takes any type and would accept an int fine. What the typed variant buys you is a number field right on the node, so you can set the value inline without wiring in a primitive, plus a matching int-typed Get Dict on the other end that checks the value really is an integer and falls back to a sensible default if something went sideways. Set with a type, get the same type back, no surprises.

How it works

A dict here is a Python dictionary carried on a custom DICT wire. Feed the node just a key and an INT and it starts a new one-key bundle. Feed it a key, an INT, and an existing DICT and it appends to that bundle and hands the whole thing forward. Chain them - each node's output into the next node's DICT input - and you build a bundle up value by value.

The inputs and outputs that matter

  • key (string) - the name you'll fetch this number by later. Get Dict matches it exactly, so a typo means a miss.
  • INT - the integer, default 0. Type it into the widget or wire it in.
  • DICT (optional) - an existing bundle to add to; empty means start fresh.

The output is a single DICT that flows to the next Set Dict or off to a Get Dict when you're ready to unpack.

Installing it

Install the pack as a whole. In ComfyUI Manager: Install Custom Nodes, search antrobots ComfyUI Nodepack, install, restart. Or by hand:

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

then restart ComfyUI. It's pure Python with no models to fetch and no awkward dependencies, so you dodge the usual custom-node install grief.

Common issues

One thing worth flagging for integers specifically: if you're stashing a seed, make sure you're storing the number you actually generated with, not a control_after_generate placeholder. Bundle the value after it's resolved, or the Get Dict on the far side will hand you a stale seed and your "reproduction" won't match.

Beyond that it's the family's standard trap: keys are matched as exact strings, so a spelling or capitalization mismatch between here and the Get Dict silently returns the default with no error. And the DICT type is antrobots-only - it reads back out through a Get Dict, never straight into a stock node. This is a small, barely-discussed pack maintained by one person, so if a real bug turns up, the README's suggestion to file a GitHub issue is the sensible path.

Categoryantrobots-ComfyUI-nodepack/dicts/set

Inputs (3)

NameTypeDefaultDescription
keySTRING
INTINT0
DICToptDICT

Outputs (1)

NameTypeDescription
DICTDICT