Get Value (Global)
The other half of a variable pair, and where the ordering bites
- trigger_order
- fallback_value
- value
Get Value (Global) reads back whatever Set Value (Global) stashed under a key. Sounds like magic. It works, with one rule you have to respect or it silently hands you nothing.
What it's for
ComfyUI has no global variables. Everything moves along wires, and a wire that has to cross a large canvas is where workflow readability goes to die - you either drag a line across twenty nodes or you duplicate the value. rgthree solved the same problem with its Context bus, and packs like Efficiency Nodes and Easy-Use solved it with pipe dicts; the cost of all of them is a single wire that hides what's inside it. This pair is the cheapest possible version of that idea: a string key, a value, and no type.
Which is useful precisely when you don't want to restructure. A resolution you set once and read in four places. A prompt fragment produced on one side of the graph and consumed three columns away. A boolean that comes out of an Is Empty check and needs to reach a sampler on the far side. You set it, you get it, no forty-wire bundle.
Fair warning about the evidence base: this pack is a one-person utility set built around its author's Ultimate Model Tester workflow, and searching the community archives returns essentially nothing about it - zero threads naming the pack at all. That's not a knock; it just means there's no crowd-sourced folklore to fall back on, and the source is the documentation.
How it works
The pack keeps a module-level dict, GLOBAL_SHARED_STATE, in the same Python file as both nodes. Set Value writes into it; Get Value reads out of it. Practically: the store lives in the ComfyUI server process, so values persist between queue runs and vanish on restart. Nothing is saved into your workflow file except the key.
Inputs on this node:
key- the lookup name, defaultmy_variable. Must match the setter's key exactly, because it's a plain dict lookup.trigger_order- optional, any type. This is the important one. ComfyUI executes a node only when its inputs are ready, and the key is a string widget, so nothing ties this node to the setter in the dependency graph. Wiring the setter'svalue_passthroughoutput intotrigger_orderis what forces the getter to wait until the value exists.pass_value- a boolean, default on. Forced to be a wire, so you can't toggle it with a click. When it's False the node returnsfallback_valueinstead.fallback_value- any type. Pair it withEmptyfrom this pack so a disabled branch gets a blank string or blank latent rather thanNone.
One output, value, typed * - a wildcard, so it accepts any consumer socket.
Installing it
Ships with 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 step and no downloads - the repo's requirements.txt is empty and the README confirms nothing is needed beyond stock ComfyUI.
Search Get Value (Global), category MDSNodes/Routing.
Common issues
It returns nothing, and nothing errored. This is the classic. The getter ran before the setter because nothing ordered them. Add the trigger_order wire. It carries no data you care about; its only job is to be a dependency.
It returned None and the downstream node exploded with a type error. An unset key reads as None, not as an error. Always supply a fallback_value - Empty exists for exactly this - and switch branches off pass_value rather than hoping the key is populated.
A value leaked from a previous run. Expected: the store lives in the server process for the whole session. If you're iterating on a branch, remember the old value is still sitting there until something overwrites it - and if two workflows both use my_variable, they're writing to the same slot. Name keys like mds/model_name and mds/face_cfg, not value.
You restarted and it broke. Also expected. The dict is in memory, nothing is persisted, and any workflow you share will re-derive it on first run - provided the setter is upstream of the getter.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | my_variable | The unique name/key of the stored variable to retrieve. |
| trigger_orderopt | * | Connect the passthrough from MarSetValue here to force ComfyUI to wait. | |
| pass_valueopt | BOOLEAN | true | If True, outputs the retrieved value. If False, outputs the fallback_value (or None). |
| fallback_valueopt | * | Optional: Connect an empty variable (e.g., empty string, empty latent) here to be output when pass_value is False. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | * | — |