KJNodes/textgenerated

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

style
image
bboxes
prompt
preview
bboxes
width
height
width
1024
height
1024
high_level_description
STRING
background
STRING
aesthetics
STRING
lighting
STRING
medium
STRING
import_json
STRING
style_palette_data
STRING
elements_data
STRING
bg_brightness
25
import_mode
when empty
output_format
compact
coord_mode
normalized
bbox_order
yx
photo
STRING
art_style
STRING
KJNodes

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

NameTypeDefaultTooltip
widthINT1024Canvas aspect width (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16. Min: 64, Max: 16384, Step: 16.
heightINT1024Canvas 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_descriptionSTRING""Optional one-line overview of the whole image (blank = omitted).
backgroundSTRING""Required scene background description.
styleDYNAMICCOMBO(dynamic)Dropdown populated by the editor (likely style presets).
aestheticsSTRING""Style descriptor (blank = omitted).
lightingSTRING""Style descriptor (blank = omitted).
mediumSTRING""Style descriptor (blank = omitted).
style_palette_dataSTRING""Serialized style color palette from the editor (managed by the node UI).
elements_dataSTRING""Serialized regions from the editor (managed by the node UI).
bg_brightnessINT25Background image brightness % (managed by the node UI slider). Min: 0, Max: 100.
import_modeCOMBO"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_formatSTRING"compact"Output JSON formatting (set via the editor toolbar): "compact" (default, what Ideogram 4 expects) or "pretty" (indented, for readability).
coord_modeSTRING"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_orderSTRING"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).
photoSTRING""(no tooltip in source)
art_styleSTRING""(no tooltip in source)

Optional

NameTypeDefaultTooltip
imageIMAGEOptional reference image shown as the editor background (and behind the preview).
import_jsonSTRING""Optional: a full caption JSON. When connected, it loads into the editor and drives the output per import_mode.
bboxesBOUNDINGBOXOptional pixel-space boxes ({x, y, width, height}) used to seed the editor's regions when it has none. Ignored once regions exist.

Outputs

IndexTypeDescription
0STRINGThe assembled caption JSON string in the chosen format (compact or pretty).
1IMAGE(likely the preview/background image, reused or captured via toolbar)
2BOUNDINGBOX(maybe the bounding boxes from the editor in pixel or normalized form)
3INT(unknown, possibly token count or region count)
4INT(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; width and height set 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.

  • image input is optional and provides a reference background in the editor, but does not affect the generated JSON.

  • The style_palette_data, elements_data, and bg_brightness inputs are internal serialized state – the node UI manages these automatically when you interact with the editor.

  • Both photo and art_style are 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.

Loading comments…
Ideogram 4 Prompt Builder KJ (Ideogram4PromptBuilderKJ) - ComfyUI-KJNodes | ComfyUI Wiki