GEMINI LABJP
DEPRECATION — The two image preview models shut down today, June 25; automations using them must migrate immediatelyGA — In their place, gemini-3.1-flash-image and gemini-3-pro-image are now the generally available native image modelsMEDIA — Video-to-image generation arrives: pass a video as context to create high-quality thumbnails (3.1 flash image only)AUDIO — Gemini 3.1 Flash TTS preview lands: a low-cost, expressive, steerable text-to-speech modelMODEL — Gemini 3.5 Flash is GA, beating 3.1 Pro on nearly every benchmark while running about 4x fasterSEARCH — File Search now supports multimodal search, embedding and searching images natively via gemini-embedding-2DEPRECATION — The two image preview models shut down today, June 25; automations using them must migrate immediatelyGA — In their place, gemini-3.1-flash-image and gemini-3-pro-image are now the generally available native image modelsMEDIA — Video-to-image generation arrives: pass a video as context to create high-quality thumbnails (3.1 flash image only)AUDIO — Gemini 3.1 Flash TTS preview lands: a low-cost, expressive, steerable text-to-speech modelMODEL — Gemini 3.5 Flash is GA, beating 3.1 Pro on nearly every benchmark while running about 4x fasterSEARCH — File Search now supports multimodal search, embedding and searching images natively via gemini-embedding-2
Articles/API / SDK
API / SDK/2026-06-25Advanced

The Morning a Preview Image Model Went Dark — Migrating to GA Gemini Image Models and Building a Deprecation-Resilient Pipeline

With gemini-3.1-flash-image-preview and gemini-3-pro-image-preview retired, here is how to migrate to the GA models and design an image pipeline that no longer gets caught off guard by deprecation dates — with code and cost math, plus video-to-image thumbnail automation.

gemini-api248image-generation7deprecation5pipeline7python93automation41thumbnailproduction119

Premium Article

An unattended image job starts returning 404 NOT_FOUND one morning, and the cause turns out to be not your code but an external model-retirement schedule. If you have lived through that, you know the particular frustration of it.

On June 25, 2026, two preview image models — gemini-3.1-flash-image-preview and gemini-3-pro-image-preview — were retired. In their place, the native image models graduated to general availability as gemini-3.1-flash-image (Flash Image) and gemini-3-pro-image (Pro Image).

I run several jobs that auto-generate artwork and thumbnails for wallpaper and wellness apps. Back when I hardcoded preview model IDs straight into the code, every retirement meant hunting down the affected lines and rewriting them — always reactive, always after the breakage. Learning from that, I want to share both the migration steps and, more importantly, a pipeline design that stops you from being whipped around by deprecation dates.

What actually changes between preview and GA

The first thing to internalize is that this is not a mere rename. Dropping the -preview suffix carries operational meaning.

AspectPreviewGA
Model IDgemini-3.1-flash-image-previewgemini-3.1-flash-image
Stability guaranteeNone (can be pulled with little notice)Yes (migration window on retirement)
PricingProvisional, may shiftFinalized
Production useDiscouraged (for evaluation)Recommended
Video-to-imagePartialSupported on Flash Image

Preview models always carried the assumption that they could disappear at any time. They are handy for evaluation and prototyping, but hardcoding one into an unattended production job was, in hindsight, a poorly considered design. GA models come with a migration window, so the same accident is far less likely.

That said, swapping in the GA model is not the end of the story. The day another model is retired will surely come. What matters is using this migration as the moment to bake in a structure that anticipates the next retirement.

The minimal migration: get the broken job running

Here is the minimal path when you need something working right now. For most code, swapping the model ID is enough.

from google import genai
 
client = genai.Client(api_key="YOUR_API_KEY")
 
# Before (retired):
# model = "gemini-3.1-flash-image-preview"
 
# After (GA):
model = "gemini-3.1-flash-image"
 
response = client.models.generate_content(
    model=model,
    contents="A calm minimalist wallpaper, soft gradient, muted teal",
)
 
# Generated images come back as parts
for part in response.candidates[0].content.parts:
    if part.inline_data is not None:
        with open("wallpaper.png", "wb") as f:
            f.write(part.inline_data.data)

One caution at this stage: even when the response shape is identical between preview and GA, the tone of the generated output can shift subtly. Reusing prompts verbatim may produce slightly different color or composition. Before sending anything to production, I recommend eyeballing the output for a handful of representative prompts.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Get the configuration-layer code that centralizes model IDs so you can switch from preview to GA (gemini-3.1-flash-image / gemini-3-pro-image) safely and in one place
Implement a model-lifecycle check with advance alerts that stops unattended jobs from silently breaking when a model is retired
Learn the video-to-image implementation for thumbnail generation and the cost math for folding it into a daily automation
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API / SDK2026-04-18
Building an Automated Content Pipeline with Veo 3 & Lyria 3 Pro API — Mass-Producing Video + Music
Learn how to combine Veo 3 and Lyria 3 Pro APIs to automatically generate and merge video and music from text prompts. Covers setup, production-ready Python code, error handling, common pitfalls, and cost optimization strategies.
API / SDK2026-03-25
Building a Prompt Evaluation & Optimization Pipeline with Gemini API — Automated Quality Scoring with LLM-as-Judge
Learn how to build a prompt evaluation pipeline using Gemini API. Covers the LLM-as-Judge pattern, A/B testing prompts, automated quality scoring, and cost-quality optimization for production systems.
API / SDK2026-06-21
Track Gemini API Costs in Production with usageMetadata — A Per-Request Logging Pattern That Reconciles With Your Bill
A production pattern for capturing Gemini API's usageMetadata per request to attribute spend by endpoint, user, and model — hardened for the 3.5 Flash GA era where the default model can shift under you. Covers pricing keyed on resp.model_version and a nightly audit that flags model drift and unknown models before the invoice does.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →