Cache Backend Data List [NumberKey] (Inspire)
Cache a whole list under a number key
- data
- data opt
This one is the intersection of two things Inspire's cache does: it takes a list and it uses a number as the key. It stores the whole list in ComfyUI's memory under an integer key, and hands it back as a list when you retrieve it with the matching NumberKey retrieve node. If you've been chasing why your list keeps getting clobbered in the cache, this is very likely the node you actually wanted.
Two problems it solves at once. First, lists: ComfyUI runs a node once per list item, so a non-list cache node fed a list just overwrites the same key repeatedly and keeps only the last element - this node instead combines the list and stores it whole. Second, number keys: when you're automating or iterating with a counter, an integer key (0, 1, 2…) is easier to generate than a formatted string. Put those together and you get "cache these list results at slot N," which is the shape a lot of batch-automation graphs need.
How it works
Inspire's backend cache is a key→value store kept in the backend process, outside the graph, so it persists across queue runs and workflow switches and is wiped on a ComfyUI restart (memory, not disk). This node writes a list into that store under an integer key, tagged with tag, and the retrieve side returns it as a list. The value type is a wildcard, so the list can hold anything - images, latents, strings.
The inputs and outputs that matter
key(INT) - the number you store under and retrieve by. Reuse it to overwrite; use the same number in the NumberKey retrieve node to read the list back.tag(STRING) - a grouping label with a per-tag max entry count (default around 5). Exceed it and the oldest entries under that tag are evicted.data(type*) - the list you're caching.
The output is data opt (type *, a list) - a pass-through of the cached list, so the node can splice inline in a chain. It's also an output node, so it can terminate a branch purely to cache.
How to install it
ComfyUI Manager: search ComfyUI Inspire Pack, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
then restart. It's from Dr.Lt.Data (ComfyUI-Manager, Impact Pack).
Common issues & troubleshooting
My list came back as a single item, or only the last element cached. You probably used a non-List cache node on a list, which overwrites the same key per item. This List version is the fix - it stores the combined list. If you truly want one entry per item, give each element a unique key instead.
Retrieve returns nothing / not a list. Match the integer key exactly, retrieve with the NumberKey retrieve node, and make sure the cache node ran first (run the caching workflow before the consuming one if they're separate).
Gone after a restart. Expected - it's an in-memory cache. Persist to disk if you need it to survive.
An entry vanished by itself. Tag size cap (default ~5) evicting the oldest under that tag. Give important lists their own tag, or bump the tag size via Show Cached Info.
Execution order looks wrong. ComfyUI doesn't order unconnected branches; chain through the data opt pass-through to force a dependency.
Memory climbs. Big lists cached and never freed. Use Remove Backend Data [NumberKey] to clear a slot when you're done.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key | INT | 00–18446744073709550000 | — |
| tag | STRING | — | |
| data | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| data opt | * | — |