CachedGetter
CachedGetter — wireless retrieval for the komojini getter/setter trick
- value
- *
CachedGetter is the Getter that actually does the looking-up. Where the plain Getter is a pass-through that just forces execution order, CachedGetter reads the value a Setter stashed under a key - no wire required. It's the closest thing this pack has to teleporting a value across your graph.
Here's the flow. A Setter (the pack's To node) writes whatever you feed it into a shared in-memory map: CACHED_MAP[key] = value. A CachedGetter later in the run asks for that key and gets the stored value back, even if there's no physical connection between them. If the key isn't in the map yet, CachedGetter caches whatever value happens to be on its own value input and returns that - hence the name. The UI even gives it a Get_<key> (cached) title so you can tell it apart from the plain Getter.
Why you'd use it. When a big workflow needs the same latent, image, or string in several places, the alternative is either duplicate nodes or a rat's nest of wires. A Setter at the source plus a few CachedGetters at the consumers keeps the graph flat. The price is the same one the whole "route anything anywhere" family pays: invisible data flow is harder to debug. The community has a standing grumble about this exact pattern (a +96 r/comfyui thread told people to stop using Anything Anywhere), and the komojini version is only safe because the key names keep it legible. Don't use it to hide data flow on a workflow someone else has to maintain.
Order still matters. ComfyUI runs nodes in dependency order, and a cached read only works if the Setter has already executed. If you place the CachedGetter in a branch that runs before the Setter, you'll get whatever was previously cached - or, on a fresh run, the node will log "There is no cached data for {key}. Caching new data..." and store what it happened to receive. If you're chasing a stale-value bug, that log line is your first clue. When ordering is critical, wire the Setter into something upstream of the getter, or use the plain Getter with a real connection - that's the ordering-guaranteed path.
Inputs and output. key (STRING, required), optional value (*), and a single * output. Same skeleton as every getter/setter node in the pack. The key dropdown is populated from the Setters currently in your graph, so you can't easily typo a key name.
Install. Part of komojini-comfyui-nodes, so:
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 fetch. One honest caveat: this is a Feb-2024 pack and the auto-pairing JS leans on older ComfyUI internals, so on a current build the dropdown-and-rename magic may be flakier than the README implies. When in doubt, wire the Setter into the same branch and let execution order do the work.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | — | |
| valueopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |