---
url: 'https://dxpr.com/hc/documentation/learn-dxpr-builder/ai/image-generation'
title: 'Generate an image with AI | DXPR'
author:
  name: docs-sync
  url: 'https://dxpr.com/users/docs-sync'
date: '2026-10-23T14:31:17+00:00'
copyright: 'Copyright DXPR. All rights reserved.'
type: article
summary: 'Create a photo or illustration from a description, in an Image element or as a background'
tags:
  - 'Write and design with AI'
image: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
published: true
og:
  site_name: DXPR
  updated_time: '2026-10-23T14:31:17+0000'
  'image:alt': 'DXPR, powered by Drupal: AI-powered Drupal for marketers.'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      mainEntity: {  }
    -
      '@type': TechArticle
      headline: 'Generate an image with AI'
      description: 'Create a photo or illustration from a description, in an Image element or as a background'
      image:
        '@type': ImageObject
        url: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
        width: '1200'
        height: '630'
      datePublished: '2026-10-23T14:31:17+0000'
      dateModified: '2026-10-23T14:31:17+0000'
      author:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      mainEntityOfPage: 'https://dxpr.com/hc/documentation/learn-dxpr-builder/ai/image-generation'
      articleSection: 'Write and design with AI'
    -
      '@type': WebPage
      '@id': 'https://dxpr.com/hc/documentation/learn-dxpr-builder/ai/image-generation'
      description: 'Create a photo or illustration from a description, in an Image element or as a background'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://dxpr.com/'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
      inLanguage: en
---
[Help Center](/hc)/[Documentation](/hc/documentation) /[Learn DXPR Builder](/hc/documentation/learn-dxpr-builder) /[Build pages](/hc/documentation/learn-dxpr-builder/build) /[Write and design with AI](/hc/documentation/learn-dxpr-builder/ai) # Generate an image with AI.

Create a photo or illustration from a description, in an Image element or as a background

 Learn DXPR BuilderBuild pagesWrite and design with AI

   ## In this guide

 Related guides

- [Image editing](/hc/documentation/learn-dxpr-builder/ai/image-editing)
- [Image alt text](/hc/documentation/learn-dxpr-builder/ai/image-alt-text)
- [Page creation](/hc/documentation/learn-dxpr-builder/ai/page-creation)

Need a photo for an event announcement and have none? Describe it and the AI creates it in the Image element on your page. The image is stored on your site like an upload. Use this when you have no suitable photo; to change a photo you already have, see [Change a photo with AI](/hc/documentation/learn-dxpr-builder/ai/image-editing). The video fills an empty Image element next to an Open Day announcement.

  ## Before you start

- AI is switched on, with **Enable image generation** and **Enable page creation assistant** ticked. See [Turn on AI in DXPR Builder](/hc/documentation/learn-dxpr-builder/ai/setup).
- The page has an Image element. A new Image element without a photo is fine.

## Set up

1. Point at the Image element and click **More** on its control bar.
2. Choose **Edit with AI**.
3. Describe the image in the box, for example "Students chatting on a sunny university lawn in autumn, natural light, photo".
4. Under **Image size:**, choose **Landscape**.
5. Click **Generate Image**.
6. Click **Save** on the builder toolbar.

Say what the image shows, its style (photo, illustration, watercolour), the light and the framing. **Enhance prompt** below the box turns a short description into a detailed one.

## Background images

Sections, rows, columns and most elements can get a generated background too:

1. Open the element's settings with **More** &gt; **Settings** and open **Style**.
2. Under **Background image**, click **AI Image Generation**.
3. Describe the background, choose an **Image size:** and click **Generate Image**.
4. Click **Save** in the dialog.

## What you see

The element shows "Generating image..." while the AI works, which can take a minute. Then the new image appears. It is saved on your site as a WebP image and added to your media library, named after your description. The description also becomes the image's **Alt attribute**; shorten it to a plain description in the element's **SEO** settings, see [Let AI write your alt text](/hc/documentation/learn-dxpr-builder/ai/image-alt-text).

Open **Edit with AI** on the same image again and the box holds your last description. **Edit existing image** is now selected, so the AI changes this photo when you click **Edit Image**. To create a new one instead, choose **Generate new image**, change a word and click **Generate Image**.

## Settings

| Image size | Pixels |
|---|---|
| **Auto** | The model chooses |
| **Square** | 1024 × 1024 |
| **Landscape** | 1536 × 1024 |
| **Portrait** | 1024 × 1536 |

## If you don't see the new image

- **The More menu of the Image element has no Edit with AI.** **Enable image generation** or **Enable page creation assistant** is off. Tick both at `/admin/dxpr_studio/dxpr_builder/ai_settings`.
- **Edit with AI is greyed out.** No AI provider is configured. Follow [Turn on AI in DXPR Builder](/hc/documentation/learn-dxpr-builder/ai/setup).
- **The element shows "Image generation failed. Please try again."** DXPR could not create the image, for example because the account is out of credits or the description breaks the content rules. Click **Retry**, or **Cancel** and change the description.
- **The image is gone after reloading the page.** The page was not saved. Generate again and click **Save** on the builder toolbar.

## What's next?

- [Change a photo with AI](/hc/documentation/learn-dxpr-builder/ai/image-editing): adjust the light, the background or the style of a photo.
- [Let AI write your alt text](/hc/documentation/learn-dxpr-builder/ai/image-alt-text): describe the image for screen readers.
- [Draft a page with AI](/hc/documentation/learn-dxpr-builder/ai/page-creation): let the AI write the page around it.