docs/src/content/docs/features/External Models/gemini.mdx
import { Steps } from '@astrojs/starlight/components'
Invoke supports Google's Gemini image generation models through the Gemini API. This provider is a good fit if you want high-quality text-to-image and reference-based image edits without running a local model.
Add your key to api_keys.yaml in your Invoke root directory:
external_gemini_api_key: "your-gemini-api-key"
# Optional — only set this if you need to route requests through a different endpoint
external_gemini_base_url: "https://generativelanguage.googleapis.com"
Restart Invoke for the change to take effect.
| Model | Modes | Reference Images | Notes |
|---|---|---|---|
| Gemini 2.5 Flash Image | txt2img | Yes | 10 aspect ratios, fixed per-ratio resolutions. |
| Gemini 3 Pro Image Preview | txt2img | Up to 14 (6 object + 5 character) | 1K / 2K / 4K resolution presets. |
| Gemini 3.1 Flash Image Preview | txt2img | Up to 14 (10 object + 4 character) | 512 / 1K / 2K / 4K resolution presets. |
Reference-image input is used to condition generation but counts as txt2img — neither img2img (denoising strength) nor inpaint (mask) is supported for Gemini.
All Gemini models are single-image-per-request — batch size is fixed at 1. To generate multiple variations, queue multiple invocations.