Nodes/comfyui_face_parsing/BBoxDecompose(FaceParsing)
ComfyUI Node

BBoxDecompose(FaceParsing)

Crack a bounding box open into its four numbers

By Ryuukeisyou·Created 3 years ago·Updated about a year ago· 193
BBoxDecompose(FaceParsing)
  • bbox
  • l
  • t
  • r
  • b

A BBOX in this pack is an opaque object - a box, treated as a unit, that passes between detection, cropping, and compositing nodes without you ever seeing the raw numbers. Most of the time that's exactly what you want. But every so often you need the actual left/top/right/bottom coordinates directly - feeding them into a math node, comparing box positions, building custom logic ComfyUI's built-in nodes can work with - and BBOX isn't a type most non-face-parsing nodes understand. BBoxDecompose is the escape hatch: hand it a box, get back four plain integers.

The input and outputs

One input, bbox (BBOX), required - nothing to configure, this node just unpacks it.

Four outputs, all INT: l (left), t (top), r (right), b (bottom) - the box's edges as plain coordinates you can wire into any generic math or logic node in ComfyUI.

When you'd actually use this

This is a utility node for when you're doing something the rest of the pack doesn't have a dedicated node for - say, computing a box's width or height yourself (r - l, b - t) to feed a conditional, or comparing two boxes' positions to decide which face is more centered in frame. If you're just running the standard detect → crop → parse → composite chain, you'll likely never touch this node; it's here for when you need to break out of that chain and do custom math.

Installing it

Bundled with the pack:

  • ComfyUI Manager - search "comfyui_face_parsing", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Ryuukeisyou/comfyui_face_parsing.git, restart ComfyUI.

No dependencies beyond the pack - this is pure data unpacking.

Common issues

Nothing really breaks here on its own; the coordinate values are exactly what the upstream detector or padding node produced. The thing worth double-checking is orientation - t (top) will be a smaller number than b (bottom) in standard image coordinates, where y increases downward, which trips people who assume "top" means the larger value. If downstream math produces a negative height or width, that's almost always a sign the coordinates got mixed up somewhere, not that this node computed something wrong.

If you find yourself reaching for this node a lot, it's worth pausing and checking whether there's a purpose-built node in the pack that already does what you're rebuilding by hand. BBoxResize handles rescaling to a new image size, and MaskToBBoxList and the crop nodes already handle the common geometry operations without you touching raw coordinates at all - BBoxDecompose is meant for the genuine edge cases those don't cover, not as a default first step in every bbox-handling chain.

Categoryface_parsing

Inputs (1)

NameTypeDefaultDescription
bboxBBOX

Outputs (4)

NameTypeDescription
lINT
tINT
rINT
bINT