Nodes/was-node-suite-comfyui/Bounding Box Editor
ComfyUI Node Runs on cloud

Bounding Box Editor

Draw layout boxes on a picture or a blank frame and give each a kind, caption, text and colour palette. Hands them on as bounding boxes, prompt elements, bounds and masks for MOSS-Image and FLUX 3 layout prompts and the cropping and masking nodes. A layout drawn at one size is refitted to another without stretching.

By WASasquatch·Created 4 years ago·Updated about 9 hours ago· 1,884
Bounding Box Editor
  • image
  • bboxes
  • preview
  • bboxes
  • elements
  • width
  • height
  • character_boxes
  • bounds
  • masks
◄width1024►
◄height1024►
◄layout►
◄on_resizefit►
◄grid16►
◄bboxes_modeadd►
CategoryWAS Suite/Image/Bound

Inputs (8)

NameTypeDefaultDescription
widthINT102416–16384Frame width in pixels when no image is wired. `1024` = 1024px wide. A wired image's own width replaces it.
heightINT102416–16384Frame height in pixels when no image is wired. `1024` = 1024px tall. A wired image's own height replaces it.
layoutSTRINGThe boxes as JSON the panel writes, such as `{"frame": [1344, 768], "boxes": [...]}`. Empty = no boxes. Paste a layout from another Bounding Box Editor, a Create Bounding Boxes box list or a prompt element list.
on_resizeCOMBOfitUsed when the layout was drawn at another frame size. `fit` = whole layout inside, unstretched; `fill` = covers the frame, edges may be cut; `stretch` = scaled to the frame, shapes change; `keep size` = pixel size kept, centred.
gridINT161–256Pixels box edges snap to while drawing in the panel and when a layout is refitted. `1` = no snapping; `16` = 16px steps; `64` = coarse blocks.
bboxes_modeCOMBOadd`add` = incoming boxes come after the layout's own; `replace` = only the incoming boxes are output; `ignore` = the input is not read.
imageoptIMAGEOptional picture to lay boxes over. Its size replaces width and height, and its first frame is drawn behind the boxes in the panel and preview.
bboxesoptBOUNDING_BOX,BOUNDING_BOXES,ARRAY,STRINGBoxes to start from: SAM3 Detect or Run Real-Time Detection results, a Create Bounding Boxes output, prompt elements or JSON text, in the frame's pixels. bboxes_mode decides how they join the layout.

Outputs (8)

NameTypeDescription
previewIMAGEThe boxes numbered and captioned over the image, or over a dark frame, at most 1024px on the long edge.
bboxesBOUNDING_BOXEvery box in pixels, carrying its kind, caption, text and palette, for Crop By Bounding Boxes, Draw BBoxes, SAM3 Detect or another editor.
elementsARRAYPrompt elements for MOSS-Image Layout Prompt and FLUX 3 Image Layout Prompt, numbered back to front as the preview shows.
widthINTWidth of the frame the boxes are in: the image's when one is wired, otherwise the width widget. Wire it into the layout prompt's width.
heightINTHeight of the frame the boxes are in: the image's when one is wired, otherwise the height widget. Wire it into the layout prompt's height.
character_boxesSTRINGNumbers of the `character` boxes, such as `2, 5`, for MOSS-Image Layout Prompt's character_boxes input. Empty when there are none.
boundsIMAGE_BOUNDSOne bounds row per box, for Bounded Image Crop, Bounds to Mask or Draw Image Bounds.
masksMASKOne mask per box, white inside it, in box order. No boxes = one black mask the size of the frame.