Nodes/ComfyUI-Kora/Ideogram Mask Build (Kora)
ComfyUI Node

Ideogram Mask Build (Kora)

Draw your layout, let Ideogram 4 fill it in

By SvKora·Created 3 months ago·Updated 3 months ago· 1
Ideogram Mask Build (Kora)
  • image
  • bboxes
  • prompt
  • preview
  • bboxes
  • width
  • height
  • mask
  • image
width1024
height1024
high_level_description
background
style
aesthetics
lighting
medium
add_mask_to_background0
style_palette_data
elements_data
bg_brightness100
sketch_data[]
import_modewhen empty
import_json

Ideogram 4 does not speak prose. It was trained on a structured JSON caption format - bounding boxes, hex color palettes, typed text elements - and if you feed it a plain English prompt it underperforms badly and can even trip the safety filter that's baked into the weights. The fix the community landed on within a day of release was drawing boxes on a canvas. This node is that, turned up: Kijai's Ideogram 4 Prompt Builder from KJNodes, forked and heavily extended by SvKora into a full mini-editor with sketching, per-region masks, and hotkeys.

Here's the honest pitch. The prompt output is a JSON string in exactly the schema Ideogram 4 expects, so you wire it into your Ideogram 4 caption input and finally get layout control: the logo box actually contains the logo, the text box actually renders the words, the background stays background. That's regional control no other open model gives you, and it's worth the setup time if your deliverable is posters, banners, or anything with in-image text.

How it works

You drag on the canvas to draw regions. Each region gets a type (obj or text), a description, optional literal text, and a color palette. Set the background (required), optionally a one-line high_level_description, and a style via the style combo (none / photo / art_style) with aesthetics, lighting, and medium descriptors. The node assembles a compositional_deconstruction object with your regions as elements, converting each region's normalized box to the [ymin, xmin, ymax, xmax] 0–1000 grid Ideogram 4 wants. Note it: boxes can overlap and nest, and each can carry its own colors - that's a feature of the model, not a workaround.

The inputs that matter

Most of the schema is node-UI managed - elements_data, style_palette_data, sketch_data, and bg_brightness are socketless serialized state you can safely ignore. The ones a beginner actually sets:

  • width / height - canvas aspect, default 1024. Ideogram 4 needs multiples of 16, and the step size enforces it.
  • background - required scene background description. Blank it and you get a broken caption.
  • style + aesthetics / lighting / medium - the style block; leave the combo on none to skip it.
  • image - optional reference image shown as the editor background, so you can draw over an existing render.

Two inputs worth knowing: import_json loads a full caption JSON into the editor (with import_mode deciding whether it seeds once - "when empty" - or stays authoritative - "always"), and bboxes seeds regions from a detector or SAM3 in pixel space. The toolbar's "Live" mode grabs your last generated image as the background, which is how people fake inpainting on a model with no real img2img: draw a box, keep the seed fixed, re-run.

Outputs

The prompt string is the whole point - everything else is gravy. preview shows the boxes drawn over your background. bboxes gives pixel-space boxes for downstream SAM3/crop nodes. Then the Kora addition: mask composites your per-region masks (set mask_enabled, mask_opacity, and mask_blur per box) plus any brush strokes into a proper inpaint mask, and image is the sketch composite. Wire mask into an inpaint-conditioned workflow with a model that actually supports inpainting - Ideogram 4 itself isn't one.

Install

ComfyUI Manager, search "ComfyUI-Kora", install, restart - or:

cd ComfyUI/custom_nodes
git clone https://github.com/SvKora/ComfyUI-Kora

Then restart ComfyUI. Its only Python dependency is pillow, which ComfyUI already bundles, so there are no model downloads or heavy installs here. The heavy part is Ideogram 4 itself (the fp8 or nf4 checkpoint from Hugging Face, nf4 if you're on a single 24GB card).

Gotchas

The node is marked experimental, so expect the occasional rough edge in a brand-new editor. Where people get burned: forgetting background is mandatory, setting a non-multiple-of-16 canvas, and wiring import_json with the default "when empty" mode, then editing the JSON upstream and wondering why nothing changed - switch to "always" if the wired JSON should win. And one reminder from the KB that isn't about the node at all: Ideogram 4 is non-commercial, terminable on notice. Draw all the boxes you want, but don't sell the output.

CategoryKora/Ideogram

Inputs (17)

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).
add_mask_to_backgroundINT00–100
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_brightnessINT1000–100Background image brightness % (managed by the node UI slider).
sketch_dataSTRING[]
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.
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 (7)

NameTypeDescription
promptSTRING
previewIMAGE
bboxesBOUNDING_BOX
widthINT
heightINT
maskMASK
imageIMAGE