π€ Shaka Wan Keyframes
Multiple keyframes in one Wan video, without hand-building the conditioning
- images
- images
- masks
- width
- height
- length
Vanilla Wan image-to-video anchors one frame: your start image becomes the first frame and the model invents everything after it. But a lot of the interesting Wan work is a storyboard of keyframes - frame 1 the establishing shot, frame 41 the close-up, frame 81 the payoff, with the model walking between them. Building that multi-image conditioning by hand is a fiddly mess of tensors and masks. ShakaWanKeyframes exists so you don't have to.
It takes a batch of images plus a list of where each one belongs in the clip, and outputs a complete image+mask pair ready for Wan's conditioning format. The author's framing is right: it's a "prep for VACE" node.
How it works
The mechanism is simple and worth knowing because it explains the outputs. The node creates a full-length sequence of length mid-gray frames (pixel value 0.5, the neutral "generate here" fill) at your width Γ height. Each of your input images gets upscaled to that size and spliced in at its frame index. Then it builds a matching mask tensor where each keyframe's slot holds 1 - weight:
- weight
1.0β mask0.0β the frame is fully anchored, Wan conditions on it hard - weight
0.5β mask0.5β a partial pull, the model can drift from it - weight
0.0β mask1.0β fully masked, the frame is ignored
So frame_weights is effectively "how hard should Wan obey this keyframe." Lower it for keyframes you want to be suggestions, keep it at 1.0 for the ones that must hold.
Wan expects reference frames on a 4-frame temporal grid - frames 1, 5, 9, 13, not 1, 2, 3. That's what Shaka Mode (on by default) does: it snaps every index down to the nearest grid slot so the output stays compatible with Wan's conditioning format. The node also sanity-checks your numbers up front and raises a loud π-prefixed error if they're wrong rather than silently producing garbage.
The inputs and outputs that matter
Three inputs are worth actually thinking about; the rest are set-and-forget:
- frame_indices - comma-separated, 1-based list of frames. Default
1, 81. The count must equal the number of images you feed in, and every index must be within1..length. - frame_weights - comma-separated floats,
0.0to1.0, one per image. Default1.0, 1.0. - shaka_mode - leave it on. Turning it off lets indices land anywhere, but then you're on your own for Wan compatibility.
width, height, and length are your clip dimensions; length must be 1 plus a multiple of 4 (81 is the classic), and width/height must be multiples of 16.
On the output side you get images and masks (the two things you feed into a Wan sampler's image conditioning) plus width, height, and length passed straight through - a convenience so you can wire your dimensions to the latent and sampler nodes without a separate calculator. The only hard requirement is the (length - 1) / 4 image cap: 81 frames gives you room for up to 20 keyframes.
Where it fits
This is a VACE-era workflow tool - VACE is Alibaba's official control framework for Wan, and it's how multi-image conditioning gets into a Wan 2.1/2.2 pipeline. Wan remains the quality-first open video base (frozen at 2.2), I2V is its default workflow, so a node that makes I2V multi-keyframe is aimed at a real gap rather than a made-up one.
Common issues
Almost every failure mode is the sanity check, and the messages are actually readable:
- "Frame indices must not conflict within the same 4-frame group" - the classic. In Shaka Mode,
1, 3both snap to frame 1, which the node refuses. Space your indices by at least 4. - "Input mismatch! N images vs M indices" - the comma-separated strings must have exactly one entry per input image.
- "Too many images for the specified length" - you've exceeded
(length - 1) / 4keyframes; lengthen the clip or cut images. - "Length must be 1 plus a multiple of 4" - this one's non-negotiable for Wan.
It's early-days software (the pack is a single-person WIP, explicitly "not recommended for production"), so expect rough edges. But for the job it does - turning a stack of stills into a Wan-ready keyframe batch in one node - it's the difference between a five-minute workflow and a forty-minute tensor puzzle.
Install
No models to download and no real dependencies beyond torch, which ComfyUI already has:
- ComfyUI Manager: search for
ComfyUI-ShakaNodesand install, then restart. - Manual:
Restart ComfyUI; the node appears under thecd ComfyUI/custom_nodes git clone https://github.com/bomborant/ComfyUI-ShakaNodesShakaNodescategory.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| width | INT | 83216β16384 | β |
| height | INT | 48016β16384 | β |
| length | INT | 811β16384 | β |
| frame_indices | STRING | 1, 81 | β |
| frame_weights | STRING | 1.0, 1.0 | β |
| shaka_mode | BOOLEAN | true | Shaka Mode ensures compatibility with Wan's conditioning format. Ensures frames stick to a 4-frame temporal grid |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |
| masks | MASK | β |
| width | INT | β |
| height | INT | β |
| length | INT | β |