Ideogram Mask Build (Kora)
Draw your layout, let Ideogram 4 fill it in
- image
- bboxes
- prompt
- preview
- bboxes
- width
- height
- mask
- image
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 onnoneto 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.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464–16384 | Canvas aspect width (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16. |
| height | INT | 102464–16384 | Canvas aspect height (also the pixel grid the bbox is measured in). Ideogram 4 needs multiples of 16. |
| high_level_description | STRING | Optional one-line overview of the whole image (blank = omitted). | |
| background | STRING | Required scene background description. | |
| style | COMBO | 3 options: [object Object], [object Object], [object Object] | |
| aesthetics | STRING | Style descriptor (blank = omitted). | |
| lighting | STRING | Style descriptor (blank = omitted). | |
| medium | STRING | Style descriptor (blank = omitted). | |
| add_mask_to_background | INT | 00–100 | — |
| 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 | 1000–100 | Background image brightness % (managed by the node UI slider). |
| sketch_data | STRING | [] | — |
| 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. |
| imageopt | IMAGE | Optional reference image shown as the editor background (and behind the preview). | |
| import_jsonopt | STRING | Optional: a full caption JSON. When connected, it loads into the editor and drives the output per 'import_mode'. | |
| bboxesopt | BOUNDING_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)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| preview | IMAGE | — |
| bboxes | BOUNDING_BOX | — |
| width | INT | — |
| height | INT | — |
| mask | MASK | — |
| image | IMAGE | — |