Ideogram4 Bbox Editor
Draw your boxes right on the node
- image
- florence_data
- prompt
- preview
- bboxes
- width
- height
Ideogram 4 is a fantastic model that refuses to be prompted like one. It was trained exclusively on structured JSON captions, so plain prose underperforms badly, and to get its precise layout control you're expected to hand it bounding boxes as [ymin, xmin, ymax, xmax] plus typed text elements for anything legible in the image. The first week everyone loved the model and hated the JSON. This node is the "hated the JSON" part, fixed: a visual editor that lives on the node itself, where you draw, drag and resize rectangles instead of typing coordinates.
Before you ask: no, it doesn't run the model. It builds the caption. You still load the Ideogram 4 checkpoint (fp8 or nf4 from HF) with its own loader - this node's job is producing the JSON that feeds it. And remember the model's non-commercial license.
How it works
All the interesting machinery is frontend: a single JS file in the pack's web/ folder draws the editor on the canvas and holds your caption in a hidden caption_json STRING input. That hidden field is the trick: because it's a real widget value, your caption saves with the workflow, reloads on reopen, and even comes back if you drop in a saved image whose embedded workflow contains it. The backend is deliberately thin - stdlib only, zero pip dependencies - it parses the JSON and renders your output.
The editor works on a 0–1000 grid - normalized, which is exactly what the model's schema wants - with aspect-ratio presets (1:1, 4:5, 9:16, 16:9, 3:1) plus a free custom W:H. Each element can be an obj or text type, with an optional bbox per element, multi-line text for text regions, a desc, and z-order controls for overlapping boxes. There's a live validation panel that flags v15 guideline violations as you type - word caps (HLD ≤ 50, desc ≤ 60), floor/pavement language smuggled into an element instead of background, missing text in built environments. It's opinionated, and that's the point.
The inputs and outputs that matter
Most of the inputs you can ignore at first - caption_json is managed by the editor, not you. The ones that matter:
width/height(default0).0means "use the aspect ratio picked in the editor." Set both above0and they override the ratio and set the actual pixel grid for the bbox and preview outputs. Right-click either one → convert to input to wire in a resolution node.import_json- paste any caption JSON (or wire one in); it unwrapscaption/data/resultwrappers and doubly-encoded JSON, then loads it into the editor. The output always reflects the editor, never the raw input.image- an optional reference image, dimmed behind the preview and used as the editor backdrop.florence_caption,florence_data,florence_regions- auto-fill from Kijai'scomfyui-florence2, so you can seed regions from a real image instead of drawing from scratch.florence_regionsis the one to know: it recovers the per-region labels that Kijai'sdatadrops for OD/dense tasks.
Outputs: prompt (STRING) is the caption JSON - wire it into a CLIPTextEncode or any string consumer. preview (IMAGE) renders boxes and tags over the canvas. bboxes (BOUNDING_BOX) is pixel-space, ready for SAM3 / crop / mask nodes. width / height (INT) pass the resolved size through.
Install
Zero dependencies, zero model downloads - the whole pack is one Python file plus one JS file, MIT-licensed. In ComfyUI Manager, search comfyui-ideogram4-bbox-editor, or just:
cd ComfyUI/custom_nodes
git clone https://github.com/quzopl/comfyui-ideogram4-bbox-editor.git
Then restart ComfyUI. The only optional extra is comfyui-florence2 if you want the auto-fill wiring.
Gotchas worth knowing
- It's an editor, not a generator. New people wire it up, hit run, and wonder where the image went - you still need the Ideogram 4 checkpoint and its loaders in the graph.
- Grid vs pixels. The JSON uses the 0–1000 normalized grid; the
bboxesoutput is pixel-space. Don't feed one where the model expects the other. - v15 has no
style_description. The v14 style block is off by default - if you toggle it on, the output emits it but validation stays silent. v15 wants style as prose insidehigh_level_description/background. - The word-count warnings aren't errors. Auto-filling from a
more_detailed_captionruns ~150 words and will always trip the 50-word HLD warning. It's telling you to trim, not breaking anything. - Auto-fill is polite. Florence seeds only re-apply when the Florence output changes, so re-running the graph won't clobber boxes you've already nudged. That's a feature, not a bug.
If you're doing deliberate Ideogram 4 layout work - posters, banners, T-shirt art - this is the node I'd reach for over raw JSON typing. It won't write your composition for you, but it'll yell at you until the composition is valid, which is honestly most of the battle.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| caption_json | STRING | {} | — |
| width | INT | 00–16384 | Target width. 0 = use the aspect ratio set in the editor. When both width and height are > 0 they override aspect_ratio (W:H) and set the pixel grid for the bboxes/preview outputs. |
| height | INT | 00–16384 | Target height. 0 = use the aspect ratio set in the editor. |
| imageopt | IMAGE | Optional reference image: dimmed behind the preview output and shown as the editor backdrop (loads on run). | |
| import_jsonopt | STRING | Optional caption JSON loaded into the editor on run. The output always reflects the editor, never this raw input. | |
| florence_captionopt | STRING | Florence2Run `caption` -> high_level_description (auto-fill on run). | |
| florence_dataopt | JSON | Florence2Run `data` (region/OCR boxes). Auto-placed as elements; needs the `image` input connected (boxes are in image pixel space). Note: kijai's `data` has no per-region labels for OD/dense — use `florence_regions` for labeled boxes. | |
| florence_regionsopt | STRING | A region task's raw `caption` (label<loc_..> string). Parsed into labeled boxes (desc = label) — recovers labels that `data` drops. Coords are normalized, so no `image` needed. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| preview | IMAGE | — |
| bboxes | BOUNDING_BOX | — |
| width | INT | — |
| height | INT | — |