Load Image Batch ๐
Reload a cached image tensor from disk
- fallback
- images
LoadImageBatch loads a saved image tensor (a .pt file) back off disk and hands it to your graph as an IMAGE. It's not the everyday "load a PNG" node - despite the name it's a caching helper, meant to reload a batch of images you previously stashed so you don't have to regenerate them.
It's one of the "Common" utility nodes in ComfyUI-MieNodes, MieMieeeee's pack, and it's the kind of thing that only makes sense once you've hit the problem it solves.
What it's for
ComfyUI reruns your whole graph a lot, and some upstream steps are slow or expensive - an image batch that took a minute to produce, say. If a later part of your workflow keeps consuming that same batch while you iterate on the downstream nodes, regenerating it every run is pure waste. The pattern the pack supports is: compute the batch once, save it to a .pt file, and from then on LoadImageBatch pulls the tensor straight off disk. The rest of your experimentation runs against the cached copy instantly. (The pack ships small hashing helpers precisely to build stable cache-key filenames for this kind of thing - the .pt cache is a first-class idea here, not a hack.)
Think of it as the read side of a manual cache. It's a niche tool, but when you're doing lots of tweaking against a fixed set of source images, it turns a slow loop into a fast one.
How it works
file_path(required) - path to the saved tensor, e.g.output/cache/foo.pt. This is the cached IMAGE batch you want back.fallback(optional, IMAGE) - an image to return if the file atfile_pathdoesn't exist yet. This is the part that keeps the pattern from crashing: on the first run, before anything's been cached, the file isn't there, andfallbackis what comes out instead of an error. Wire your live image source intofallbackand the graph works on run one and speeds up on run two.
The single output is images (IMAGE) - either the loaded tensor, or the fallback if the file's missing.
Installing it
Install the pack. ComfyUI Manager โ search ComfyUI-MieNodes (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 the sheep-emoji ๐ MieNodes menu.
Common issues
A .pt is not a PNG. If you're looking for a node to load ordinary image files from a folder, this isn't it - the file it wants is a serialized PyTorch tensor written by a companion save step, not a photo. Point it at a .jpg and it won't do anything sensible.
Wire up fallback or the first run breaks. With no fallback and no cached file, there's nothing to output and the graph errors. The whole pattern depends on fallback covering the cold-start case, so treat it as effectively required even though the socket is optional.
Stale cache bites. If you change the upstream that produces the batch but keep loading the same .pt, you'll silently keep using the old images - the classic caching trap. Delete or rename the cache file when the source changes, or key the filename off the inputs so a change produces a new path. This is a general truth across the ComfyUI ecosystem: a cache that doesn't know when it's stale will happily hand you yesterday's result.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | output/cache/foo.pt | โ |
| fallbackopt | IMAGE | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | โ |