• Resolved Nadav Levi

    (@123nadav)


    Hey Jordi how are you my freind?

    So i have some problem, so when generating images with the MCP and Claude code, i cant choose the model.

    I have 2 API Keys connected, OpenAI and Gemini Studio.

    Now each one of them have diffrent size options.

    sometimes i need to switch between them, but for that, i need every time the get inside AI Engine setting and set default model… its not only that, sometimes i dont want to pay too much, so i choose model is lower, but with the MCP is not possible… this what the Claude code write me to write you:

    Subject: MCP mwai_image — per-call provider/model, quality, filename, Gemini size

    Hi, we generate site images through the AI Engine MCP (3.8.2). Thank you for the new resolution input in 3.8.1, it works well. Could mwai_image also accept these optional inputs per call?

    1. envId and model, so a call can use Gemini or GPT Image without changing the site's default image settings.
    2. quality, for GPT Image.
    3. filename, for the Media Library file (today it is always ai_<id>, which is not SEO-friendly).
    4. An image size tier (imageSize: 1K / 2K / 4K) for Gemini models that support it. Today only aspectRatio is sent.
    Thanks!

    Now, filename is already cover with a costume snippet i created, and i can choose the file name before the image generated. but choose the model is impossible… can you pull an update? or give me a workaround for this problem?

    By the way, i read all the 4 Claude code asked here, and he is right… all the 4 are correct, as i said the filename is covered, but this <id> is not SEO friendly at all.

    If you able to handle this problem as well, and i will delete the snippet, it can be helpful too.

    The idea of the file name is important, if you choose the name before the image generated, the permalink of WordPress take the original name. if you change it in the middle of the process, after the image generated, the old permalink not changed… which is not SEO friendly at all… as i said right now i have a costume snippet cover this problem but still… i prefer AI Engine plugin will cover it and i be able to delete this snippet.

    What you say Jordi? is possible?

    • This topic was modified 2 days, 16 hours ago by Nadav Levi.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi Nadav,

    Thanks for writing this up so clearly, and for passing on what Claude Code asked for! 😜 You’re right on all four points, and the good news is that most of them are small changes, because AI Engine already supports them internally. The mwai_image tool simply doesn’t expose them yet.

    Here is the plan. Right after our next release (it goes out on October 1, or a few hours before that actually), mwai_image will accept an optional provider/environment and model per call, so Claude can pick Gemini or GPT Image without touching your site defaults, which stay as the fallback. It will also accept a quality for GPT Image, and a filename. That last one is applied when the image is first saved, so the file and its permalink carry the right name from the start (instead of ai_<id>). If no filename is given, we’ll build one from the title.

    The Gemini 1K/2K/4K size is a bit more work on the Gemini side, so it will come just after those three.

    Until then, the only way to switch provider is still the default image environment in the settings, sorry about that. I’ll post here as soon as the update is out ✨

    Cheers,
    Jordy.

    Thread Starter Nadav Levi

    (@123nadav)

    Thank you, Jordy, that is exactly what we need! One small related request: we convert AI-generated images to AVIF on wp_generate_attachment_metadata, and today we recognize AI Engine’s images by the ai_ filename, which the new filename option will (rightly) remove. Could AI Engine set a flag, a filter, or a meta value that is available during that step, or offer the output format (for example AVIF) as an option? Either would let us identify AI Engine’s generations reliably. Thanks again!

    By the way, I am convert it before the image reaches the Media Library so it doesn’t create a permalink or a duplicate image with a different file extension.

    I usually use PHP’s default GD extension, which typically comes with PHP 8.5 and PHP 8.4, and I do it with a snippet I created using the Code Snippets plugin.

    This is very important: some servers, such as LiteSpeed, don’t have GD installed with AVIF support and only have Imagick. So, if you plan to fix that as well, you should make the solution flexible enough to choose between Imagick and GD.

    I just wanted to give you all the information.

    Thank you, bro!

    • This reply was modified 2 days, 7 hours ago by Nadav Levi.
    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @123nadav,

    Everything you asked for is done, and it will be in the next update! 🤘

    The mwai_image tool now takes, all optional: envId (the ID or simply the name of the environment, like “Google”), model (for example gpt-image-1-mini or gemini-3.1-flash-image), quality (low, medium, high or auto for GPT Image), size (1K, 2K or 4K for Gemini, plus 512px on Gemini 3.1 Flash Image) and filename (the extension is added for you). Without a filename, the file is now named after the title instead of ai_<id>, so your snippet should not be needed anymore.

    For your AVIF conversion: every image AI Engine saves now carries an mwai_generated meta set to 1, and it is already there when wp_generate_attachment_metadata runs. So your snippet can simply check get_post_meta( $attachment_id, ‘mwai_generated’, true ) instead of looking at the file name. The model used is saved too, in mwai_model.

    Thanks a lot for the clear and precise requests, they made this easy 😊

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.