H3 Keyframes (any position)
Anchor a clip at any frame, not just first and last
- clip
- vae
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- images_batch
- positive
- latent
- info
Stock H3 conditioning lets you anchor a clip at the first frame, the last frame, or both. This node throws the middle open. H3Keyframes builds MiniMax-H3 conditioning with keyframes at arbitrary positions in the timeline - connect an image to image_1, give it a position, and that picture becomes a fixed point the video passes through halfway through, or at frame 300, or wherever you say. This is how you get a clip that starts on one face, turns to the camera at the midpoint, and ends on a wide shot - dictated by three stills instead of hoping the text does it.
It's the conditioning heart of the pack's separate H3_Keyframes.json workflow, which is a different job from multishot chaining: this is one clip, anchored at chosen positions, with per-anchor condition strength available via H3ConditionStrength.
The inputs that matter
-
clip,vae- the encoder and VAE for text and image encoding. -
prompt- the clip's text. -
width,height,length- render size and frame count (lengthon H3's 17k+5 grid; 243 is ~10.1s, 362 is the trained max ~15.1s). -
positions- the string that makes this node special. One entry per connected image, in order. A%value is a fraction of the clip:0%= first frame,50%= halfway,100%= last. A bare number is an absolute frame index. You can also give ranges -2-5or15%-30%- and ranges can run descending (30%-20%), which reverses that section of the image batch. Example from the tooltip:0%, 50%, 100%anchors start, middle and end. -
image_1…image_6- the anchor stills. When six isn't enough,images_batchtakes a whole batch of anchors (every frame is one anchor, in order, appended after the individually-connected slots) - say, several frames at each end to pin complex motion, or frames lifted from a source video.
Outputs: positive (the CONDITIONING, into your sampler), latent (the encoded latent), and info (a string describing what got anchored - read it; it'll tell you if your positions parsed the way you meant).
How it works
Each anchor is encoded to a latent and placed at its temporal coordinate in the conditioning, the same mechanism H3 uses natively for first/last frames - just extended to any position. The position parsing (0%, 50%, ranges, descending ranges) was contributed upstream by @viralesveras, and it's the kind of syntax you'll either love instantly or need one look at the info output to trust.
The honest warning is in the tooltip: large numbers of keyframes massively increase VRAM. Every anchor is a latent row that rides through every sampling step. Six anchors is fine; forty frames from a source video will want a big card. Plan the keyframes you actually need, not the ones you can supply.
Install
Part of the H3 Multishot pack:
cd ComfyUI/custom_nodes
git clone https://github.com/jlucasmcrell/ComfyUI-H3-Multishot
or ComfyUI-Manager → H3 Multishot. Restart; ComfyUI v0.30.0+. No extra dependencies.
The usual model install applies - checkpoint in models/diffusion_models/, encoder + VAEs in text_encoders/ and vae/. And the pairing rule from the rest of the pack applies here too: this is ref2va territory (reference rows), so if the anchors aren't holding, check your encoder's vision sidecar is actually loaded before you blame the keyframes.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| vae | VAE | — | |
| prompt | STRING | — | |
| width | INT | 96032–4096 | — |
| height | INT | 54432–4096 | — |
| length | INT | 2435–3600 | Frames at 24fps, on H3's 17k+5 grid. 243 = ~10.1s, 362 = trained max ~15.1s. |
| positions | STRING | 0%, 50% | One position per connected image, in order. A value with a % is a FRACTION of the clip (0% = first frame, 50% = halfway, 100% = last). A value without a % is an absolute frame index. Example: '0%, 50%, 100%' anchors the start, the middle and the end. Additionally, position ranges such as '2-5' or '15%-30%' may be specified. Example: '0-3, 10%, 90%-100%'. Ranges may be descending, such as 30%-20%, which would reverse that section of the input image batch. Please note that specifying large numbers of keyframes will massively increase VRAM requirements. |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| image_6opt | IMAGE | — | |
| images_batchopt | IMAGE | A BATCH of anchors, for when six slots is not enough - e.g. several frames at each end to pin complex motion, or a set of frames kept from a source video. Every frame is one anchor, in order, and they come AFTER any individually connected image_N. Give one entry in `positions` per anchor across both. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| latent | LATENT | — |
| info | STRING | — |