Built-In Agents

Generating Images with AI Hub

Generate Image is an AI Hub agent that creates images from a description you write in Liferay CMS. It runs inside the AI Assistant, and you can start it from the Files section or from a File field in the content editor.

Generate Image becomes available once AI Hub is integrated with your Liferay DXP instance, which includes enabling the AI Hub feature flag. If you don’t see an option described here, confirm that step is complete.

Generating Images from the Files Section

Start from the Files section when you want images saved to a folder rather than added to a specific entry.

  1. Open the Global Menu (Global Menu) → CMS → Files.

  2. Open the folder where you want the images saved.

  3. Click New → Generate Single Image With AI for one image, or New → Generate Multiple Images With AI to get several images you can choose from.

    The AI Assistant opens with the folder you opened as the destination.

    The New menu in the Files section includes both Generate Single Image With AI and Generate Multiple Images With AI.

  4. Describe the image you want. To get more than one image, name how many in your description.

  5. Choose a style.

    The AI Assistant asks, “Which style?” Click Digital Art, Illustration, Photorealistic, or Watercolor. Clicking a style submits it immediately, and the style buttons then become unavailable. A custom agent can offer a different set of styles.

    The results appear as image cards in the chat.

    The AI Assistant asks, Which style? and offers the styles below the question.

  6. Click Save Image, or Save Images when several images are selected.

    The images are saved to the folder you opened, and they appear in its listing.

Selecting Which Images to Save

When you generate several images at once, each card in the chat has a checkbox and every card is selected by default. Clear the images you don’t want to save. A single result has no checkbox.

The save button reads Save Image for a single image and Save Images when several are selected. It’s unavailable when nothing is selected.

Three generated image cards appear in the chat with checkboxes, two selected and one cleared, above the Save Images button.

Generating an Image for a File Field

You can also generate an image while filling a File field in the content editor. Use this path when the image belongs to the entry you’re editing: the agent writes the image into the field.

  1. Open the entry you want to edit.

  2. Click AI Assistant (AI Assistant) next to the field’s Select File button.

    The AI Assistant button appears beside the File field's Select File button as an icon with no text label.

    The AI Assistant opens with that field as the destination.

  3. Describe the image you want, then choose a style: Digital Art, Illustration, Photorealistic, or Watercolor.

  4. Clear any images you don’t want, then click Save Image or Save Images.

    The first card still selected fills the File field, whatever order you clicked them in. To use a different image, clear the cards before it. When you select more than one, a notification reports that the remaining images were saved, and those images follow the rules in Where Generated Images Are Saved.

Closing the AI Assistant without saving leaves the field empty.

Where Generated Images Are Saved

Images saved from the chat are named AI-image-[uuid].png and tagged with the keyword AI-generated. Search the CMS for that keyword to find them later. An image that fills a File field is uploaded with the entry instead, so it doesn’t carry that keyword.

When you start from the Files section, images are saved to the folder you opened. When no destination is set, clicking Save Image opens a dialog asking which space to save to. Choose a space in the Space drop-down and click Save to save the image to that space’s root Files folder.

The dialog doesn’t open when

  • You have access to exactly one space, in which case the image is saved there.
  • You have access to no space, in which case a message reports that no spaces are available and nothing is saved. Ask an administrator to add you to a space.