> For the complete documentation index, see [llms.txt](https://docs.3techagency.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.3techagency.com/documentation/workflows/generate-images.md).

# Generate images

Create product photos, hero and featured images with your connected AI provider, with Undo.

Ask Chat for images and WP AI Manager creates them with your connected provider, saves them to the Media Library with alt text, and can attach them to a post or product. Each image and the attach step are recorded in History and can be undone.

## Before you start

* Connect a provider that can make images (for example OpenAI or Google) under **WordPress Settings > Connectors**.
* Open **WP AI Manager > Settings > AI Models** and look at **Image models**. It lists your image models in the order they are tried. If it says none of your providers can make images, connect one that can.

## Ask for images

Examples:

* "Generate 3 product images for iPhone 13 on a plain white background and add them to the product."
* "Make a 16:9 hero image of a sunlit home office for the About page and set it as the featured image."

| Option             | Detail                                                                                                                                   |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Number of images   | 1 to 4 per request                                                                                                                       |
| Aspect ratio       | 1:1, 4:3 or 16:9                                                                                                                         |
| Alt text and title | Written for each image; you can specify them                                                                                             |
| Attach to a post   | The first image becomes the featured image. On a WooCommerce product it becomes the product image and the rest join the product gallery. |

## How it works

1. **Photo models first.** The generator tries photo models before others: OpenAI gpt-image or DALL-E, Google Imagen or Gemini image, Flux, Stable Diffusion.
2. **Drawings are skipped.** If a model returns a drawing (SVG) instead of a photo, that image is retried once on the next model. If no photo model is connected, it stops and names the model, for example "The image model acme/sketcher returned a drawing (SVG) instead of a photo".
3. **One request per image.** Each image gets up to 150 seconds. After about 75 seconds of work in one call, finished images are saved and the result says how many are left; the assistant continues with the rest and adds them to the gallery without replacing the product image it already set.
4. **Files are named from their bytes.** A PNG, JPEG, GIF or WebP is saved by its real type, whatever the provider declared. A vector or unknown file is refused with a plain reason.

{% hint style="warning" %}
The assistant never draws SVG, HTML or placeholder files as a stand-in for a generated image. If the image tool reports an error, it tells you what the error says. Ask again and it calls the tool again; an earlier failure in the same chat is not treated as proof of a new one.
{% endhint %}

## Check and undo

* The result card links to each saved image and the post it was attached to.
* **History** has one entry per image and one for the attach step. Undo removes the image or restores the previous featured image and gallery.

## When it fails

| Symptom                                                | What to do                                                                                                                                                                                                     |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| "None of your connected providers can make images"     | Connect an image-capable provider under Settings > Connectors.                                                                                                                                                 |
| "did not answer within 150 seconds"                    | The provider was slow. Ask for fewer images or try again later.                                                                                                                                                |
| "returned a drawing (SVG) instead of a photo"          | The named model is not a photo model. Connect a photo model or change provider.                                                                                                                                |
| "This SVG file could not be sanitized" on a real photo | Fixed in 1.3.0. Some plugins (Kirki) treat any file containing the text `<svg` as an SVG; WP AI Manager now steps around SVG-only upload checks for files WordPress confirms are PNG, JPEG, GIF, WebP or AVIF. |
| Anything else                                          | Open **Settings > AI Models > Last image problem**. It shows the time, model, error code and message, and **Technical detail** shows what the uploader received and which plugins hooked into uploads.         |

Stock photos (Unsplash, Pexels, Pixabay) are a separate, optional integration used by the blog post Task. See [Integrations and builders](/documentation/reference-and-help/integrations-and-builders.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.3techagency.com/documentation/workflows/generate-images.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
