Florence2 Postprocess All
Every detection, one mask
- F_BBOXES
- mask
- label
- loc_string
- width
- height
- x
- y
If the single-index postprocess node is "give me thing number two," this one is "give me all the things, in one mask." Florence2PostprocessAll takes the same F_BBOXES bundle from the Florence2 node and unions every detection into a single mask, joins the labels into one comma-separated string, and computes the bounding box that contains all of them. Zero impressions on Google means almost nobody's landing here, which is a shame - for a specific class of job this is the more useful half of the pair.
Think "mask all the people in this photo" or "mask every piece of text." With the per-box node you'd loop over indices; with this one you get the combined result in one shot. That's the classic targeted-masking setup the KB's background-removal essay talks about: detect everything, take the union mask, then feed it to an inpainting or replacement pass. One node, no bookkeeping.
The interface is almost insultingly simple: one required input, F_BBOXES, and seven outputs that mirror the single node:
mask(MASK) - every box/polygon OR'd together into one white-on-black mask.label(STRING) - all labels joined with ", " (duplicates collapsed).loc_string(STRING) - the union box in Florence-2's<loc_x1><loc_y1><loc_x2><loc_y2>format, scaled 0–999.width,height,x,y(INT) - the enclosing box's size and top-left corner.
How it works is worth a sentence because it explains a limitation. It iterates every detection, ORs each box into the mask, and takes the min/max across all of them for the union geometry. That means "all" is faithful for the mask, but x/y/width/height describe one big bounding box around everything, not per-object geometry - if you need each object's own numbers, that's the per-index node's job.
Same fallbacks as its sibling, grounded in the code: an out-of-range situation never arises here (it iterates whatever exists), but if F_BBOXES arrives as a string from a failed run, you get a blank 512×512 mask and an empty label rather than a crash. Segmentation tasks come through as polygons, and the node fills them properly; detection boxes come through as simple rectangles.
The honest caveat is the pack-wide one: spacepxl retired this repo and the README points to Kijai's ComfyUI-Florence2 fork, which has its own (better-documented) segmentation pipeline. If you're already running a workflow built on this pack, this node still works - models live in the shared models/LLM/ folder, so there's no re-download - but for anything new, weigh Kijai's fork first. Install via ComfyUI Manager (search "ComfyUI-Florence-2") or:
cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Florence-2
It's a thin utility node, and it knows it. One wire in, one mask out, for when "some of it" isn't good enough.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| F_BBOXES | F_BBOXES | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| label | STRING | — |
| loc_string | STRING | — |
| width | INT | — |
| height | INT | — |
| x | INT | — |
| y | INT | — |