Rect to Floats
Unpack a rectangle into plain float coordinates
- tinyrect
- x
- y
- w
- h
- x2
- y2
- center_x
- center_y
Rect to Floats takes a TINYRECT - TinyBee's packaged rectangle - and breaks it out into plain numbers you can wire anywhere. x, y, width, height, and the derived right/bottom edges come out as FLOAT outputs, so a rectangle stops being an opaque object and becomes ordinary values.
Why you'd reach for it
TINYRECT is convenient inside the rectangle family, but the moment a rectangle has to leave it - feeding a crop node that wants x/y/width/height, positioning text, talking to a node from another pack - you need the numbers out. This is the adapter. Anything that produces a tinyrect (Rect From Image, Select Bounding Box, Get Mask Bounding Box) can feed this node, and you get coordinates you can route into any FLOAT input in your graph.
How it works
The rect is stored as (x, y, w, h), and the node unpacks those four floats, then computes the far-edge coordinates from them: x2 = x + w and y2 = y + h. Everything comes out as floats, preserving whatever precision the rect carried.
The inputs that matter
- tinyrect - the rectangle to unpack.
Outputs:
- x / y - top-left corner.
- w / h - width and height.
- x2 / y2 - the bottom-right corner (x+w, y+h).
(Current builds also expose center_x and center_y - the box's midpoint - as two extra FLOAT outputs, so don't be surprised to see them in the node.)
Installing it
TinyBee pack: ComfyUI Manager → Install Custom Nodes → search "ComfyUI-TinyBee", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
Under 🐝TinyBee/Rectangles. Stdlib only.
Common issues
Remember the outputs are floats, not integers. If a downstream node expects pixel coordinates and does integer math, you can silently land on half-pixel values - route through Rect to Ints (which truncates or rounds) when the consumer is pixel-based. And like all TINYRECT nodes, the input only accepts the pack's rectangle type; you can't type numbers into it directly. If you need to build a rect from numbers instead of unpack one, that's the sibling Floats to Rect.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tinyrect | TINYRECT | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| x | FLOAT | — |
| y | FLOAT | — |
| w | FLOAT | — |
| h | FLOAT | — |
| x2 | FLOAT | — |
| y2 | FLOAT | — |
| center_x | FLOAT | — |
| center_y | FLOAT | — |