MiniMax H3 Frame Gate
Opening image for scene one, nothing for the rest
- state
- image
- last_frame
- first_frame
- is_first_scene
- status
- last_frame
MiniMax H3 Frame Gate solves a boring-sounding problem that will absolutely bite you in an I2V chain: you have one opening image, and you want it fed to the H3 Image-to-Video node only for scene 1, not for the continuations. If you just leave the image wired in, every scene re-anchors on the same first frame and your chain stops being a chain. This node gates it: scene 1 gets the image, everything after gets nothing and continues purely from H3 Motion Context.
The mechanism is delightfully simple. It takes the chain state and an image. If the current scene is scene 1, the image passes through to the first_frame output. For every continuation scene, that output carries no first-frame keyframe. The is_first_scene BOOLEAN output tells you which branch you're on, and status narrates the decision.
The part people underrate: last_frame
The optional last_frame input is the second half of the node and it's what makes FL2VA (first-to-last) chains work. You can pass an end-frame target that gets forwarded to the stock node's last_frame input on every scene - not just scene 1. So an I2V chain becomes an FL2V chain: scene 1 animates from your opening image toward a chosen endpoint, and later scenes keep being steered toward a target rather than drifting free.
The tooltip has the key tip for alternating targets: to switch end-frames per scene, drive an image index switch with Current Shot's clip_index and connect the selected image here. The Frame Index Switch node in this pack exists precisely to do that selection for you.
So the wiring pattern in the maintained workflows is:
first_frame→ the stock H3 I2V node'sfirst_frameinputlast_frame→ the stock node'slast_frameinput (when you have one)state→ from Current Shot
What it's not
It's not a general image switcher and it won't help you with reference images - those are handled by the Ref2VA/tagged reference machinery elsewhere in the pack. This node only governs the first/last-frame keyframes for the I2V conditioning, which is a narrower and more specific job. Don't expect it to touch minimax_refs.
Installing it
Part of ComfyUI-MiniMaxH3-Contex-Loop. ComfyUI Manager: search "MiniMax H3 Contex Loop", or:
cd ComfyUI/custom_nodes && git clone https://github.com/ethanfel/ComfyUI-MiniMaxH3-Contex-Loop.git
Restart ComfyUI. It sits under conditioning/minimax/contex_loop with the other chain nodes. Standard requirements apply: H3 weights, current ComfyUI with native Add Guide (PR #15439).
Common issues
If your first frame keeps showing up in every scene, check that state is actually coming from Current Shot and that the loop is recursive - a non-recursive graph re-evaluates the gate with the same state every pass. And if a continuation suddenly looks like it's been re-anchored, confirm you haven't accidentally connected a first-frame elsewhere. For FL2V work, the most common disappointment is a last_frame that's ignored because it's wired to the wrong socket - the stock node's last_frame input, not a ref input.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| state | H3_CHAIN_STATE | Current state from H3 Chain Current Shot. The scene number decides whether the image is passed through. | |
| image | IMAGE | Opening image for scene 1. It is returned only for the first scene in the plan and omitted for every continuation scene. | |
| last_frameopt | IMAGE | Optional end-frame target for the current loop scene. It is passed through unchanged on every scene where the upstream socket supplies an image. To alternate targets, drive an image index switch with Current Shot's clip_index and connect the selected image here. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| first_frame | IMAGE | Connect to the stock MiniMax H3 Image to Video first_frame input. Scene 1 receives the image; later scenes receive no first-frame keyframe and continue only from H3 Motion Context. |
| is_first_scene | BOOLEAN | True only while scene 1 is being generated. |
| status | STRING | Reports whether the opening image and current last-frame target were supplied or omitted. |
| last_frame | IMAGE | Connect to the stock MiniMax H3 Image to Video last_frame input. The currently selected optional target passes through on every loop; use clip_index plus an upstream index switch for per-scene targets. |