---
title: "AI image generation editor command"
description: "Integrate the aiImagePrompt into your editor to generate images with AI with a custom prompt and style. More in the docs!"
canonical_url: "https://tiptap.dev/docs/content-ai/capabilities/generation/image-generation"
---

# AI image generation editor command

Integrate the aiImagePrompt into your editor to generate images with AI with a custom prompt and style. More in the docs!

- **1. Activate trial or subscribe**

  Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Start
  plan](https://cloud.tiptap.dev/v2/billing) in your account.
- **2. Integrate an AI provider**

  Configure OpenAI in your [AI settings](https://cloud.tiptap.dev/v2/cloud/ai) or review the
  [Custom LLM guides](https://tiptap.dev/docs/content-ai/capabilities/generation/custom-llms.md).
- **3. Install from private registry**

  To install the frontend extensions, authenticate to Tiptap’s private npm registry by following
  the [setup guide](https://tiptap.dev/docs/guides/pro-extensions.md).

The `aiImagePrompt` command in Tiptap Content AI enables you to generate images directly within the editor. You can use different OpenAI models and customize the style of the generated images.

## Integrate aiImagePrompt

Generates an image based on your prompt and the desired style.

Make sure to load the image extension (`'@tiptap/extension-image'`) in your editor instance.

```js
editor.chain().focus().aiImagePrompt(options: ImageOptions).run()
```

## Image command options

With these settings you can control how the image is generated:

| Setting   | Type                                                                                            | Default          | Definition               |
| --------- | ----------------------------------------------------------------------------------------------- | ---------------- | ------------------------ |
| modelName | `dall-e-2`, `dall-e-3`, `null`                                                                  | `dall-e-3`       | The model used at OpenAI |
| style     | `photorealistic`, `digital_art`, `comic_book`, `neon_punk`, `isometric`, `line_art`, `3d_model` | `photorealistic` | Define the image style   |
| size      | `256x256`, `512x512`, `1024x1024`                                                               | `null`           |                          |
