KJNodes/imagegenerated

BBOX to Bounding Box KJ(BBOXToBoundingBoxKJ)

The BBOX to Bounding Box KJ node converts a KJNodes BBOX value into the native BOUNDINGBOX format used by core ComfyUI nodes such as Crop Image.

BBOX To Bounding Box KJ

bbox
bounding_box
bbox_format
xywh
index
0
KJNodes

Description

The BBOX to Bounding Box KJ node converts a KJNodes BBOX value into the native BOUNDINGBOX format used by core ComfyUI nodes such as Crop Image. Use it as a bridge when a bounding box is produced by a KJNodes node but needs to be consumed by a core node that expects the native bounding-box dictionary.

The node accepts either a single box or a list of boxes. If the input contains multiple boxes, the index widget selects which one is converted and returned.

Inputs

bbox

The KJNodes BBOX to convert. This can come from any KJNodes node that produces a BBOX. Both a single box and a list of boxes are accepted.

bbox_format

A required combo widget that describes the layout of the incoming BBOX values. Available options:

  • xywh: values are laid out as x, y, width, height. This is the default.
  • xyxy: values are laid out as x1, y1, x2, y2.

Choose the format that matches how the connected KJNodes node produced the bounding box, so the values are interpreted correctly.

index

A required integer widget with a default of 0, a minimum of 0, and a maximum of 4096. When the bbox input contains multiple boxes, this selects which box is output. 0 selects the first box, 1 the second, and so on.

If index is higher than the number of available boxes, it is clamped to the last box rather than causing an error.

Outputs

BOUNDINGBOX

The converted native bounding-box value, suitable for core nodes such as Crop Image. Only one box is returned. If the input contained a list of boxes, the output is the box selected by index.

Usage Notes

  • For a single-box input, index has no practical effect, but bbox_format must still match the incoming layout.
  • For multi-box inputs, set index to choose the desired box. Out-of-range values clamp to the final box in the input.
  • This node changes the representation used between KJNodes and core ComfyUI nodes; it does not process every box in a list at once. To work with multiple boxes individually, select each one with a different index or split the boxes upstream.

Comments

Sign in with GitHub to join the discussion.

Loading comments…