NewsAI & DevelopmentCloud & DevOps

Firebase Imagen Shutdown: Migrate to Gemini Image Models Now

Firebase Imagen models shutting down, migration to Gemini Image models illustrated with blue and white tech design

Firebase’s Imagen image generation models went offline today. Any app still calling ImagenModel with an Imagen model name is now receiving 404 errors from Google’s API. This is not a soft deprecation — it’s a hard cut. The replacement is the Gemini Image model family, specifically gemini-3.1-flash-image, which Google has been shipping under the internal name “Nano Banana 2.” The migration is not a one-line swap. The API class, configuration object, method call, and response handling all change.

What Is Shutting Down

All Imagen models across both the Gemini Developer API and Vertex AI Gemini API are terminated as of June 24, 2026. That includes the generation models (imagen-3.0-generate-001, imagen-3.0-fast-generate-001) and the editing capability model (imagen-3.0-capability-001). If your mobile or web app uses Firebase AI Logic and calls any of these, it is broken right now.

Affected platforms: Android (Kotlin/Java), iOS (Swift), Web (JavaScript), Flutter (Dart), and Unity (C#). If your app generates images and uses Firebase, assume you are affected until you verify otherwise.

The Four Changes Required

The migration from Imagen to Gemini Image involves four distinct API changes. Before diving in, make sure your Firebase AI Logic SDK is at the early May 2026 release or newer — older versions do not expose imageConfig support.

  • Replace the model class. ImagenModel is gone. You now use GenerativeModel, the same class used for text generation. Get it via getGenerativeModel() instead of getImagenModel().
  • Replace the configuration object. ImagenGenerationConfig is replaced by GenerationConfig with a nested imageConfig block. The aspect ratio and image size options move there.
  • Replace the method call. generateImages() is replaced by generateContent().
  • Update response handling. Imagen returned an images[] array. Gemini Image returns a multimodal response with mixed parts — your code needs to find the part where inlineData exists.

Here is what the JavaScript migration looks like:

// BEFORE — returns 404 starting today
const imagenModel = getImagenModel(ai, { model: "imagen-3.0-generate-001" });
const result = await imagenModel.generateImages({
  prompt: "a mountain lake at dusk",
  aspectRatio: ImagenAspectRatio.LANDSCAPE_16x9,
});
const imageData = result.images[0].bytesBase64Encoded;

// AFTER — works now
const model = getGenerativeModel(ai, {
  model: "gemini-3.1-flash-image",
  generationConfig: {
    responseModalities: ["TEXT", "IMAGE"],
  }
});
const result = await model.generateContent("a mountain lake at dusk");
const imagePart = result.response.candidates[0].content.parts
  .find(p => p.inlineData);
const imageData = imagePart.inlineData.data;

The Multimodal Gotcha

Gemini Image models do not generate images in isolation. They always produce text alongside images — this is a fundamental design difference from Imagen. If you set responseModalities: ["IMAGE"] without including "TEXT", the entire response fails. You must include both. Your app will receive a text part and an image part in every response. The text is usually a brief description or caption; you can ignore it, but you cannot make it disappear.

Use Firebase Remote Config for the Model Name

Firebase explicitly recommends against hardcoding model names — and today is a clear illustration of why. Mobile apps cannot force users to update immediately. If you hardcoded imagen-3.0-generate-001, your app is broken for every user on an older version. Firebase Remote Config lets you switch the model name server-side without a new app release. Set this up now, before the next transition.

The pattern is straightforward: store the model name as a Remote Config parameter, fetch it at app startup, and pass it to getGenerativeModel(). Firebase’s Remote Config integration guide for AI Logic walks through the full implementation.

Why Google Made This Change

Google is consolidating its AI product lines under the Gemini brand. Imagen was developed by a separate team with a different architecture; Gemini Image models now surpass it on generation speed, cost, and prompt understanding. Nano Banana 2 (gemini-3.1-flash-image) generates images roughly 50 percent faster than the original Nano Banana Pro at a lower per-image cost.

The Imagen firebase shutdown is not the last consolidation you will see from Google. Other specialized APIs in the Google AI ecosystem are likely to follow the same path into Gemini. If you are building on Firebase, get comfortable with the Gemini model family and make Remote Config part of your standard AI integration setup. The Gemini image generation reference has full platform-specific examples for Android, iOS, Flutter, and Web.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:News