Chatbot
You can choose to set your chatbot to “image” mode and it will generate images for each message you send.

If you want your chatbot to work with text responses and generate images only when asked, the recommended method is to use the Chat Mode with the Image Generation tool (in Tools & Capabilities), compatible with most recent models.
If your model is compatible, you can simply select it and it will be used automatically, just like function calling. This approach runs entirely on OpenAI’s side ( or Google / Anthropic ), so there are no settings in AI Engine to tweak the results. However, it’s a simple solution that needs no code. (Developers can still adjust the request sent to OpenAI, like the image quality, with the mwai_openai_body filter.)

If you are using a model that cannot run the out-of-the-box Image Generation tool, you can also use function calling to let the chatbot generate the image by itself by creating your own logic.


Yes, it is really just two lines of code, and now any chatbot can generate images:
function generate_image( $prompt ) {
global $mwai;
return $mwai->simpleImageQuery( $prompt );
}
AI Forms
If you need to tailor your users’ prompts with predefined choices, using AI Forms might be the best solution. You can learn everything about them in this documentation: Your First Form.
To generate Images with forms you just need to select a model that generates images instead of a regular text-based model:

You can try it yourself below: the prompt is already predefined; it should generate something that looks familiar…
Image Studio
First, in the Modules tab, under Content Creation → Generators, make sure the Images Generator is enabled.

This adds an Images button to the header of AI Engine. It opens the Image Studio.

The Image Studio has three parts:
- Your images on the left: every image you create or bring in, with all its versions, so you can come back to it later.
- The canvas in the middle: describe the image you want at the bottom and pick how many to generate at once (1 to 4). You can also start from a photo: Upload a photo or pick one From the Media Library. Short on ideas? Click one of the suggestions.
- Model and Presets on the right: choose the environment, the model, the size and the quality. A preset saves the prompt, the model, the size and the quality together, so you can reuse them later.

Each image you generate can be downloaded or saved to your Media Library, with its filename and alt text.
Image Edits
With a model that can edit images (like GPT Image), you can refine any image step by step in the Image Studio. To edit an image from your Media Library, switch the Media Library to the list view and use the Edit link with the magic wand icon, or use From the Media Library in the Image Studio.

The image opens in the Image Studio. Every edit becomes a new version, listed on the right, and the original is never touched. From the toolbar above the image:
- Edit this image (at the bottom): describe a change, like warmer light or no car, and get a new version.
- Brush: paint over the area you want to change, then describe what goes there. Only the painted area changes.
- Compare: see a version next to the one it came from (before and after).
- Variations: get a fresh take on the image, with the same subject, framing and style.


If the selected model can create images but not edit them, the Image Studio tells you so.
Image Edits In Chatbot
You can also enable image editing behavior within a discussion thread by taking advantage of the Image Generation tool. Enable File Upload in the AI Model section so your visitors can send an image. If you’re using a vision-enabled model, you can create a workflow where the model first visualizes the image, generates a description of it, and then uses your prompt along with that description to generate a new image that appears as an edit of the original.

