Last Image (Zerna Pack)
Save only the last image from the batch — the output node nobody asks for, until they need it
- images
Last Image is a Save Image that keeps exactly one picture: the last one in the batch. It's the pack's least glamorous node and the one that reads like an answer to a very specific annoyance - you ran a batch sweep, you only care about the final result, and your output folder is now drowning in 40 near-identical PNGs. This node saves one and throws the rest away.
When you'd actually reach for it. Any workflow where the batch exists to get you to the end state. If you're iterating through a chain of prompts and only the last one matters - say, a final pass after a bunch of variations - this keeps your output/ folder honest. It's also handy if you're building a pipeline where an intermediate step is "produce a single kept image" and you don't want the full batch's worth of disk writes. If you want every image saved, use ComfyUI's built-in Save Image instead; this node is the deliberate drop-everything-but-the-finisher choice.
How it works. It takes the full IMAGE batch, indexes the last one (len(images) - 1), and writes it to ComfyUI's output directory with the same counter-based naming convention as the core Save Image node - filename_00001_.png, incrementing to avoid collisions. The filename_prefix input works exactly like Save Image's too: default "ComfyUI", and it accepts the %date:yyyy-MM-dd% and %Empty Latent Image.width% style formatting tokens for dynamic names. It's an output node - is_output_node - so it has no outputs, just the save side effect and a preview card in the UI.
The one real gotcha, and it's a doozy for some people: the source has the PNG metadata block commented out. The core Save Image node embeds the workflow and prompt JSON into the PNG so you can later drag the file back into ComfyUI to recover the graph. Last Image saves a bare image with metadata = None. No embedded workflow, no recoverable prompt from the file. If you rely on saved images as a workflow archive, this node is not for you. For a throwaway final frame, you won't notice.
Inputs. Two:
images- theIMAGEbatch to take the last frame from.filename_prefix- prefix for the saved file, with the formatting tokens mentioned above.
That's it. Nothing else to configure, no model or extra dependency.
Installing. Same pack, same story as the other three nodes. ComfyUI Manager, search "Zerna Pack", or:
cd ComfyUI/custom_nodes
git clone https://github.com/RaymondProduction/comfyui-zerna-pack
# restart ComfyUI
The pack has zero Python dependencies beyond ComfyUI core - requirements.txt is a comment - so there's nothing to pip install and no model files to fetch. This node uses PIL and numpy, both of which ship with ComfyUI.
Where people get burned. Mostly the metadata thing above - that's the one that bites people who assume "it's a Save Image, so it saves my workflow too." Also worth knowing: it doesn't slice the batch in any clever way, it just takes the final frame, so if you need the last N images or any other selection, this isn't the tool. It's a tiny, single-purpose node from a v0.0.1 pack, and it's honest about that. There's a place for nodes this simple.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The images to save. | |
| filename_prefix | STRING | ComfyUI | The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width%. |
Outputs (0)
No outputs