Nodes/KJNodes for ComfyUI/Ideogram 4 Prompt Builder KJ
ComfyUI Node Runs on cloud

Ideogram 4 Prompt Builder KJ

Draw your prompt for Ideogram 4's JSON format

By kijai·Created 3 years ago·Updated 2 days ago· 3,011
Ideogram 4 Prompt Builder KJ
  • image
  • bboxes
  • prompt
  • preview
  • bboxes
  • width
  • height
width1024
height1024
high_level_description
background
style
aesthetics
lighting
medium
style_palette_data
elements_data
bg_brightness25
import_modewhen empty
output_formatcompact
coord_modenormalized
bbox_orderyx
import_json

When Ideogram 4 released its open weights in mid-2026, it came with a catch: it wants prompts in a structured JSON format, not the plain sentence you'd type into any other model. Writing that JSON by hand - regions, bounding boxes, text elements, color palettes - is miserable. Ideogram4PromptBuilderKJ is the node the community reached for within about a day of the model landing. It gives you a visual canvas where you draw the regions of your image, set what goes in each, and it assembles the correct JSON caption for you. It's a GUI for a format that was clearly designed for machines.

Why it exists

Ideogram 4's standout is text rendering and precise layout - putting words and objects exactly where you want them. To do that it consumes a structured caption describing regions on a normalized grid rather than a free-form prompt. This builder lets you lay those regions out visually: drag on the canvas to draw a box, tell it whether that box is an object or text, describe it, and the node handles converting your layout into the [ymin, xmin, ymax, xmax] coordinates on the 0-1000 grid the model expects.

The inputs and the canvas

The real interface is the on-node canvas, described in detail in the node's own tooltip: drag to draw a region, click to select, double-click to edit its description, right-click for a region list you can reorder (top = front). You can set each region's type, text, and color palette, drop in color swatches, and even use the last generated image as a live background to trace over.

The widget inputs back that up:

  • width / height - the canvas aspect ratio, and the dimensions carried into the output.
  • high_level_description - the overall scene description.
  • background - the background prompt.
  • style, plus aesthetics, lighting, and medium - the optional style fields that flesh out the look.
  • bg_brightness - how bright the traced background shows on the canvas (a display aid, not part of the image).
  • output_format, coord_mode, bbox_order - control how the assembled JSON is written (compact vs not, normalized coordinates, yx ordering).

There are optional inputs for an image to use as the canvas background, an import_json to load an existing caption back in, and bboxes. The outputs are the assembled prompt string (the JSON you feed the model), a preview image, the bboxes, and the width/height.

Installing KJNodes

In ComfyUI Manager, search "KJNodes for ComfyUI" in the Custom Nodes Manager, install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), restart. The builder node itself needs nothing extra - but you'll separately need the Ideogram 4 model weights set up in your ComfyUI to actually generate.

Worth knowing

There's a bonus reason to use the JSON format that has nothing to do with layout: Ideogram 4 ships with a safety filter trained into the weights, and prompting through the structured schema - the format the vendor told you to use in the first place - is the community's noted way around a lot of its refusals. So the builder isn't just convenience; the format it produces is the one the model behaves best on.

The main friction is the canvas learning curve. It's a real little editor with its own drag/click/modifier vocabulary, so read the tooltip before you fight it. And the coordinate output only means something to Ideogram 4 - this is a purpose-built node for one model's prompt format, not a general prompt tool, so don't wire its JSON into an unrelated model and expect sense.

CategoryKJNodes/text

Inputs (18)

NameTypeDefaultDescription
widthINT102464–16384Canvas aspect width (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16.
heightINT102464–16384Canvas aspect height (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16.
high_level_descriptionSTRINGOptional one-line overview of the whole image (blank = omitted).
backgroundSTRINGRequired scene background description.
styleCOMBO3 options: [object Object], [object Object], [object Object]
aestheticsSTRINGStyle descriptor (blank = omitted).
lightingSTRINGStyle descriptor (blank = omitted).
mediumSTRINGStyle descriptor (blank = omitted).
style_palette_dataSTRINGSerialized style color palette from the editor (managed by the node UI).
elements_dataSTRINGSerialized regions from the editor (managed by the node UI).
bg_brightnessINT250–100Background image brightness % (managed by the node UI slider).
import_modeCOMBOwhen emptyHow 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.
output_formatSTRINGcompactOutput JSON formatting (set via the editor toolbar): 'compact' (default, what Ideogram 4 expects) or 'pretty' (indented, for readability).
coord_modeSTRINGnormalizedbbox 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_orderSTRINGyxbbox 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).
imageoptIMAGEOptional reference image shown as the editor background (and behind the preview).
import_jsonoptSTRINGOptional: a full caption JSON. When connected, it loads into the editor and drives the output per 'import_mode'.
bboxesoptBOUNDING_BOX[object Object]Optional pixel-space boxes ({x, y, width, height}) used to seed the editor's regions when it has none. Ignored once regions exist.

Outputs (5)

NameTypeDescription
promptSTRING
previewIMAGE
bboxesBOUNDING_BOX
widthINT
heightINT