Cache Bridge (Inspire)
Flip One Switch and Everything Upstream Stops Running
- data
- data
You know the thing where you're iterating on the sampler only, and ComfyUI still spends 40 seconds loading the checkpoint and encoding your 900-token prompt every single run? Cache Bridge is aimed straight at that. Drop it in the wire, let it cache what comes through, and from then on the entire upstream half of your graph is skipped - you can even mute it.
What it is
It's a cache that sits inline in a link. Cache Backend Data (Inspire) and friends already exist for explicit store/retrieve pairs, but they need two nodes and some thought. Cache Bridge is one node: data in, same data out, cached under a key you name. The cache is Inspire's backend cache - server memory, shared across workflows, gone when the server restarts.
How it convinces ComfyUI not to run your loaders
This is the interesting part and it's why the node isn't just "store it and read it back". data is declared as a lazy input. Lazy inputs are the engine's escape hatch for optional work: the node gets asked, before anything upstream executes, whether it actually wants the value this time. Cache Bridge answers "no" whenever it already has something cached under key and the trigger value hasn't changed - so the loader node upstream simply never runs. Nothing is fetched, nothing is recomputed, and muting the upstream chain is safe.
Flip trigger and the answer becomes "yes" for exactly one run: upstream executes, the fresh data replaces what's cached, and it comes out of the node in that same run. Then it goes quiet again, holding the new value. Either position holds - only the change matters.
There's a second piece that matters just as much: the node's change-detection returns a hash of the cache, not a constant. So when the cached blob really did change, everything downstream re-executes; when it didn't, downstream keeps its own cached state. That's the difference between a useful cache and a node that poisons the whole graph.
Inputs and outputs
- key - the string it caches under. Use something you'll recognise months later:
sdxl-base-model,prompt-encoded-v3. - tag - a short description, for the human looking at the cache later rather than for the lookup.
- trigger - the boolean you flip. Both positions are equivalent; it's the flip that counts.
- data (optional, any type) - what you want frozen. Because it's untyped, you can put a MODEL, a CONDITIONING, a latent, an image batch, whatever, on it.
- data out - as a list, in the output sense. Expect to feed list-aware consumers; if the downstream node wants a bare IMAGE, you may need a list-to-batch adapter.
The trap in the trigger
The tooltip says it plainly and it's worth repeating here because it catches people. The triggered run takes what the upstream nodes produce on that run - not the result of the previous run. If those nodes respond to a widget change, you get a genuinely new result. If a seed upstream randomizes after every queue, then your "refresh the cache" flip regenerates with a new seed, which is probably not what you meant. Freeze the seed first, then flip.
Also: the data does not survive a restart, and the backend cache keeps a bounded number of entries per tag (20 by default). Working cache, not filing cabinet.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
pip install -r ComfyUI-Inspire-Pack/requirements.txt
Or search "ComfyUI Inspire Pack" in ComfyUI Manager and restart. Requirements are matplotlib, cachetools, numpy, webcolors, opencv-python - nothing exotic, and no model downloads. The backend cache needs no configuration for this node.
When it's the wrong tool
If you want to freeze a loaded model across workflows, Shared Checkpoint Loader (Inspire) does that job with a cache built in. If you want to inspect or clear what's cached, Show Cached Info (Inspire) and Remove Backend Data (Inspire) are the pair. Cache Bridge is for the "I keep re-running an expensive middle section while tweaking the end of the graph" case, and for that it's about as frictionless as ComfyUI gets.
Troubleshooting
[CacheBridge] Nothing is cached under '<key>' means the node has no source and won't invent one. Either the trigger never flipped since the server started, or data is unlinked, or the node feeding it is muted so the link isn't in the prompt at all. Unmute, connect, run.
If the node seems to ignore your flip, check the upstream chain's execution state: bypassed nodes pass through, muted nodes don't, and a lazy input that can't be resolved is an error rather than a silent skip.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | — | |
| tag | STRING | — | |
| trigger | BOOLEAN | false | Flipping this switch, in either direction, is the trigger. Either position holds; only the change counts. On the run after a flip, this node takes its input: the nodes before it run, the data cached under `key` is replaced, and the new data is output in that same run. While it is not flipped, the cached data is output and the nodes before this node do not run. The data taken is what the nodes before make on that run, not something that arrived earlier. If their widgets are as on their last run, ComfyUI gives the same result again without running them. If a seed there changes after every queue, the triggered run makes a new result, not the one of the run before. |
| dataopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| data | * | — |