Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion docs/features/image-generation-and-editing/gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Open WebUI also supports image generation through the **Google AI Studio API** a
1. Obtain an [API key](https://aistudio.google.com/api-keys) from Google AI Studio.
2. You may need to create a project and enable the `Generative Language API` in addition to adding billing information.

:::warning
If you are utilizing a free API key, it is vital to have a payment method on file. The absence of a valid payment method is a frequent cause of errors during the setup process.
:::

:::tip
Alternatively, if you are using Vertex AI, you can create an API key in Google Cloud instead of a service account. This key will function correctly, provided it is assigned the appropriate permissions.
:::

### Configuring Open WebUI

1. In Open WebUI, navigate to the **Admin Panel** > **Settings** > **Images** menu.
Expand All @@ -23,6 +31,28 @@ Open WebUI also supports image generation through the **Google AI Studio API** a
5. Enter the model you wish to use from these [available models](https://ai.google.dev/gemini-api/docs/imagen#model-versions).
6. Set the image size to one of the available [image sizes](https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios).

### Example Minimal Setup

One minimalistic working setup for Gemini can look like this:

#### Create Image

- **Create Image Model**: `gemini-2.5-flash-image`
- **Image Size**: `2816x1536`
- **Image Prompt Generation**: on
- **Image Generation Engine**: `Gemini`
- **Gemini Base URL**: `https://generativelanguage.googleapis.com/v1beta`
- **Gemini API Key**: Enter your API Key
- **Gemini Endpoint Method**: `generateContent`

#### Edit Image

- **Image Edit Engine**: `Gemini`
- **Model**: `gemini-2.5-flash-image`
- **Image Size**: (can be left empty)
- **Gemini Base URL**: `https://generativelanguage.googleapis.com/v1beta`
- **Gemini API Key**: Enter your API Key

![Screenshot of the Open WebUI Images settings page with Gemini selected and the API key, model, and image size fields highlighted.](/images/image-generation-and-editing/gemini-settings.png)

:::info
Expand Down Expand Up @@ -65,4 +95,4 @@ Image generation with a LiteLLM proxy using Gemini or Imagen endpoints is suppor
To find your LiteLLM connection information, navigate to the **Admin Panel** > **Settings** > **Connections** menu.
Your connection information will be listed under the Gemini API connection.

:::
:::
Loading