Nodes/Ideogram 4 Prompter/Ideogram 4 Magic Prompt
ComfyUI Node

Ideogram 4 Magic Prompt

Ideogram 4 won't listen to plain English — this node makes Ideogram write your own prompt

By Saganaki22·Created 3 months ago·Updated 3 months ago· 13
Ideogram 4 Magic Prompt
    • magic_prompt_json
    • aspect_ratio
    api_key
    prompt
    aspect_ratioAUTO
    seed0

    Here's the thing nobody warns you about with Ideogram 4: it was trained on structured JSON captions, not prose. Feed it "a red poster with the words SALE NOW in big letters" and it underperforms badly, because the model is expecting hex color palettes, bounding boxes, and typed text elements. Kijai's KJNodes prompt builder and a pile of community nodes exist to translate your intent into that schema locally. This one takes a different route - it sends your prompt to Ideogram's own hosted Magic Prompt API and lets their server write the JSON for you.

    The mechanism

    The name is a little on the nose: Magic Prompt is a real Ideogram API endpoint (https://api.ideogram.ai/v1/ideogram-v4/magic-prompt), not something the node invents. You drop in a free API key, a normal-English prompt, and an aspect ratio, and the node POSTs it to Ideogram with your key in the Api-Key header. What comes back is a structured json_prompt plus a resolved aspect ratio, which the node hands you as formatted JSON and as a separate output respectively.

    The appeal is dead simple: instead of burning local compute on an LLM trying (and often failing) to emit valid Ideogram JSON, you get the vendor's own schema for free. That's genuinely handy on weaker machines, and it's a lot less debugging than hand-writing the JSON. The tradeoff is that your prompt and key travel over the wire, you need an internet connection, and you get a JSON blob rather than the box-drawing control a full builder gives you. For most people that's a fair swap.

    The inputs that matter

    • api_key - the only thing that trips people up. Grab a free key at https://ideogram.ai/manage-api (sign up, click Generate API key, paste it in). It's sent as the Api-Key header.
    • prompt - your plain-text prompt, multiline. This is what gets enhanced.
    • aspect_ratio - AUTO is the default and lets Ideogram pick, followed by the exact 17 Ideogram 4 ratios (1x4 through 4x1).
    • seed - here's the trap. The tooltip calls it a "cache buster" and says changing it reruns for a different result, but the code doesn't even use it - it's accepted and discarded, and it's never sent to Ideogram. So if you change the seed expecting a different expansion, you'll be disappointed. Want a fresh result? Edit the prompt text. This is a placeholder for future behavior, not a working control.

    The outputs

    • magic_prompt_json - the API's json_prompt as pretty-printed JSON in a STRING. That goes straight into your Ideogram 4 sampler or workflow's prompt slot, where prose would have gotten you a mediocre render and possibly the grey refusal image (that's Ideogram's trained-in filter, not this node's fault - prompting through the documented JSON format is the known way around it).
    • aspect_ratio - the resolved ratio. This is the useful second half: wire it into the Ideogram4ResolutionSelector from the same pack so the Auto-chosen ratio drives your pixel dimensions.

    Install

    Zero friction. Through ComfyUI Manager, search for Ideogram 4 Prompter (or ideogram4_prompter-ComfyUI) and install, then restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Saganaki22/ideogram4_prompter-ComfyUI.git
    

    Then restart ComfyUI. The requirements.txt is empty on purpose - this thing runs on Python's stdlib (urllib and json). No model downloads, no heavy deps. Saganaki22 is the same author behind the Zonos2 and Higgs v3 TTS node packs, so the code style is clean even if the pack is a small utility.

    Troubleshooting

    • No key or empty prompt → the node raises a clear error. Nothing sneaky.
    • HTTP errors → you get the status code and Ideogram's response body in the error, so a 401 is "check your key" and a 429 is "rate limited". The request has a 60-second timeout, so a stalled network shows up as a URL error rather than a hang.
    • AUTO fails → if Ideogram doesn't return a resolved aspect_ratio, the node raises an error instead of guessing a resolution. Annoying, but honest - you don't want silent bad dimensions.

    This is a niche helper, not a workflow revolution. But if Ideogram 4's JSON prompting has been your wall, it removes the whole "how do I write this schema" problem in one node.

    CategoryIdeogram

    Inputs (4)

    NameTypeDefaultDescription
    api_keySTRINGGet a free key at https://ideogram.ai/manage-api, click Generate API key, then paste it here.
    promptSTRINGText prompt to enhance with Ideogram 4 Magic Prompt.
    aspect_ratioCOMBOAUTOAUTO lets Ideogram choose. Other values are the exact Ideogram 4 aspect ratios.
    seedINT00–2147483647Cache buster only. Change this to rerun the same prompt for a different Magic Prompt output if the result is not to your liking. Not sent to Ideogram and not for reproducible results.

    Outputs (2)

    NameTypeDescription
    magic_prompt_jsonSTRINGThe free Ideogram Magic Prompt API json_prompt response as formatted JSON.
    aspect_ratioCOMBOResolved Ideogram 4 aspect ratio. Plug this into the Ideogram 4 Resolution Selector aspect_ratio input.