Image Generation
In the Chatbot
You can choose to set your chatbot to "image" mode and it will generate images for each message you send.
![Notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9263880a-40a5-4f44-81fa-956dfaeeb0f2%2Fbfffdac4-8cef-4561-960b-c1c0521e86d9%2FUntitled.png?table=block&id=03b33637-6f20-4826-b50b-607bcadf6557&cache=v2)
You can also utilize AI Engine filters to generate images through a chatbot in "chat" mode. This way you have the best of both worlds!
add_filter( 'mwai_ai_query', function ( $query ) {
$last = $query->get_message();
if ( strpos( $last, "/imagine" ) !== false ) {
$last = trim( str_replace( "/imagine", "", $last ) );
$query = new Meow_MWAI_Query_Image( $last );
return $query;
}
return $query;
}, 999, 1 );
If you have technical knowledge, you can also use function calling to let the chatbot generate the image by itself, instead of using filters.
![Notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9263880a-40a5-4f44-81fa-956dfaeeb0f2%2Fcae79a62-5594-42e8-b7ed-d8b04d41bf5b%2FUntitled.png?table=block&id=10ff033b-bbab-4b6d-9922-0785625ced13&cache=v2)
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. Then you just need to select a model that generates images instead of a regular text-based model:
![Notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9263880a-40a5-4f44-81fa-956dfaeeb0f2%2Fc8f77322-deda-4696-bb2a-900519b43209%2FUntitled.png?table=block&id=abf60eea-91c2-4d6c-81b7-41ae78d198be&cache=v2)
In the Dashboard
First, in the AI Engine dashboard, make sure to enable the Images Generator feature.
![Notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9263880a-40a5-4f44-81fa-956dfaeeb0f2%2F3eb2af0a-ddf5-4f13-a2c4-700b72054ee9%2FUntitled.png?table=block&id=bfd0c79a-ed3a-459d-918a-42b81c15647f&cache=v2)
This will add a new button that will bring you to the image generation dashboard in the top right corner of the AI Engine dashboard.
![Notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9263880a-40a5-4f44-81fa-956dfaeeb0f2%2F66d8d51b-8fed-4caa-84c5-5eb51e2e7880%2FUntitled.png?table=block&id=f0fc0a70-1f1e-4d4f-8307-3846452ecb4b&cache=v2)
Once on the Images Generator, different settings will be available:
![Notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F9263880a-40a5-4f44-81fa-956dfaeeb0f2%2F32cc4065-cefb-4a1b-b2d9-0c9beb321257%2FUntitled.png?table=block&id=5becadaf-ee20-428c-ab54-932db6a42d8e&cache=v2)
1. Number of images: You have the option to generate images in batches. You can also use the Continuous option to add the previously generated images to the current ones.
2. Prompt input: Describe the image you wish to generate.
3. Templates: When you have entered some prompts you don't want to lose, you can save them and reuse them later as templates. Switch to edit mode to update/add new ones. You already have some ready for you.
4. Images: Once generated, the images will be displayed at the bottom of the page, under the prompt area.