Generate Image

An AI assistant can store an image you hand it — but until now it could not make one.

media/generate-image turns a text prompt into a real image with WordPress 7.0’s built-in AI client, using whichever connector the site has configured for image generation, and adds it straight to the Media Library in a single call.

At a glance

Abilitymedia/generate-image
ToolsetContent — toolset/content
GroupContent › Media
RequiresWordPress 7.0+ and an AI connector that supports image generation
Capabilitymanage_options
SafetyWrites data — adds an attachment. Requires confirm: true
RepeatableNot idempotent — each call generates a new image
Ships inAcrossAI Abilities Manager 0.0.43 and later

How it works

Pass a prompt and confirm: true. The ability generates the image through the AI client that ships inside WordPress — no extra plugin — and sideloads the result exactly like an uploaded file, so all the standard image sizes are created too. Pass a post_id to attach it to a post, and set_as_featured to make it that post’s featured image.

It works with whichever provider you have an API key for — Google, OpenAI, Cloudflare Workers AI and others — set up under Settings → Connectors. Each run makes a paid AI request, which is why it asks for a confirmation. When no image-capable connector is configured, it returns a clear, actionable message instead of failing — and nothing is charged.

Input

NameTypeRequiredWhat it is
promptstringYesWhat to generate, described in plain language.
confirmbooleanYesMust be true. Generation makes a paid AI request.
aspect_ratiostringNo1:1, 16:9, 4:3, 3:2, 9:16 or 2:3. Model support varies.
post_idintegerNoAttach the image to this post.
set_as_featuredbooleanNoWith post_id, also set it as the featured image.
title / alt_text / caption / descriptionstringNoAttachment metadata.
filenamestringNoBase filename, without extension.
provider / modelstringNoAdvanced: force a specific provider and model.

What comes back

NameTypeWhat it is
idintegerThe new attachment’s id.
urlstringThe image’s URL.
mediaobjectThe attachment record.
provider / modelstringWhich provider and model generated it.
set_as_featuredbooleanWhether it was set as the post’s featured image.
successbooleanWhether the call completed.
error_codestringPresent only on failure, such as no image-capable connector configured.

Example

Ask your assistant:

Generate a featured image of a calm mountain lake at sunrise for this post.

It resolves to one call:

{
  "ability": "media/generate-image",
  "parameters": {
    "prompt": "a calm mountain lake at sunrise, soft mist, photorealistic",
    "confirm": true,
    "post_id": 128,
    "set_as_featured": true,
    "alt_text": "mountain lake at sunrise"
  }
}

Worth knowing

  • Core only — it uses the AI client that ships inside WordPress 7.0, with no dependency on any other plugin.
  • Works with whichever provider you have an API key for; the connector just has to offer image models (text-only ones cannot generate images).
  • Gated behind confirm: true because each run is a paid request; it also respects the Upload Media Abilities file-type allowlist.
  • The image is processed like any upload, so thumbnails and every registered size are generated.

Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading