LayerMask: BBox Join(Advance)
Merge bounding boxes from up to four detectors into one list
- bboxes_1
- bboxes_2
- bboxes_3
- bboxes_4
- bboxes
LayerStyle Advance ships a handful of nodes that all produce the same BBOXES data type - ObjectDetectorGemini, ObjectDetectorMask, the YOLO detectors, Florence2's object detector, GroundingDINO+SAM's ultra node. BBoxJoin is the plumbing that lets you combine results from more than one of them into a single list before it goes anywhere downstream. There's no detection logic here at all - it's a merge, nothing more.
Why you'd want this
The obvious case: you run two different detectors for two different things in the same image - say Gemini for "the person's face" and a mask-based detector for a region you painted by hand - and you want both sets of boxes drawn or segmented in one pass through DrawBBoxMask or SAM2UltraV2, instead of running that downstream node twice and compositing the results yourself. Or you're chaining detectors of different reliability (a fast local YOLO pass plus a slower, more accurate Gemini call for anything YOLO missed) and want one combined box list at the end.
The inputs and outputs that matter
bboxes_1- required. Your first (or only) set of boxes.bboxes_2,bboxes_3,bboxes_4- all optional. Leave unconnected if you don't need them; connect as many as you have detector outputs.
Output is a single bboxes (type BBOXES) - the combined set, ready to feed into DrawBBoxMask, SAM2UltraV2, or anything else in the pack that consumes bbox data.
Installing it
ComfyUI Manager: search "ComfyUI Layer Style Advance". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git
Run install_requirements.bat (or the manual pip/whl steps for a portable install) and restart. This node has no model dependency and no API key requirement - it's pure data plumbing, so if the rest of the pack is installed and working, this one just works.
Common issues
There's genuinely not much that goes wrong with a node this simple, but two things are worth knowing:
Feeding it something that isn't BBOXES. The inputs are typed - you can't wire an ordinary MASK or IMAGE into bboxes_1 and expect it to work. If a connection won't attach in the graph editor, that's ComfyUI's type checking telling you the upstream node isn't actually producing bbox data.
Downstream node only processes one of the merged boxes. That's not a BBoxJoin problem - it's a bbox_select setting on whatever consumes the combined list. Several detector-adjacent nodes in this pack (ObjectDetectorMask, SAM2UltraV2, the YOLO detectors) have a bbox_select option of all / first / by_index. If you've joined four sets of boxes but only one is being acted on, check that setting downstream rather than assuming the merge itself failed.
Empty result. If none of your connected inputs actually produced any boxes upstream - an object detector that found nothing, or a mask-based detector fed a blank mask - the join has nothing to combine. Check each detector's own output (most of them, like ObjectDetectorGemini and ObjectDetectorMask, also output a preview image) before assuming BBoxJoin dropped something.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| bboxes_1 | BBOXES | — | |
| bboxes_2opt | BBOXES | — | |
| bboxes_3opt | BBOXES | — | |
| bboxes_4opt | BBOXES | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| bboxes | BBOXES | — |