Picking an Image Model
features.ai.image.model controls the preferred model for AI image
generation and editing — the AI Assistant chat 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.model unset and Unlayer picks the best image model for
you. Set it only when you need to pin a specific provider or model. The latest
editor revision uses GPT Image 2.5 Flare at medium quality for generation and
Nano Banana 2.1 for ordinary edits. Transparent work uses a compatible OpenAI
model from the configured chain. If you have one eligible custom image-provider
key, ordinary work starts on that provider. Unlayer can temporarily restore the
previous defaults, including custom-key selection, during a service incident;
exact model selections stay pinned.
Set features.ai.image.enabled to false to disable image workflows in the AI Assistant chat. This leaves the standalone Image Editor unchanged. An explicit image.enabled takes precedence over the deprecated features.ai.magicImage flag.
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") — pins both provider and model, unambiguous; - a bare model id (e.g.
"gpt-image-2"); - a provider name (e.g.
"openai","google") — starts on that vendor and lets Unlayer pick that provider's default image model.
The selected model is the first choice. If that provider is overloaded,
rate-limited, unavailable, or returns another transient provider error,
Unlayer may retry the request against a fallback image model when you set
fallbackModels to true or an explicit ordered list. With the new defaults,
a provider-only setting also tries a supported model from that provider
if the new model is unavailable or returns a transient error; it does
not add another provider.
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',
// Optional quality tier (low | medium | high).
// quality: 'high',
// Optional transient-outage fallback controls:
// fallbackModels: ['google/gemini-3.1-flash-image', 'openai/gpt-image-2'],
// fallbackModels: true,
// fallbackModels: false,
},
},
},
});
Supported providers: google and openai. An unsupported provider or image
model is rejected.
Gemini model IDs that Google has shut down (gemini-2.5-flash-image and
gemini-3.1-flash-image-preview) are still accepted and run on
gemini-3.1-flash-image, so existing configurations keep working.
gpt-image-1.5 and openai/gpt-image-1.5 remain accepted as compatibility
aliases and now run on GPT Image 2.5 Flare, ahead of the provider's December 1,
2026 shutdown. This mapping also applies with fallbackModels: false and older
editor dates. Usage and credits reflect the replacement model; historical usage
keeps its original pricing. An exact selection without fallbacks requires the
customer's configured OpenAI key to have access to Flare.
Configure fallback image models
features.ai.image.fallbackModels controls the transient-outage fallback
tail for image generation and editing in the builder Assistant and the Assistant API:
- omit it to use Unlayer's default fallback picks when
features.ai.image.modelis unset. With the new defaults, a bare provider also has a same-provider fallback for ordinary output: Flare to GPT Image 2, or Nano Banana 2.1 to Gemini 3.1 Flash; exact model IDs and older revisions remain single-attempt; - set
trueto use Unlayer's default fallback picks even whenfeatures.ai.image.modelpins a provider or model; - set
falseto disable the default outage fallback tail; - pass an ordered model array to replace the default fallback picks.
Retries are used for provider availability failures such as network errors, overloads, rate limits, and 5xx responses. They are not used for invalid image prompts, unsupported model IDs, invalid API keys, authentication errors, credit exhaustion, or other errors that require a change from you or Unlayer. A model-specific access restriction, including required OpenAI organization verification, may advance to an allowed fallback model.
When an Assistant edit must preserve transparency, or the user requests a transparent image, Unlayer first selects an alpha-capable model from this configured chain. Supported OpenAI image models can return native transparent PNGs. No provider outside the chain is added. Pinning an incompatible model without a compatible fallback stops the edit before generation; an opaque output is rejected without charging image credits. Pure grayscale conversions and supported single-color replacements in flat logos use pixel conversion, preserving dimensions and transparency. Color replacement changes all occurrences of the selected color throughout the image, including foreground and background pixels of that color. It keeps other colors and declines ambiguous or complex artwork, including distinct solid shades inside the color-matching tolerance and edges that could belong to another color. Background-only or selected-region changes use generative editing. A painted checkerboard in an opaque source stays opaque; use the original transparent asset or explicitly request background removal. Conversation and image-description usage still apply.
The latest standalone Image Editor keeps transparent uploads and saved images as PNG. For AI edits, visible source transparency uses a compatible OpenAI model from the allowed chain. A source with only nearly opaque alpha values (250–254) does not request a transparent background automatically. If your integration pins Gemini, an edit requiring transparency stops and keeps the original; configure a supported OpenAI model to allow these edits. This safeguard remains active during rollback. Its direct chat does not infer a transparency requirement from prompt text when the source is opaque. The standalone Image Editor currently forwards model and quality, but not fallbackModels. With no model setting, it uses the server's default fallback chain. A provider-only setting follows the same-provider fallback rule above; an exact model ID stays single-attempt.
Quality vs. cost
quality is optional. OpenAI defaults to medium when omitted. Gemini leaves output resolution at the provider's default when omitted; explicit low, medium, and high map to 1K, 2K, and 4K output-resolution requests. Supported resolution and the resulting credit cost depend on the selected model.
Supported model IDs are gpt-image-2.5-flare, gpt-image-2.5-sunburst, gemini-nano-banana-2.1, gpt-image-2, and gemini-3.1-flash-image, plus the gpt-image-1.5 compatibility alias described above. Requests from older editors without an image-model revision and public Images API defaults stay on 2026-05-13: Gemini 3.1 by default and GPT Image 2 for bare openai, with no automatic 1.5 attempts. Automatic transparent output uses Flare, including for a bare openai setting on older revisions. Explicit supported model IDs take precedence over the generation/edit defaults. Image input, output, and text usage are priced separately; see Pricing.
GPT Image 2 transparency is a preview and may be rejected by the provider. Automatic transparency
routing uses Flare instead. An exact Image 2 selection or caller-provided fallback
list remains authoritative; a provider rejection of its transparency option is
terminal, even with fallbackModels: true.
The direct Images API accepts model, quality, and fallbackModels at the request root. Conversational image requests use features.ai.image; their top-level model still selects the conversation model.
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.