Ideogram Magic Prompt
Ideogram 4 won't read plain English — this node translates it for free
- json_caption
Ideogram 4 is a picky date. It was trained on structured JSON captions - hex palettes, layout boxes, typed style fields - and it shows: feed it plain prose and it underperforms, sometimes badly. That's the whole reason this node exists. You type a ginger cat wearing a tiny wizard hat reading a spellbook, and it hands back the JSON caption Ideogram 4 actually expects, by asking Ideogram's own hosted magic-prompt API to do the translation for you. No model download, no GPU usage, no local LLM. Just a free API key and a couple of seconds.
The name isn't a lie, for once: "magic prompt" is Ideogram's hosted service this calls, at api.ideogram.ai. The node is a thin client for it.
How it works
Under the hood it's a single POST to https://api.ideogram.ai/v1/ideogram-v4/magic-prompt with your prompt, the aspect ratio, and an Api-Key header. The response's json_prompt is then cleaned up: the echoed aspect ratio and any bbox fields are stripped out, so what you get is a clean drop-in for an Ideogram 4 generation node rather than a caption that fights your sampler settings. Round trip is typically 2–5 seconds. The whole thing runs on Python's standard urllib - there is no heavier dependency hiding in here.
The inputs that matter
Only four, and you'll touch three of them on day one:
- prompt - your plain-text description. Multiline, so don't be shy.
- api_key - from ideogram.ai/api/learn/. Leave it empty and the node throws immediately, which is the most common first-run stumble.
- aspect_ratio - a combo with 18 ratios plus
AUTO, defaulting to1x1. Set it to the ratio you'll actually generate at so the caption's composition matches the frame. It's a guide for the layout, not a hard crop. - suppress_artifacts - boolean, on by default. It appends the "clean signal, no grain, sharp focus" snippet to the caption, which is Ideogram 4's closest thing to a negative prompt. If you'd rather control that later with the companion node, flip it off.
Output and where it wires in
The single output, json_caption, is a string. ComfyUI renders it as a collapsible JSON tree on the node (via its built-in JsonPreview), which makes it nice to eyeball before generating. Wire it straight into the prompt input of any Ideogram 4 generation node, or paste it into the gradio UI. It's plain text, so it also flows through whatever text-handling nodes you already have.
Installing it
The pack is tiny and has zero pip dependencies, which makes install painless:
cd ComfyUI/custom_nodes
git clone https://github.com/hardhant/ComfyUI-AliAn-Ideogram-Magic-Prompt
Restart ComfyUI and look under Add Node → Ideogram. Or, easier, use ComfyUI Manager and search for "Ideogram Magic Prompt" (or the repo name) - it reads the pack's pyproject.toml for metadata and installs for you. The node targets the modern V3 ComfyUI node API but re-exports the legacy NODE_CLASS_MAPPINGS, so older installs work too.
Gotchas worth knowing
Because this is a hosted call, your prompt text leaves your machine and hits Ideogram's servers. If that bothers you, the local alternative is Kijai's KJNodes prompt builder, which does the prose-to-JSON job offline and lets you draw bounding boxes on a canvas. This node is the no-fuss path when you don't need that level of layout control - and honestly, most people don't.
You're also trusting Ideogram's API to be up. When it's not, the node surfaces a clear "unreachable" error instead of failing silently, and an HTTP error comes back with the server's message attached, so troubleshooting is mostly reading the error box. There are no weights to download and nothing to configure beyond the key - which is exactly why the community autopsy of Ideogram 4 kept pointing at "JSON authoring time" as a reason people drifted away. This node deletes that cost.
It's the fastest route from a vague idea to a working Ideogram 4 render: prompt in, JSON out, generate. Free, stateless, and over in seconds.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Plain-text prompt to expand. | |
| api_key | STRING | IDEOGRAM_API_KEY from https://ideogram.ai/api/learn/ | |
| aspect_ratio | COMBO | 1x1 | Closest aspect ratio for which to lay out the caption. |
| suppress_artifacts | BOOLEAN | true | Append the negative-prompt snippet (no noise, no blur, no jpeg, no chromatic aberration...) to the caption. Ideogram 4 has no native negative_prompt field; this is the closest equivalent. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json_caption | STRING | Stringified JSON caption -- feed to Ideogram4 generate. |