Last Frame => Base64
The closing frame of a video, as a base64 string — no files touched
- images
- base64
The frame at the end of the line
Last Frame => Base64 is the mirror image of its sibling First Frame => Base64: feed it a batch of images or video frames, and it returns the last frame - images[-1] - as a base64-encoded PNG string. One input, one output, one frame, zero files written.
Why the last frame specifically? For video generation, the final frame is often the one that matters most. It's the "result" of a video pipeline, the frame a client wants back as a preview or thumbnail. It's also the natural anchor for continuation work - if you're chaining generations, the last frame of clip A is exactly what clip B needs to start from, and sending it as base64 over the ComfyUI API (which is JSON and can't carry raw pixels) is the cleanest way to do that. No temp files, no disk cleanup, no path juggling between processes.
How it works
Same mechanism as its twin, just on the other end of the batch. The node takes your IMAGE batch, slices out the final frame, clamps pixel values to the 0–1 range, converts to a PIL image, encodes it as PNG in memory, and base64-encodes those bytes into a single string. That string is raw PNG data - no data:image/png;base64, prefix - so whatever receives it has to add that header itself if it expects a data URI.
Input and output
- images (IMAGE) - the batch. Feed it a video's frames or any multi-frame stack.
- base64 (STRING) - the last frame, PNG-encoded.
That's the whole interface: one required input, one string output. If you feed it a single image, images[-1] is that image and you get it back as base64 - the node works fine on single frames too.
Installing it
Same pack, same install. Search ComfyUI-Base64-Nodes in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/dewittethomas/ComfyUI-Base64-Nodes
pip install -r requirements.txt
Restart and look for Last Frame => Base64 under the Base64-Nodes category. No models to download; the pack's only dependency is imageio-ffmpeg, and this node doesn't even need ffmpeg - it's PIL and base64 all the way down.
Where people get burned
- One string, one frame. The output is just the final frame, never the whole batch. If you need every frame encoded, this isn't the node.
- It's invisible. No preview renders, no file appears. To do anything with the string, wire it into an API call or stream it to a client via the pack's Save Base64 (Websocket) node.
- Raw base64, no prefix. Clients expecting
data:image/png;base64,...need to add it themselves.
Between the two frame nodes, pick by what you need downstream: first frame for previews and reference, last frame for results and continuation. They're both tiny, MIT-licensed, and dependency-light - the kind of utility node that's boring until the exact moment your video pipeline needs to talk to the outside world.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| base64 | STRING | — |