Florence2 Coordinates (XY Split)
Florence-2 Found the Object — This Node Finally Tells You Where It Is
- data
- source
- x
- y
- bboxes
Florence-2 is great at one thing that makes a whole genre of workflow possible: you point it at an image, ask it to find the cup or the face or the person, and it hands back a JSON blob of bounding boxes. The problem is that "JSON blob of boxes" is a lousy thing to hand to most of ComfyUI. Nodes that crop, condition, or target a region want plain numbers - an X, a Y, a list of [x1, y1, x2, y2]. This tiny node from comfyui-florence2xy is the adapter that sits between the two: it takes the detection output, splits out the top-left corner of the box you care about, and hands you clean INTs you can actually wire somewhere.
The name is a joke and you should read it as one: it's the "Florence2 to Coordinates" node, but xy. It's a variant that exists purely to get coordinates out.
What it's for
The 2026 pattern for "don't paint the mask, name the object" is: Florence-2 (or any VLM) grounds the object → take its bounding box → feed that box to SAM for a mask → inpaint or detailer that region. That's exactly the pipeline this node slots into, one step after whichever Florence-2 node pack you already run - kijai's ComfyUI-Florence2 being the usual companion (locals literally call it "the one without xy in the name"). Once you have clean X/Y values, they feed region-conditioning nodes, area-based samplers, or the Impact Pack's BBOX-based detectors and SEGS detailer.
How it works
Mechanically it's about as simple as a node gets - pure Python stdlib, no model, no network. You give it the JSON string an object-detection run produced. The node tries to be lenient about your Florence pack's serialization: it swaps single quotes for double quotes and runs json.loads, which covers both real JSON and the Python-repr dicts some nodes spit out. Then it walks the boxes, picks the ones you asked for, and unpacks each as min_x, min_y, max_x, max_y.
The inputs that matter:
- data (JSON) - the detection output from your Florence-2 OD run.
- index (STRING, default
"0") - which box to pull. Comma-separated for several, blank for all. This is the one you'll actually touch. - batch (BOOLEAN) - walk every image in the batch instead of just the first.
- source (IMAGE) - required, but here's the quirk: the code never reads it. It's a placeholder tying the JSON to an image. Wire in anything.
Outputs: x and y (INTs) are the top-left corner of the first selected box - that's the coordinate most downstream nodes want. bboxes (BBOX) is every selected box in full [x1, y1, x2, y2] form, ready for Impact Pack's detector nodes.
Install
No models, no pip dependencies - the Florence-2 weights live in the upstream node pack, not here. Either way:
cd ComfyUI/custom_nodes
git clone https://github.com/Rinsanga1/comfyui-florence2xy
then restart ComfyUI. Or skip the terminal and search "comfyui-florence2xy" in ComfyUI Manager.
Where people get burned
- "There's nothing in index: 0" - this is the real one, and it's usually not this node's fault. It means the detection returned no box at that index, which almost always traces to the upstream Florence-2 model not being downloaded or the OD task genuinely finding nothing. The classic community fix is downloading the model file you actually selected.
- Dict-shaped boxes explode. The node unpacks each box as four plain numbers. If your Florence pack outputs
{'x1':…, 'y1':…}dictionaries, you'll get aTypeError- convert them to lists first. - It's top-left only. If you want the center of the box, you're doing arithmetic yourself.
It's a fiddly little utility with a silly name, but when you're one step away from "Florence named it, SAM masked it, the region is fixed," this is the node that closes the gap.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| data | JSON | — | |
| source | IMAGE | — | |
| index | STRING | 0 | — |
| batch | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| x | INT | — |
| y | INT | — |
| bboxes | BBOX | — |