Save Image Batch ๐
Caching a raw image tensor, not exporting a PNG
- images
First thing to get straight, because the name invites the wrong assumption: this is not ComfyUI's built-in Save Image node with batching added. It doesn't write PNGs or JPEGs you can open and look at. The default file_path - output/cache/foo.pt - gives it away: .pt is a PyTorch file extension. This node dumps the raw IMAGE tensor to disk with torch.save, not a viewable picture.
What it's actually for. If you've generated a batch of frames or images partway through a longer pipeline and want to cache that exact tensor to reload later - resuming a long run without regenerating everything from scratch, handing the raw batch off to a separate script, or checkpointing an expensive step before you experiment with what comes after it - this is the node for that. It's deliberately not for producing shareable output; it's for saving your work mid-pipeline in the format ComfyUI itself uses internally.
The two inputs.
images(required, IMAGE) - the batch you're saving, straight off any node that outputs images. Batch size isn't limited by the node itself; it saves whatever tensor is on the wire.file_path(defaultoutput/cache/foo.pt) - where the.ptfile goes. Give every distinct save a distinct path if you're caching more than one batch, since there's no filename templating here - it's a literal path.
Like Save Any, this is a terminal node: is_output_node is set, there's no output socket, and it doesn't feed anything else downstream. It sits at the end of a branch.
Not in the README. This node isn't mentioned anywhere in the pack's documentation - no parameter table, no example workflow. The read above (that it's a PyTorch tensor cache rather than an image export) comes directly from the .pt extension in the schema's default path and from ComfyUI's own IMAGE tensor conventions, not from confirmed author docs.
Installing. ComfyUI Manager: search ComfyUI_MieNodes and install, or cd ComfyUI/custom_nodes && git clone https://github.com/MieMieeeee/ComfyUI-MieNodes and restart. No extra dependencies for this node specifically - it's built on PyTorch, which ComfyUI already requires.
Troubleshooting.
- You wanted a PNG and got a file you can't open in an image viewer. Wrong node - use ComfyUI's built-in Save Image (or this pack's
SaveAnythingAsFileif you need a specific text-based format) for anything meant to be viewed or shared. This node's output is only meaningful loaded back through PyTorch. - File doesn't show up where expected. Same as with Save Any:
file_pathis relative to wherever ComfyUI was launched from unless you give it an absolute path - check your working directory, and confirm theoutput/cache/folder actually exists before assuming the save silently failed. - File is much larger than you expected. A raw tensor saved uncompressed is typically bigger than the equivalent PNG or JPEG, since there's no image compression involved at all - for a large batch at high resolution, budget disk space accordingly.
- Loading the file back gives a shape or dtype you didn't expect. Whatever precision and shape the IMAGE tensor had at the moment you saved it is exactly what comes back - if an earlier node in your pipeline changed dtype or added a batch dimension you weren't tracking, that's baked into the saved file, not something this node alters.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | โ | |
| file_path | STRING | output/cache/foo.pt | โ |
Outputs (0)
No outputs