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
1
Add an image-capable provider
Open Settings → Headmaster’s Library → Connections and make sure you have a provider that supports image generation.
2
Turn on image generation
Go to Settings → Headmaster’s Library → Advanced → Tools and enable Image generation.
3
Pick an image model
Select a model from the dropdown. Only allowlisted image-capable models appear here.
Recommended setup: Gemini
Gemini is the fastest, cheapest, and easiest image generation path.1
Get a Gemini API key
Visit Google AI Studio, sign in with your Google account, and create a new API key.
2
Add Gemini to Headmaster
Go to Settings → Connections → Add provider → Gemini and paste the API key.
3
Enable image generation
Go to Settings → Advanced → Tools → Image generation and toggle it on.
4
Pick the image model
Select
gemini-2.5-flash-image-preview from the dropdown (auto-injected if no other image model is configured).Supported providers
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
1
Check the tool list
Ask in a conversation: “what tools do you have?” —
image-generation should appear.2
Test with a prompt
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.