Ideogram 4 Prompt Builder KJ(Ideogram4PromptBuilderKJ)
Visual prompt builder for Ideogram 4's structured JSON caption format. Drag on the canvas to draw regions; select a region to set its type (obj/text), description, text, and color palette. Set the background and optional style fields as widgets. Outputs the assembled caption JSON string. bbox is normalized to a 0-1000 grid as [ymin, xmin, ymax, xmax]; width/height set the canvas aspect ratio. Canvas controls: - Drag: draw a new region - Ctrl/Cmd-drag: force-draw a new region even on top of an existing one - Click: select a region · Alt-click: cycle overlapping regions - Double-click: edit the description inline - Right-click: region list (select / delete / duplicate / reorder, top = front) - Del / Backspace: remove the selected region - Ctrl/Cmd + C / V / D: copy / paste / duplicate the selected region - bbox fields (px / out) next to obj/text are editable Color swatches: - Click: edit · Drag: reorder · Right-click: remove - Hover + Ctrl/Cmd + C / V: copy / paste the hex - "+": add a color (uses the clipboard color if it is one) Toolbar: - Live: use the live sampling preview as the background (and grab the final result) - Grab BG / Clear BG: use the last generated image as the background - brightness slider, token estimate, and Copy / Paste / Clear all
Ideogram4 Prompt Builder KJ
Description
Visual prompt builder for Ideogram 4's structured JSON caption format.
This node provides an interactive editor inside ComfyUI that lets you draw regions on a canvas, assign object or text labels, descriptions, and color palettes, then assemble the final caption JSON string compatible with Ideogram 4's expected schema.
The editor supports drag-to-draw regions, selection, inline editing, copy/paste/duplicate, and full toolbar controls including background image management, brightness slider, token estimate, and clipboard operations.
Inputs
Required
| Name | Type | Default | Tooltip |
|---|---|---|---|
width | INT | 1024 | Canvas aspect width (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16. Min: 64, Max: 16384, Step: 16. |
height | INT | 1024 | Canvas aspect height (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16. Min: 64, Max: 16384, Step: 16. |
high_level_description | STRING | "" | Optional one-line overview of the whole image (blank = omitted). |
background | STRING | "" | Required scene background description. |
style | DYNAMICCOMBO | (dynamic) | Dropdown populated by the editor (likely style presets). |
aesthetics | STRING | "" | Style descriptor (blank = omitted). |
lighting | STRING | "" | Style descriptor (blank = omitted). |
medium | STRING | "" | Style descriptor (blank = omitted). |
style_palette_data | STRING | "" | Serialized style color palette from the editor (managed by the node UI). |
elements_data | STRING | "" | Serialized regions from the editor (managed by the node UI). |
bg_brightness | INT | 25 | Background image brightness % (managed by the node UI slider). Min: 0, Max: 100. |
import_mode | COMBO | "when empty" | How a wired import_json is used: "when empty" only seeds the editor while it has no regions (then the editor wins, so you can edit); "always" makes the wired JSON authoritative so its changes always propagate to the output. Options: ["when empty", "always"]. |
output_format | STRING | "compact" | Output JSON formatting (set via the editor toolbar): "compact" (default, what Ideogram 4 expects) or "pretty" (indented, for readability). |
coord_mode | STRING | "normalized" | bbox coordinate space (set via the editor toolbar): "normalized" (default, the 0‑1000 grid Ideogram 4 expects) or "absolute" (pixels, scaled by width/height — NON‑STANDARD for Ideogram, for other tools that want pixel coords). |
bbox_order | STRING | "yx" | bbox axis order (set via the editor toolbar): "yx" (default, Ideogram's [ymin, xmin, ymax, xmax]) or "xy" ([xmin, ymin, xmax, ymax], the standard x1,y1,x2,y2 that Qwen‑VL and most detectors use). |
photo | STRING | "" | (no tooltip in source) |
art_style | STRING | "" | (no tooltip in source) |
Optional
| Name | Type | Default | Tooltip |
|---|---|---|---|
image | IMAGE | — | Optional reference image shown as the editor background (and behind the preview). |
import_json | STRING | "" | Optional: a full caption JSON. When connected, it loads into the editor and drives the output per import_mode. |
bboxes | BOUNDINGBOX | — | Optional pixel-space boxes ({x, y, width, height}) used to seed the editor's regions when it has none. Ignored once regions exist. |
Outputs
| Index | Type | Description |
|---|---|---|
| 0 | STRING | The assembled caption JSON string in the chosen format (compact or pretty). |
| 1 | IMAGE | (likely the preview/background image, reused or captured via toolbar) |
| 2 | BOUNDINGBOX | (maybe the bounding boxes from the editor in pixel or normalized form) |
| 3 | INT | (unknown, possibly token count or region count) |
| 4 | INT | (unknown) |
Usage Notes / Editor Features
-
Canvas controls
- Drag: draw a new region.
- Ctrl/Cmd‑drag: force‑draw a new region even on top of an existing one.
- Click: select a region.
- Alt‑click: cycle overlapping regions.
- Double‑click: edit the description inline.
- Right‑click: region list (select / delete / duplicate / reorder; top = front).
- Del / Backspace: remove the selected region.
- Ctrl/Cmd + C / V / D: copy / paste / duplicate the selected region.
- bbox fields (px / out) next to obj/text are editable.
-
Color swatches
- Click: edit.
- Drag: reorder.
- Right‑click: remove.
- Hover + Ctrl/Cmd + C / V: copy / paste the hex.
- "+": add a color (uses the clipboard color if one is present).
-
Toolbar
- Live: use the live sampling preview as the background (and grab the final result).
- Grab BG / Clear BG: use the last generated image as the background.
- Brightness slider, token estimate, and Copy / Paste / Clear all.
-
Bounding boxes are normalized to a 0–1000 grid as
[ymin, xmin, ymax, xmax]by default;widthandheightset the canvas aspect ratio. -
Import mode behaviour:
"when empty": Only imports the JSON if the editor has no regions yet. Once you edit, the editor takes over."always": The wired JSON is authoritative; any change in the JSON forces the output, overwriting editor state.
-
Coordinate modes and bbox order are configurable for compatibility with different downstream models. Ideogram 4 expects
"normalized"and"yx". -
Output format:
"compact"(no whitespace) is what Ideogram 4 expects;"pretty"(indented) is for human readability. -
imageinput is optional and provides a reference background in the editor, but does not affect the generated JSON. -
The
style_palette_data,elements_data, andbg_brightnessinputs are internal serialized state – the node UI manages these automatically when you interact with the editor. -
Both
photoandart_styleare additional string fields that may map to Ideogram's caption structure (no further details in source).
Comments
Sign in with GitHub to join the discussion.