Set Value (Global)
Stash anything, fetch it anywhere, and mind the execution order
- value
- value_passthrough
This is the write half of a two-node variable system: give it a key, give it a value of any type, and it stores it in a dictionary that lives inside the ComfyUI server.
What it's for
ComfyUI is a dataflow language with no variables. Every value travels along a wire, so a value needed in three places gets three wires - or three copies, which is worse because copies drift. This node breaks the value out of the flow entirely: it goes into a named slot in memory, and Get Value (Global) pulls it back out wherever you are on the canvas.
The honest use case is legibility, not computation. A large workflow, a value produced early on the left and consumed at the far right, and no desire to drag a wire across the entire graph. It's the same instinct that produced rgthree's Context and the pipe dicts in Efficiency Nodes and Easy-Use, minus the type bundle - here you get one value per key and no structure at all.
The second use case is a template you hand to someone else. The setter names its slot, the getter reads it, and the connection between them is a string in two places rather than a wire - which is either elegant or terrifying depending on how much you trust string matching. Both nodes ship together, so at least the spellings start out consistent.
How it works
The two classes share a module-level dict, GLOBAL_SHARED_STATE, in the pack's source. Set Value writes key -> value; the getter reads it back. The lifetime is the server process, so values survive between queued runs and disappear on restart. Nothing is saved into your workflow except the key text.
Inputs:
key- a string, defaultmy_variable. Namespace it.mds/cfgbeatscfg, because everything in the same server process shares one dictionary.value- typed*, so it accepts anything: MODEL, CLIP, LATENT, IMAGE, a string, a dict, an int.
Output: one socket, value_passthrough, also *. It's the same object you put in, passed straight through, which means the node can sit inline on a wire if you want - or stand alone doing nothing visible at all, which is the neat part: the class sets itself as an output node, so it runs even with its output unconnected. A pure side-effect node.
Installing it
ComfyUI-MDSNodes by MarwanDSAI. ComfyUI Manager: search ComfyUI-MDSNodes or MDSNodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MarwanDSAI/comfyui-mdsnodes
# restart ComfyUI
No pip installs and no downloads; the repo's requirements.txt is empty and the README says no extra packages are needed.
Search Set Value (Global), category MDSNodes/Routing. It's designed to be paired with Get Value (Global), and the pair is the whole system.
Common issues
The getter got None. The setter ran after it. Nothing in the graph orders these two - the link between them is a dictionary key, not a wire - so ComfyUI is free to execute the reader first. The fix is on the getter: wire this node's value_passthrough into its trigger_order input, which carries no data and exists purely to impose the dependency.
A value from a previous run leaked into this one. Expected behaviour. The dict is process-wide, so the last run's value is still sitting there. If you're iterating on a branch, that stale value is live until something overwrites it.
Two workflows are fighting. Also expected: same process, same dictionary. Keys are global. Prefix them.
"Any type" is not as free as it looks. The wildcard accepts the connection, but whatever the getter is wired into still type-checks on its end - hand a string to a sampler's latent input and it'll fail there instead. The wildcard moves the error, it doesn't remove it.
It vanished on restart. Nothing is persisted. If a value absolutely must survive, it isn't a runtime variable; write it somewhere real.
Missing from the node list. Both global-value nodes arrived in pack version 1.8.0 (September 2026). Update in Manager and restart.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | my_variable | The unique name/key to store the value under. |
| value | * | The data or connection you want to store. Accepts any type. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value_passthrough | * | — |