Nodes/Link Comfy Nodes/Shift Image Batch
ComfyUI Node

Shift Image Batch

Circularly rotate a frame sequence

By Mister-Link·Created 9 months ago·Updated 24 days ago· 0
Shift Image Batch
  • frames
  • shifted_frames
amount0
directionleft

Small, sharp tool: take a batch of frames and rotate it left or right, with whatever falls off one end wrapping back onto the other. Not a crop, not a pad - a genuine circular shift, so nothing is dropped and nothing is added, just reordered.

What it's for

The obvious use inside this pack is unwinding the exact rotation that SCAIL Pose Frames deliberately introduces when it builds a looped driving sequence for SCAIL-2. That node hands you back a shift value specifically so you can feed it straight into this node's amount input and put your original frame 1 back where it belongs once SCAIL is done processing the loop.

Outside that specific pairing, it's useful anywhere you need to change which frame in a cyclical or looping sequence counts as "first," without touching the actual content - nudging a seamless loop's start point, or realigning a batch after a chunked or windowed process left it offset from where it started.

The inputs and outputs that matter

The pack ships tooltips on every field here, so this one's straightforward:

  • frames - the batch to shift.
  • amount (default 0) - number of frames to shift, per its own tooltip.
  • direction (left or right, default left) - direction to shift the batch, per its own tooltip.

One output: shifted_frames - a "circularly shifted image batch," per its tooltip. The word "circularly" is the important part: frames pushed off one end reappear at the other rather than disappearing.

How to install it

Search "Link Comfy Nodes" in ComfyUI Manager and install from there. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/Mister-Link/link-comfy-nodes
pip install -r link-comfy-nodes/requirements.txt

Restart ComfyUI. No extra models or heavy dependencies for this node specifically.

Common issues & troubleshooting

Amount larger than your batch. A circular shift should behave sensibly for any amount by effectively wrapping (an amount equal to your batch length is a no-op, since everything wraps back to where it started). If a large amount gives you a result that looks wrong, try the same value modulo your actual frame count and compare.

Direction backwards. If your loop seam or realignment lands on the wrong side of the sequence, that's almost always a direction mistake, not an amount mistake - flip left/right before adjusting the number.

Using this without actually needing a loop rebuilt elsewhere. If you're reaching for this node outside the SCAIL Pose Frames pairing, make sure you actually need a circular wrap rather than a simple trim or pad - those are different operations, and this one specifically preserves every frame, just reordered.

Categoryanimation/utils

Inputs (3)

NameTypeDefaultDescription
framesIMAGE
amountINT00–9999Number of frames to shift.
directionCOMBOleftDirection to shift the batch.

Outputs (1)

NameTypeDescription
shifted_framesIMAGECircularly shifted image batch.