Nodes/Loop Strip/Loop Strip — Split Grid
ComfyUI Node

Loop Strip — Split Grid

Carve a 2×2 reference video into separate characters

By serhiiyashyn-sf·Created 5 months ago·Updated 4 months ago· 0
Loop Strip — Split Grid
  • image
  • cell_1
  • cell_2
  • cell_3
  • cell_4
cols2
rows2

Sometimes the reference footage isn't one character walking - it's four of them in a 2×2 grid, because whoever generated or found the clip wanted to compare walk cycles side by side. This node slices that grid video into its component cells so each character becomes its own batch you can feed through the rest of the Loop Strip pipeline.

It's a dead-simple utility, but it pairs with a real feature: Loop Strip - Find Best Cycle can take a grid video directly (its grid_cols/grid_rows inputs) and apply the same detected cycle to every cell. Split Grid is the more manual, more flexible version - you get the raw cells and decide what happens to each one.

How it works

There's no magic here, and that's the appeal. Given an image batch [N, H, W, C], it divides the height by rows and the width by cols, then slices out each cell - for every frame in the batch. A 2×2 grid of a 200-frame clip gives you four separate 200-frame batches, each still in sync with the original timeline.

Two settings, cols and rows, both 1–8, defaults of 2. That's the entire interface.

The four outputs - cell_1 through cell_4 - fill row-major order: top-left, top-right, bottom-left, bottom-right. Here's the gotcha the README doesn't shout about: there are only four outputs. If you ask for a 3×2 grid (six cells), cells five and six simply don't exist - and if you ask for fewer than four cells, the leftover outputs are padded with empty 1×1 tensors. So plan your grid around the four-output ceiling, or split in stages.

Install

ComfyUI Manager → search "Loop Strip" → install, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/serhiiyashyn-sf/comfyui-loopstrip
cd comfyui-loopstrip
pip install -r requirements.txt

Restart after. Standard pack dependencies (opencv-python, numpy, torch, scipy, requests), nothing to download.

The trap that's actually in the math

It divides by rows and cols with integer division. If your grid video's dimensions aren't evenly divisible - say 1080×720 split 2×2, fine - the last row or column gets silently truncated. A 1080p frame split into 3 columns is 360px per cell, exact; a 1280-wide frame split into 3 is 426 remainder 2, and those 2 pixels just vanish. For grid reference videos that are usually perfectly tiled, this is a non-issue, but if you're feeding it something hand-cropped, check your cell output dimensions before you run a full cycle-detection pass on subtly-shifted frames.

Also worth knowing: unused outputs aren't None, they're tiny empty tensors. If you wire an unused one somewhere, you'll get a shape error downstream, not a graceful nothing. Only connect the cells you actually populated.

CategoryLoopStrip

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
colsINT21–8
rowsINT21–8

Outputs (4)

NameTypeDescription
cell_1IMAGE
cell_2IMAGE
cell_3IMAGE
cell_4IMAGE