Image Batch Insert
Slot a frame into an image batch anywhere — no resampling surprises
- batch
- image
- batch
- count
ComfyUI treats a batch of images as one flat tensor - [B, H, W, C], B frames stacked together. That's great for the sampler, and quietly useless when you need to edit the stack: there's no "put a frame here" button anywhere in core. Image Batch Insert is that button. It takes an image (or a whole batch) and drops it into another batch at a position you choose - start, end, at an index, or after one. Think assembling a contact sheet, slipping a title card in front of a video batch, or splicing a missing frame back into an interpolation run.
The key detail that saves you from a classic footgun is the mode input. A ComfyUI batch stacks frames of the same size, so inserting a different-sized image has to be resolved somehow before anything can concatenate. This node does it losslessly - no resampling, ever. pad to largest (the default) letterboxes the smaller frames with pad_color; crop to smallest trims the big ones to the small ones; as is just errors on a mismatch so you notice instead of silently shipping a mangled batch. The same reconciliation machinery that powers the pack's Unlim Image Batch is reused here, which is reassuring: this isn't a one-off hack, it's the pack's batch logic in a different shape.
The inputs that actually matter are few:
position-at end/at start/at index/after index.at indexinserts before the frame at that index;after indexinserts after it. Theindexfield is ignored for start/end.index- 0-based target frame; negative counts from the end, so-1means "the last frame."batch- the batch you're inserting into. Leave it empty and the node starts a fresh batch fromimage, which makes it a surprisingly handy way to build a stack from scratch one node at a time.
Outputs are batch (the edited tensor, ready to wire into a VAE decode, a video frame source, or another batch op) and count (the resulting frame count - handy if you're feeding a loop or a repeat node that needs to know how many frames it's working with).
Installing
This ships in Kinburg-Nodes, a personal utility collection. Easiest path is ComfyUI Manager: search "Kinburg-Nodes" and install, which also runs the pack's install.py for you. Or, by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Kinburg/Kinburg-Nodes
# restart ComfyUI
No extra Python dependencies - the README is explicit that the image and date utilities need nothing beyond what ComfyUI already ships. If you're not already running this pack for one of its other nodes (Image Compare is the star), the batch utilities alone probably aren't worth the install; they earn their keep once you're in the ecosystem.
Gotchas
The as is mode will happily stop your run with an error the moment sizes mismatch - that's the point, but it means a batch that was fine before an upscale breaks the insert until you switch to pad to largest. If you're inserting a single image into a batch of a different aspect ratio, remember pad_color defaults to black, and black bars show up in any downstream preview. And if your frames are deliberately different sizes and you want them kept separate rather than forced into one batch, the pack's own docs suggest the generic List Insert path instead - this node is for when you truly want one tensor on the other end.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| position | COMBO | at end | Where to insert. 'at index' inserts before the frame at 'index'; 'after index' inserts after it. 'index' is ignored for start/end. |
| index | INT | 0-100000–100000 | 0-based target frame for 'at index' / 'after index'. Negative counts from the end (-1 = last). |
| mode | COMBO | pad to largest | How to reconcile different frame sizes (lossless, no resampling): 'as is' errors on a mismatch, 'crop to smallest', or 'pad to largest' (with pad_color). |
| pad_color | STRING | #000000 | Fill color (HEX) for borders added in 'pad to largest' mode. |
| batchopt | IMAGE | The batch to insert into. Leave empty to start a new batch from 'image'. | |
| imageopt | IMAGE | Image (or batch) to insert. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| batch | IMAGE | — |
| count | INT | — |