Load Any ๐
Load a cached value from disk, or fall back if it's not there
- fallback
- value
LoadAny reads a value that was previously saved to disk and puts it back on the wire - and if the file isn't there, it quietly returns a fallback instead of erroring. It's a cache-read node for arbitrary data, and it's half of a two-node caching pattern with LoadOrCompute.
It's part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under ๐ Common.
Why you'd reach for it
Some things in a workflow are expensive to produce and boring to reproduce - an embedding, a captioning pass, a computed parameter, some intermediate blob you generated last session. If you've stashed one to disk, you want to reload it next time instead of recomputing. That's this node. The * (any) type on its output is the important part: it doesn't care whether the stored value is an image, a string, a dictionary, or something exotic - it round-trips whatever was saved.
The fallback is what makes it safe to leave in a graph permanently. Without it, a cache-read node blows up the first time (no file yet). With it, the first run takes the fallback path and later runs load the cached copy - so you can wire it once and it behaves correctly whether or not the cache exists.
How it works
You give it a file_path pointing at a saved value (the default output/cache/foo.pkl hints that it's Python-pickle serialization under the hood, which is why it can carry any type). If the file exists, it deserializes it and outputs the value. If the file doesn't exist, it outputs whatever you wired into fallback instead. No file, no fallback, and you'll get nothing useful - so in practice you either guarantee the file exists or you provide a fallback.
The inputs and outputs that matter
file_path(STRING, required) - where the cached value lives. Defaultoutput/cache/foo.pkl.fallback(any, optional) - what to return when the file isn't there. Wire in a default value, or the live computation you want to use on a cache miss.value(any, output) - the loaded value, or the fallback.
Installing it
ComfyUI Manager โ search ComfyUI-MieNodes โ install โ restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
then restart. No model download. Nodes appear under ๐ MieNodes.
Common issues & troubleshooting
Only load pickle files you created. Deserializing a pickle can execute arbitrary code - that's a property of the format, not this node. Never point LoadAny at a .pkl you got from someone else or downloaded. Your own cache files are fine; strangers' aren't.
It returns the fallback every time. That means the file at file_path doesn't exist. Check the path (relative paths resolve against ComfyUI's launch dir), and confirm something actually wrote the cache - usually LoadOrCompute or a save node earlier in your pipeline.
Type mismatch downstream. Because the output is *, ComfyUI won't warn you at wiring time if the stored value is the wrong shape for the node you feed it. If a loaded value errors downstream, confirm you cached the type you think you did.
You want it to write as well as read. LoadAny only reads. If you want "load if cached, otherwise compute and save," that's LoadOrCompute - the companion node that closes the loop.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | output/cache/foo.pkl | โ |
| fallbackopt | * | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | * | โ |