Difforum · H3 Shot
Everything a MiniMax H3 First/Last-Frame Shot Needs, in One Node
- frames
- direction
- params
- camera
- masks
- first_frame
- last_frame
- length
- width
- height
- prompt
- segments
- last_mask
- info
H3's first/last-frame mode (FL2VA) is beautiful and picky. You give it two images and it connects them - but the length has to sit on H3's 17k+5 grid, the resolution has to be a multiple of 32, and anything longer than one generation has to be split into segments that share a boundary frame and round-trip your last frame back in as the next first frame.
This node packages all of that, and steals the boring part: it returns the frames and numbers, not the video.
What it returns
Give it a batch of frames - a Storyboard, a Feedback render, Guide Frames, whatever - and it hands back first_frame and last_frame for the segment you selected, length and width/height snapped to what H3 accepts, segments (how many pieces your clip actually is), last_mask (the revealed area of the last frame, from Guide Frames masks, ready for Fill Reveal) and prompt.
The segment logic is the part worth understanding. segment_length offers auto (from frames), 124 (~5s), 243 (~10s), 362 (~15s) and 481 (~20s). Whatever you pick is snapped to the grid and clamped to your clip. Segments share their boundary frame - the stride is length - 1 - so you render segment 0, take its last frame, feed it back as segment 1's first frame, and the clip extends without a visible join. Set segment to 0, render, then 1, then 2.
auto picks the longest generation that fits, capped at 481 frames. For a 30-second Director timeline that's several passes, which is why the pack's long-shot template is a 12-block graph and not a straight line.
The prompt side
prompt is built from your timeline, and prompt_style decides the shape: H3 structured writes this segment's scenes, camera, keys and look in H3's native FL2VA format, while sentence gives you description + camera sentence + look as plain text. shot_description is where you say what's on screen at the start - subject, place, light - and include_look appends the Director's look as the shot's style.
soundscape and music map onto H3's overall_soundscape and non_diegetic_music fields: ambience and physical sounds only in the first, instruments/tempo/dynamics in the second. Empty means soft natural ambience and no score. Since H3 generates sync audio with the picture, those two fields are the difference between a shot that sounds like a place and one that sounds like a demo.
Inputs
frames is required; direction (or params + camera) supplies the timeline, so the node can describe the segment's move in words and know how many frames you're working with. masks from Guide Frames is optional but very much worth connecting - it's what makes Fill Reveal able to repaint the camera-revealed area of the final frame.
Install
Manager → search "Difforum", or:
cd ComfyUI/custom_nodes && git clone https://github.com/chillithebillis/Difforum.git difforum
Restart. This node ships no weights - you need ComfyUI's core H3 nodes and the H3 fl2va model. Template 08 (h3_first_last_frame) is the working setup, and it's the one to open first if the grid maths makes your head hurt.
Where people get burned
Lengths that don't fit. If you render 100 frames of Feedback and ask for 124 (~5s), you get 100 - but if you ask for 481 on a 100-frame clip you get 100, and if you build your edit around the number you typed rather than the length output, everything downstream is wrong. Wire length into the H3 sampler; don't retype it.
Then there's the revealed-area problem, which is baked into the design: the last frame of a long camera move may be mostly invented space. Without Fill Reveal that gray region goes into H3 as if it were content. Check last_mask's coverage - the info string reports it - and if it's large, repaint before you animate.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | The clip whose first and last frame H3 should connect (Guide Frames, Storyboard, Feedback render). | |
| segment_length | COMBO | auto (from frames) | Frames per H3 generation. Clips longer than this are split into segments. |
| segment | INT | 00–999 | Which segment to render: 0, then 1 with segment 0's last frame as its first frame... |
| directionopt | DIFFORUM_DIRECTION | The Director's wire: camera, energy curve, scene prompts, keys and look in one cable. | |
| paramsopt | DIFFORUM_PARAMS | From Setup: frame count, fps, width and height. Plug the same Setup everywhere. | |
| cameraopt | DIFFORUM_CAMERA | A camera track from Camera (keys), Camera (expressions) or Camera Import. Overrides the Director's camera. | |
| shot_descriptionopt | STRING | What is on screen at the start: subject, place, light. Goes into the prompt. | |
| masksopt | MASK | Guide Frames masks: returns the last frame's revealed area for Fill Reveal. | |
| include_lookopt | BOOLEAN | true | Add the Director's look as the style of the shot. |
| prompt_styleopt | COMBO | H3 structured | H3 structured: this segment's scenes, camera, keys and look in MiniMax H3's native FL2VA format (alignment line + fields). sentence: description + camera sentence + look, as plain text. |
| soundscapeopt | STRING | overall_soundscape: ambience and physical sounds only. | |
| musicopt | STRING | non_diegetic_music: instruments, tempo, dynamics. Empty = N/A. |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| first_frame | IMAGE | — |
| last_frame | IMAGE | — |
| length | INT | — |
| width | INT | — |
| height | INT | — |
| prompt | STRING | — |
| segments | INT | — |
| last_mask | MASK | — |
| info | STRING | — |