Ideogram Element Builder
One Bounding Box, One Palette, One Piece of the Scene
- element_json
- bbox_preview
Ideogram 4's regional control works through compositional_deconstruction: you describe the scene as a list of elements, each with its own bounding box, its own description, and optionally its own color palette. It's the closest thing open-weights has to genuine spatial prompting - boxes can even overlap and nest - but writing one by hand means getting nested JSON, [ymin, xmin, ymax, xmax] ordering, and palette limits right by memory. IdeogramElementBuilder builds one of those elements from plain inputs, no JSON in sight.
The node's purpose is narrow and it's honest about it: you wire several builders in parallel, each describing one region of your scene, and feed them into IdeogramElementCollector, which assembles the full block. Think of it as one slot in a cast list.
What you set
element_type-objortext. Defaultobj. Choosetextwhen the element is in-image text (an Ideogram specialty), and fill intext_content- it's ignored when the type isobj.description- what the element is. "red sports car," "neon sign reading OPEN," whatever belongs in that box.- The four box edges:
bbox_ymin,bbox_xmin,bbox_ymax,bbox_xmax- INTs, 0 to 1000. Note the order: it's[ymin, xmin, ymax, xmax], which is the official Ideogram element schema order and not the[x, y, x, y]you might expect from other tooling. This is the single most common confusion point, so the pack's README calls it out in bold. color_palette(optional) - a hex-array JSON string, max 5 colors. WireIdeogramElementPalette(orIdeogramMaskedPaletteExtractorclamped to 5) into this to give the region its own reference colors.
Outputs: element_json (one element object, ready for the collector) and bbox_preview (a human-readable summary plus any warnings - handy for catching a bad box before it reaches the collector).
The guardrails are the selling point
Box edges get clamped to 0–1000, inverted edges (ymax below ymin) get swapped instead of producing nonsense, and a malformed palette is dropped with a warning rather than crashing. Those aren't flashy features, but they're exactly what you want when you're dragging boxes around numerically. The defaults (0, 0, 500, 500) describe the top-left quarter of the canvas, which is a sensible starting box to nudge.
Installing it
Part of the pack - one install, fifteen nodes. ComfyUI Manager: search "Ideogram Palette and Prompt Tools". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/SurrealByDesign/ComfyUI-Ideogram-Palette-and-Prompt-Tools
Restart ComfyUI. Only extra dependency: scikit-learn (Manager auto-installs it; otherwise pip install scikit-learn). torch/numpy/Pillow deliberately not pinned. Nodes under Ideogram/Palette, Python ≥ 3.10, tested on ComfyUI 0.24.0 / Python 3.12.
Gotchas and troubleshooting
[ymin, xmin, ymax, xmax], seriously. If your elements land in the wrong place, you reversed the axis order. It's the top mistake people make with this schema.- Text elements want
text_content. Atextelement with an emptytext_contentgets a placeholder in the source - fill it or your in-image text comes out blank. - Palette too long? It's capped at 5 and excess is silently trimmed (or dropped if malformed). Use
IdeogramElementPaletteupstream so you never fight this. - A single builder isn't a prompt. It outputs one element; you still need the collector (and then the prompt assembler / validator) to produce something Ideogram will accept. Don't wire
element_jsoninto a generation node expecting a full prompt.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| element_type | COMBO | obj | 2 options: obj, text |
| description | STRING | — | |
| bbox_ymin | INT | 00–1000 | — |
| bbox_xmin | INT | 00–1000 | — |
| bbox_ymax | INT | 5000–1000 | — |
| bbox_xmax | INT | 5000–1000 | — |
| color_paletteopt | STRING | — | |
| text_contentopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| element_json | STRING | — |
| bbox_preview | STRING | — |