Nodes/BrainDead Nodes/BD Cache Any
ComfyUI Node

BD Cache Any

Pickle it when no typed cache exists

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Cache Any
  • data
  • data
  • status
cache_namecached_data
seed0
force_refreshfalse
name_prefix

The BrainDead cache family has a typed node for everything that matters - images, masks, latents, audio, strings, meshes, bundles, even TRELLIS2 internals. And then there's this: BD Cache Any, the one that serializes literally anything with pickle. It exists for the gap between the types that have a home and the weird stuff you actually produce: a custom struct, a COLOR_FIELD, a list of bboxes, a model-free intermediate object that doesn't map to any built-in type.

The lazy-evaluation mechanism is the same as every other cache node in the pack - on a hit, check_lazy_status returns an empty list so ComfyUI skips the upstream branch entirely and the object is loaded straight from disk. What's different is the serializer: Python's pickle, which means it round-trips any picklable object faithfully - no format conversion, no lossy PNG, no assumptions. The output is even typed * (ANY), so it plugs back into wherever the original object came from.

The inputs

  • data - the ANY-typed object to cache. Wire whatever it is.
  • cache_name - label (default cached_data). Pick something recognizable; there's no extension telling you what's inside.
  • seed - invalidation key, hashed into the filename. Change it to force a fresh computation.
  • force_refresh - True to overwrite the cache and rerun upstream.
  • name_prefix - optional path prefix under output/BrainDead_Cache/.

Outputs: data (ANY) and status (STRING).

When to reach for it

Reach for it when a computed object is expensive and has no dedicated cache node. Two honest warnings first. One: pickle files aren't human-readable and aren't portable across Python versions forever, so they're a working cache, not an archival format. Two - the security one - pickle is a code-execution format, and while this only reads files your own workflow wrote in your own cache folder, the moment you start feeding it files from other people or a shared drive, you're trusting them. Keep it to your own local cache and it's fine.

For anything the typed caches cover, use the typed cache. This node is the fallback, and it's happiest when you genuinely have no better option - which, given how many exotic types a pipeline like this produces, is more often than you'd guess.

Installing it

From BizaNator/ComfyUI-BrainDead (BrainDeadGuild). ComfyUI Manager → search "BrainDead" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

Restart; it's under 🧠BrainDead/Cache.

Gotchas

Same seed-keying rules as the whole family, and one extra: because the file is opaque pickle, a corrupted or half-written file gives you a load error rather than a clean "cache miss." If you hit that, just delete the file (or flip force_refresh) - the node falls back to rerunning upstream and rewrites it. And if the object you're caching isn't picklable, you'll know immediately, because the save fails and the node tells you upstream ran anyway.

Category🧠BrainDead/Cache

Inputs (5)

NameTypeDefaultDescription
data*
cache_nameSTRINGcached_data
seedINT00–18446744073709550000
force_refreshBOOLEANfalse
name_prefixoptSTRING

Outputs (2)

NameTypeDescription
data*
statusSTRING