ComfyUI Node

Setter

Setter — name a value, stash it, and keep your workflow from turning into spaghetti

By komojini·Created 3 years ago·Updated 2 years ago· 77
Setter
  • value
  • *
key

Setter is the write side of the komojini pack's getter/setter pair - the node you use to give a value a name and make sure it's computed before something else needs it. You give it a key, you wire a value in, and it does two things: passes the value straight through to whatever you've got downstream, and stores it in the pack's in-memory key/value map under that key. A Getter (or CachedGetter) elsewhere in the graph with the same key can then pick that value back up.

The README frames the whole getter/setter family the same way every time: it's about execution order. ComfyUI executes nodes in dependency order, so if you want a sampling result or a loaded image to exist before a far-away node runs, the reliable way to guarantee that is a connection. A Setter connected upstream of where the value is consumed gives you that guarantee, and the key gives you a name to reason about. It's graph hygiene as a feature - the sort of thing that keeps a workflow readable instead of turning into the "Anything Anywhere" nightmare the community has explicitly told people to stop using.

How it behaves. The key is a text widget, and the UI treats these as the canonical list of names: any Getter in the graph offers every Setter's key as a dropdown choice. If you rename a Setter, matching Getter titles and types update to follow. The Python class is To, and its logic is simple - take the value input, write CACHED_MAP[key] = value, return the value. If you somehow feed it nothing, it warns and uses whatever the first input argument happens to be, so keep the wire connected.

Inputs and output. key (STRING, required) and an optional value (*, any type). One * output that just passes the value through. Because it's any-typed, you can stash images, latents, strings, numbers - anything.

Where it fits. This is a wiring node, so you'll reach for it on big workflows, not small ones. Pair it with CachedGetter when you want to retrieve without a physical wire, or with plain Getter when you want the ordering guarantee and an explicit connection. Note there are also FlowBuilder-flavored variants (FlowBuilderSetter etc.) that combine this store-by-key behavior with the pack's run-only-part-of-the-graph queue button - check the FlowBuilderSetter article for that.

Install. All of this ships in one pack:

ComfyUI Manager → search "komojini-comfyui-nodes" → Install → restart

or cd ComfyUI/custom_nodes && git clone https://github.com/komojini/komojini-comfyui-nodes. No models to download. The usual 2024-era pack caveat applies: the JS that renames and recolors getter/setter pairs was written against older LiteGraph internals, and ComfyUI's 2025 Nodes 2.0 frontend has already broken far better-maintained packs. If the auto-pairing looks half-broken on a fresh ComfyUI, that's the reason.

Categorysd

Inputs (2)

NameTypeDefaultDescription
keySTRING
valueopt*

Outputs (1)

NameTypeDescription
**