Nodes/ComfyUI/Create Bounding Boxes
ComfyUI Node Runs on cloud

Create Bounding Boxes

Draw boxes on a canvas, get Ideogram-style prompt elements out

By Comfy-Org·Created 4 years ago·Updated 20 days ago· 121,575
Create Bounding Boxes
  • editor_state
  • background
  • preview
  • bboxes
  • elements
width1024
height1024

Here's the workflow this node is for: you want this character on the left, that object on the right, and text that actually renders - and you don't want their attributes bleeding into each other. Models like Ideogram 4 were trained on structured prompts where every element has a bounding box. Writing that JSON by hand is miserable. Create Bounding Boxes gives you a canvas, lets you draw the boxes, and does the conversion for you. It's core ComfyUI's answer to the regional-prompting problem, minus the masks.

It ships with ComfyUI core, landed in 2026, and is flagged experimental - treat it as new but genuinely useful, not as a toy.

How it works

You set a canvas width and height - these define the pixel grid your boxes map onto - and draw rectangles in the editor_state canvas. Each box can carry a type (text or object), its text content, a description, and a color palette. The node then does three conversions for you:

  • A preview image of the canvas with boxes and labels drawn on it (so you can see what you built without leaving the graph).
  • The bounding boxes as pixel-space rectangles for your exact canvas size.
  • The elements array - the structured prompt elements with normalized coordinates in the 0–1000 range ([ymin, xmin, ymax, xmax]), element type, text, description, and color palette. That last output is the whole point: it's the format Ideogram-family and similar models expect for regional control.

The ordering rule is in the tooltip and it's not optional: background elements first, foreground last. The model reads the list as stacking order, and getting it backwards produces objects hiding each other instead of composing.

The inputs that matter

Three required: width and height (the canvas grid, 64–16384), and editor_state - the drawing canvas itself. One optional input worth knowing: background, an image you can drop in to trace over, so you can draw boxes on top of a reference composition instead of a blank void.

Outputs: preview (IMAGE), bboxes (the pixel rectangles), and elements (the prompt structure).

Where people get burned

The big one: this is not a universal regional-prompting tool. It feeds models that were trained on structured JSON prompts - that's Ideogram 4 and friends, where the JSON schema is the documented prompt format. If you're on an SDXL checkpoint or Flux, a box drawn here has nowhere to go; you'd want a latent/attention-based regional setup instead. Match the node to the model.

Second: box precision is a real skill. Overlapping or sloppy boxes produce exactly the concept bleed the technique exists to fix. Draw deliberately, and keep your background box generous so the model knows what surrounds the foreground.

Third: the elements output expects a consumer. There's no point drawing boxes unless something downstream accepts elements - typically a structured-prompt builder or the model's own conditioning path. If you load this node and see the array with nowhere to plug it, that's the missing half of the pipeline.

Categoryutilities

Inputs (4)

NameTypeDefaultDescription
widthINT102464–16384Width of the canvas and the pixel grid for the bounding boxes.
heightINT102464–16384Height of the canvas and the pixel grid for the bounding boxes.
editor_stateBOUNDING_BOXESDraw bounding boxes and set each box type, text, description, color palette. Start with background element first and foreground last.
backgroundoptIMAGEOptional image used as background in the canvas and preview.

Outputs (3)

NameTypeDescription
previewIMAGE
bboxesBOUNDING_BOX
elementsARRAY