Picking an Image Model
features.ai.image.model controls which model powers AI image
generation and editing — Magic Image and the image editor's AI
chat. It is independent of features.ai.model,
which only affects the assistant's text/chat model.
Leave features.ai.image unset and Unlayer picks the best image model for
you. Set it only when you need to pin a specific provider or model.
Pin a model
features.ai.image.model mirrors features.ai.model. It accepts:
- a
"<provider>/<modelId>"pair (e.g."openai/gpt-image-2","google/gemini-3.1-flash-image-preview") — pins both provider and model, unambiguous; - a bare model id (e.g.
"gpt-image-2"); - a provider name (e.g.
"openai","google") — locks the vendor and lets Unlayer pick that provider's default image model.
unlayer.init({
features: {
ai: {
enabled: true,
assistant: true,
image: {
// Provider only — Unlayer picks that provider's image model:
model: 'openai',
// Or pin an exact model:
// model: 'openai/gpt-image-2',
// model: 'google/gemini-3.1-flash-image-preview',
// Quality tier (low | medium | high). Defaults to 'medium'.
// quality: 'high',
},
},
},
});
Supported providers: google (Gemini) and openai (gpt-image-1.5, or gpt-image-2). An unsupported model is rejected.
Quality vs. cost
If you do pin a model, here's how the options generally compare:
| Model | Provider | Relative cost | Best for |
|---|---|---|---|
openai/gpt-image-2 | OpenAI | Higher | Highest-fidelity generations — opt in explicitly. |
openai/gpt-image-1.5 | OpenAI | Lower | Faster generations and transparent PNGs. |
google/gemini-3.1-flash-image-preview | Standard | Strong all-rounder for generation and editing. |
The quality tier (low | medium | high) applies to every provider — higher tiers cost more. It's mapped internally (OpenAI → quality tier, Gemini → 1K/2K/4K resolution).
Related
- Picking a model — the assistant's text/chat model.
- Custom OpenAI Key — bring your own OpenAI billing.
- Custom Gemini Key — bring your own Google billing.
- Pricing — how AI usage is billed.