去重复帧图像批次合并
Stitch overlapping video chunks back together without doubled frames
- image1
- image2
- image
The name translates to "deduplicate-frame image batch concat," and honestly the "deduplicate" part is doing a lot of work. YJDynamicImageBatchConcat is a batch concat node with one party trick: it can trim a fixed number of leading frames off every input after the first, so that when you process a long video in overlapping chunks and stitch the outputs back together, you don't end up with doubled frames at every seam.
Here's the situation where it earns its keep. Long-video pipelines rarely denoise the whole clip at once. The standard pattern - the same one AnimateDiff's sliding context window uses - is to chew through the footage in overlapping chunks: process 16 frames, keep a few overlapping frames for temporal coherence, slide forward, repeat. The overlap is great for consistency and a pain in the ass to remove. If you just torch.cat the chunk outputs, every seam has the overlap baked in twice. This node is the seam fixer.
How it works
The dynamic part is real, not just marketing. The node's JavaScript watches your connections: plug something into image2 and it auto-creates an image3 socket; connect that and image4 appears, all the way up to image20. Each connected input is gathered in numeric order and concatenated along the batch dimension (the first axis) into a single IMAGE tensor.
The dedup logic is deliberately dumb, and the README says so plainly: it doesn't compare pixels to find actual duplicates. Set 减去重复帧数 ("frames to subtract") to N, and it keeps image1's entire batch, then slices the first N frames off the front of every subsequent input before joining them. Chunks that get trimmed all the way to empty are silently dropped. There's no frame-content analysis anywhere in this thing.
All inputs must match in height, width, and channel count, or the node raises a shape-mismatch error - same hard rule as every other tensor concat in ComfyUI.
The inputs that matter
image1- the anchor batch, never trimmed. Wire your first processed chunk here.减去重复帧数- an INT, default0. Set it to however many overlapping frames each later chunk carries.0means "just concat, thanks," which turns this into a plain batch joiner.image2–image20- optional, appear dynamically as you connect. Each is trimmed byNframes from the front before merging.
The output is a single image tensor with the merged batch, ready to feed a VAE decode and a video saver.
One UI quirk: the input label is Chinese and stays Chinese - the pack follows its author's language for this node (the README flags that the concat node's labels haven't been localized).
Installing it
Grab the pack through ComfyUI Manager (search "ComfyUI-YJNodes"), or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/yujianvip/ComfyUI-YJNodes
Then restart ComfyUI. There are no model downloads and no extra Python dependencies - the README and the empty requirements.txt agree on that one. You just need Python 3.10+.
Where people get burned
The trap is treating it as actual duplicate-frame removal. If your chunks don't overlap, a nonzero 减去重复帧数 will chew off real frames at the start of every chunk past the first, and you'll have a visibly shortened clip with no warning. Set it to the exact number of overlap frames you baked in at generation time, or leave it at 0. And remember it only trims the front of later chunks - if your overlap lives at the end of a chunk instead, this node won't help you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image1 | IMAGE | — | |
| 减去重复帧数 | INT | 00–9999 | — |
| image2opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |