Image generation
Headmaster can generate and edit images inside the chat. The agent writes a prompt, calls the image generation tool, and the result appears as an image in the chat and in the preview panel.Enabling image generation
Add an image-capable provider
Open Settings → Headmaster’s Library → Connections and make sure you have a provider that supports image generation.
Turn on image generation
Go to Settings → Headmaster’s Library → Advanced → Tools and enable Image generation.
Recommended setup: Gemini
Gemini is the fastest, cheapest, and easiest image generation path.Get a Gemini API key
Visit Google AI Studio, sign in with your Google account, and create a new API key.
Add Gemini to Headmaster
Go to Settings → Connections → Add provider → Gemini and paste the API key.
Supported providers
| Platform | API shape | Recognized model patterns | Notes |
|---|---|---|---|
| Gemini | Chat completion | *-image-*, gemini-*image* | Free tier available. Default model: gemini-2.5-flash-image-preview. |
| Gemini (Vertex AI) | Chat completion | Same as Gemini | Enterprise variant. |
| OpenRouter | Chat completion | image, dall-e, flux, stable, etc. | 300+ models, mixed pricing. Default: google/gemini-2.5-flash-image-preview. |
| AntigravityTools | Chat completion | Image-capable models | Default: gemini-3-pro-image-1x1. |
| OpenAI | Images API | gpt-image-*, dall-e-* | Requires images-API access. |
| Stability AI | Images API | stable-*, sd<n>, ultra, core | Requires Stability key. |
| Alibaba DashScope | Images API | wanx-*, image-* | Requires DashScope key. |
| Together AI | Images API | flux-* | Requires Together key. |
The model allowlist prevents text-only models from appearing in the image picker. If your model doesn’t appear, its name doesn’t match a recognized pattern — rename the entry to include
image, flux, dall-e, or another recognized keyword.Generating an image
In chat:Image editing
Verifying your setup
Check the tool list
Ask in a conversation: “what tools do you have?” —
image-generation should appear.Tips for better images
- 🎯 Be specific — describe the style, color palette, composition, and mood.
- 🎨 Reference art movements — “Bauhaus,” “Art Deco,” “minimalist,” “brutalist.”
- 📐 Specify the format — “landscape 16:9,” “square,” “portrait.”
- 🔄 Iterate — if the first result isn’t right, ask for adjustments: “make it warmer, add more contrast, simplify the background.”
FAQ
What's the best free model?
What's the best free model?
gemini-2.5-flash-image-preview — fast, free with a Gemini API key, decent quality.My model doesn't show in the picker
My model doesn't show in the picker
The model name doesn’t match the allowlist pattern (
image, flux, dall-e, stable, sd<n>, wanx) or the platform isn’t recognized. Rename the model entry to include a recognized keyword, or switch to a supported platform.The tool list is missing image-generation
The tool list is missing image-generation
Ensure: (1) image generation is toggled on in Settings, (2) a model is selected and saved, (3) you started a fresh conversation after saving.
API key invalid
API key invalid
Check the key was copied without whitespace, the platform account is active, and billing/quota is set up where required.
Generation failed mid-request
Generation failed mid-request
Usually a network timeout, expired token, or quota exhaustion — check the platform dashboard.
Models & providers
Add the provider that powers image generation.
Preview panel
Generated images open automatically in the preview panel.