Nodes/ComfyUI-MiniMaxH3-Director/MiniMax H3 Save Last Frame
ComfyUI Node

MiniMax H3 Save Last Frame

Keep the last frame of every MiniMax H3 shot — the one you feed into the next

By seesee75-commits·Created 21 days ago·Updated 9 days ago· 250
MiniMax H3 Save Last Frame
  • images
  • images
savetrue
filename_prefixMiniMaxH3/lastframe

Every MiniMax H3 render ends on a frame worth keeping: the last frame is the opening keyframe of the next shot, the thing you feed back in when you continue a story shot by shot. In stock ComfyUI, grabbing it means an ImageFromBatch wired to a SaveImage with the index set by hand - and H3 lengths snap around on the 17k+5 grid, so you're rebuilding that index every time the render length changes. MiniMax H3 Save Last Frame is the boring little node that makes that one step automatic. You put it straight after VAEDecode, it writes the last frame of whatever batch comes through as a PNG, and it passes the whole batch on untouched.

How it works

The clever part is how little it does. It slices the last frame with images[-1:] - the slice keeps the batch dimension, which is what the saver expects - and hands it to ComfyUI's own ImageSaveHelper. That's the same saver SaveImage uses, so you get the same file counter, the same %date:yyyy-MM-dd% prefix tokens, and the same embedded workflow metadata. A frame saved here is a frame Save Image would have written.

Two deliberate behaviors worth knowing. It never touches the pixels: the images output is the same tensor that came in, so dropping this node mid-chain can't change what anything downstream decodes, encodes or muxes. And it doesn't need to be bypassed - the save widget is on/off, so you can stop writing files between runs without unwiring the node or Ctrl+B'ing it (a node you have to disable between runs is a node that gets left enabled by accident). An empty batch just logs a warning and passes through, rather than failing a finished render for a frame that was never there.

The inputs

Only three, all straightforward:

  • images - the decoded frames from VAEDecode. Passed on unchanged whether or not a file is written.
  • save - default on. Off means pass the frames through and write nothing.
  • filename_prefix - default MiniMaxH3/lastframe, under ComfyUI's output folder. Same tokens as Save Image.

One output: images, the input batch, untouched. It's flagged as an output node, so it runs even when nothing is wired downstream - which is exactly how you'd use it: at the end of the graph, next to your real SaveImage, quietly banking the keyframe for the next shot.

Installing

Same pack as the Director - ComfyUI Manager search MiniMax H3 Director, or:

cd ComfyUI/custom_nodes
git clone https://github.com/seesee75-commits/ComfyUI-MiniMaxH3-Director

No extra pip dependencies, ComfyUI ≥ 0.30.0, and it shares the Director's model/encoder/VAE setup. Picking a frame other than the last one isn't there yet - if you need the frame at index 40, ImageFromBatch is still your tool. But for the one frame H3's first/last-anchor design actually wants from you, this is the zero-effort answer.

CategoryMiniMax H3

Inputs (3)

NameTypeDefaultDescription
imagesIMAGEThe decoded frames (VAEDecode output). Passed on unchanged, whether or not a file is written.
saveBOOLEANtrueOff = pass the frames through and write nothing. Here so you never have to bypass the node.
filename_prefixSTRINGMiniMaxH3/lastframePrefix for the saved file, under ComfyUI's output folder. Supports the same tokens as Save Image, e.g. %date:yyyy-MM-dd%.

Outputs (1)

NameTypeDescription
imagesIMAGEThe input batch, untouched.