Nodes/comfyui-fvmtools/K2 Region from BBox
ComfyUI Node

K2 Region from BBox

Turns a detector bounding box into a K2 region. Accepts BBOX/BOUNDING_BOX lists as produced by KJNodes' Ideogram prompt builder, YOLO detectors or FVM person selectors. Supports xywh and xyxy, absolute pixels or normalized 0..1 coordinates.

By ping1979ping·Created 5 months ago·Updated 21 days ago· 0
K2 Region from BBox
  • regions
  • bboxes
  • bounding_box
  • regions
nameSubject
prompt
bbox_index0
bbox_formatxyxy
reference_width1024
reference_height1024
grow_px0
roleauto
priority100
identity_prompt
CategoryFVM Tools/K2

Inputs (13)

NameTypeDefaultDescription
nameSTRINGSubjectLabel for this detected region. Must be unique.
promptSTRINGWhat should appear inside the detected box.
bbox_indexINT00–64Zero-based index into the bbox list. Out-of-range clamps to the last entry.
bbox_formatCOMBOxyxyxyxy = left/top/right/bottom (what YOLO, BOUNDING_BOX and the KJ prompt builder emit). xywh = left/top/width/height. auto tries xyxy first and only falls back to xywh when that yields an impossible box — it cannot always tell them apart, so set the format explicitly when you know it.
reference_widthINT102416–16384Canvas width used to expand normalized coordinates.
reference_heightINT102416–16384Canvas height for normalized coordinates. Must match the render size.
grow_pxINT0-512–512Expand (or shrink) every side.
roleCOMBOautosubject / background / auto — same meaning as on K2 Region.
priorityINT100-1000–1000Higher compiles first and claims ambiguous faces first.
regionsoptK2_REGIONChain input: previously defined regions.
bboxesoptBBOXKJNodes-style BBOX list.
bounding_boxoptBOUNDING_BOXStandard BOUNDING_BOX input. Takes precedence over bboxes.
identity_promptoptSTRINGFace/identity description for this region.

Outputs (1)

NameTypeDescription
regionsK2_REGION