Unshift Pose Frames
The other half of the WAN loop trick — undo the shift once the transition frames exist
- frames
- frames
- total_frames
Unshift Pose Frames is the mirror of Shift Pose Frames, and it has exactly one job: take the reordered sequence from its sibling, undo the surgery, and hand you back the original frame order. You don't reach for this node alone - it's the return trip. If you're doing the WAN seamless-loop trick, you wire Shift → generate the transition over the blank frames → Unshift, and this is what makes the whole thing feel like one operation instead of three fiddly steps.
How it works
It's deliberately bookkeeping-driven. Shift Pose Frames emits three metadata values - shift, blank_frames, is_loop - and you feed them straight back into this node along with the processed frames. The node then reverses the layout:
- If
is_loopis true, it trims the two overlap frames from each end (the 4-frame margin Shift added). - It rotates the sequence left by
shiftframes, which moves everything back to its original order. The blank-frames gap you filled with generated transition content stays in the middle of the sequence where the seam used to be, so the wrap is now a smooth, generated connection.
Output is the restored frames batch plus a total_frames count so you can confirm nothing was lost in the shuffle.
Inputs and outputs
frames(IMAGE) - the shifted, now-inpainted sequence from Shift Pose Frames.shift(INT) - the shift value from Shift Pose Frames' output.blank_frames(INT) - same, from Shift Pose Frames.is_loop(BOOLEAN) - same again. These three are the contract between the two nodes.
Outputs: frames (IMAGE) and total_frames (INT). Both feed straight into your next stage - a pose render, a save node, whatever comes after the loop is sealed.
Installing it
Same pack, same install:
cd ComfyUI/custom_nodes
git clone https://github.com/Mister-Link/link-comfy-nodes
cd link-comfy-nodes
pip install -r requirements.txt
or ComfyUI Manager → "Link Comfy Nodes", restart. Pure tensor math, no models.
Common issues
- "Looped Shift Pose Frames input must include the 4 overlap frames" - you set
is_looptrue but the input doesn't have the overlap margin. It only gets added by Shift Pose Frames whenblank_frames> 0, so if you bypassed Shift or setblank_framesto 0, the flag and the frames disagree. - "No frames remain after removing overlap frames" - the trimmed sequence was empty, which means the input was too short to carry the overlap. Feed the real Shift output.
- Order comes back wrong - you're supposed to pass the exact
shiftvalue from Shift Pose Frames, not compute it yourself. It's already the correct rotation amount; just wire it.
The honest framing: this is a 20-line utility node, and that's fine. It exists so the Shift/Unshift pair is symmetric and the loop trick stays push-button. You'll use it every time you loop a WAN clip and think about it for about two seconds - which is exactly what a good utility node should be.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | — | |
| shift | INT | 00–9999 | Shift value emitted by Shift Pose Frames. |
| is_loop | BOOLEAN | false | Loop flag emitted by Shift Pose Frames. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| frames | IMAGE | Original frame order restored from Shift Pose Frames output, with overlap removed when is_loop is true. |
| total_frames | INT | Actual total frame count after unshifting. |