Build Streaming Video Grid
The grid node for when your VRAM taps out
- videos
- video
Build Video Grid works great until it doesn't - and what breaks it is memory. A 20-video sweep where every clip is 720p, labeled with Draw Text Overlay, held as one giant grid tensor, is a genuine OOM risk. Build Streaming Video Grid is the sibling node for exactly that situation: same layout rules, but it renders and encodes the grid one frame at a time straight to a file-backed H.264 video, so the complete grid tensor never exists in memory.
How it works
The inputs are Build Video Grid's plus encoding controls: videos, columns, cell_width, cell_height, padding, then fps (default 30, 1–120), bit_depth (8 or 10), and crf (default 23, the H.264 quality/bitrate knob - lower is higher quality). On execution it walks the frame-aligned videos frame by frame, builds a single grid frame, hands it to PyAV, and encodes into a temp MP4. The output is a silent, file-backed VIDEO, so Create Video is not used - you wire video directly into Save Video.
Two implementation details worth knowing. First, because H.264 has no alpha channel, RGBA input is composited over black (the same black that fills padding and unused cells), and the final grid width and height must be even - if you get a validation error about dimensions, nudge a cell size or padding. Second, the backing file lives in ComfyUI's temp directory, and ComfyUI clears temp files on restart. Disk usage is roughly the size of the compressed grid video, not the full tensor.
The input that matters most
crf. It's the single knob that decides file size versus quality, defaulted to 23 which is the standard "visually near-lossless" value. The README's pro move: leave Save Video on its default auto format and codec settings so it copies the encoded stream without a second lossy encode - if you let Save Video re-encode, you're paying quality twice for nothing.
The honest limits
This removes the grid-construction memory, not the whole-sweep memory - all your source IMAGE batches still exist before the node runs, so it's not a one-video-at-a-time pipeline; it's a "don't also build the giant grid tensor" pipeline. And don't be fooled into thinking the file-backed output is now free: connecting it to Get Video Components or any node that loads every frame will materialize the full grid again, so keep it pointed at Save Video unless you really need the frames.
Install
Shared pack drill: ComfyUI Manager → "ComfyUI-SweepGrid" → Install, restart; needs ComfyUI 0.31.0+. PyAV (av) is the one non-trivial dependency here, but ComfyUI already ships it for its own video nodes - nothing extra to install.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| videos | IMAGE | — | |
| columns | INT | 31–20 | — |
| cell_width | INT | 48032–2048 | — |
| cell_height | INT | 27232–2048 | — |
| fps | FLOAT | 301–120 | — |
| bit_depth | INT | 88–10 | — |
| padding | INT | 80–128 | — |
| crf | FLOAT | 230–51 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |