Face Area Batch Merger
Reassemble a batch after the detail pass
- images_to_detail
- images_passthrough
- images
CCC_FaceAreaBatchMerger is the second half of the face-detail split: its partner CCC_FaceAreaBatchSplitter divides a batch of images into "the ones with small faces worth detailing" and "the ones already fine," you run a detail pass on the first group, and this node puts the whole batch back together in the original order. Without it you'd have two batches and no clean way to recombine them.
It's a mechanical node, but a load-bearing one - the kind of thing that's invisible when it works and a silent nightmare when it doesn't.
How it works
Four inputs, and they map to a contract with the splitter:
images_to_detail- the batch that came back from your detail/upscale pass.images_passthrough- the batch that was left alone.detail_indices- a string of comma-separated indices telling the merger which original positions the detailed images occupy, e.g."0,2". This is what keeps the ordering correct.total_count- how many images the original batch had. The merger allocates that many slots, fills the detailed indices fromimages_to_detail, the rest fromimages_passthrough, and stacks them back in order.
The output is a single images tensor, reassembled. The trap: if total_count is wrong or detail_indices doesn't line up with what the splitter produced, the node falls back to returning whichever batch isn't empty - a silent wrong answer. When you see all faces undetailed after wiring this up, check the contract first.
Where it fits
The full loop: splitter → (small-face images → FaceDetailer/upscale →) merger. The splitter's detail_indices output is meant to be wired straight into this node's detail_indices input - don't hand-type it. This is the batch version of the "crop, resample, paste back" idea that FaceDetailer made famous, applied to a whole dataset or image sequence at once rather than one detection at a time.
Installing it
Part of Mickmumpitz-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git
or ComfyUI Manager → search "Mickmumpitz" → install → restart. The merger itself has no extra dependencies; the splitter is the node that optionally wants ultralytics + a YOLO model if you don't wire in Impact Subpack's UltralyticsDetectorProvider.
Troubleshooting
- Output looks like only half the batch -
total_countdisagrees with reality. It's the number of original images; if the splitter changed the count, that value is stale. - Faces swapped between images -
detail_indicesdoesn't match the splitter's ordering. Re-wire it from the splitter's output instead of typing it. - Whole batch skipped (no error) - the fallback path kicked in because one of the counts was off, returning a present-but-partial batch. Check the console; there's no loud error for this.
- Mismatched image sizes - the merger stacks with
torch.stack, which requires every image to be the same size. If your detail pass changed dimensions, the batch must be uniform - resize the detailed images back to the batch size before merging.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images_to_detail | IMAGE | — | |
| images_passthrough | IMAGE | — | |
| detail_indices | STRING | — | |
| total_count | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |