{"slug": "firebase-imagen-shutdown-migrate-to-gemini-image-models-now", "title": "Firebase Imagen Shutdown: Migrate to Gemini Image Models Now", "summary": "Firebase shut down its Imagen image generation models on June 24, 2026, causing 404 errors for apps still using the old API. Developers must migrate to the Gemini Image model family, which requires changes to the model class, configuration, method call, and response handling. Firebase recommends using Remote Config to avoid hardcoding model names and ensure future transitions are seamless.", "body_md": "Firebase’s Imagen image generation models went offline today. Any app still calling `ImagenModel`\n\nwith 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`\n\n, 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.\n\n## What Is Shutting Down\n\nAll Imagen models across both the [Gemini Developer API and Vertex AI Gemini API are terminated](https://firebase.google.com/docs/ai-logic/models) as of June 24, 2026. That includes the generation models (`imagen-3.0-generate-001`\n\n, `imagen-3.0-fast-generate-001`\n\n) and the editing capability model (`imagen-3.0-capability-001`\n\n). If your mobile or web app uses Firebase AI Logic and calls any of these, it is broken right now.\n\nAffected 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.\n\n## The Four Changes Required\n\nThe [migration from Imagen to Gemini Image](https://firebase.google.com/docs/ai-logic/imagen-models-migration) 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`\n\nsupport.\n\n**Replace the model class.**`ImagenModel`\n\nis gone. You now use`GenerativeModel`\n\n, the same class used for text generation. Get it via`getGenerativeModel()`\n\ninstead of`getImagenModel()`\n\n.**Replace the configuration object.**`ImagenGenerationConfig`\n\nis replaced by`GenerationConfig`\n\nwith a nested`imageConfig`\n\nblock. The aspect ratio and image size options move there.**Replace the method call.**`generateImages()`\n\nis replaced by`generateContent()`\n\n.**Update response handling.** Imagen returned an`images[]`\n\narray. Gemini Image returns a multimodal response with mixed parts — your code needs to find the part where`inlineData`\n\nexists.\n\nHere is what the JavaScript migration looks like:\n\n``` js\n// BEFORE — returns 404 starting today\nconst imagenModel = getImagenModel(ai, { model: \"imagen-3.0-generate-001\" });\nconst result = await imagenModel.generateImages({\n  prompt: \"a mountain lake at dusk\",\n  aspectRatio: ImagenAspectRatio.LANDSCAPE_16x9,\n});\nconst imageData = result.images[0].bytesBase64Encoded;\n\n// AFTER — works now\nconst model = getGenerativeModel(ai, {\n  model: \"gemini-3.1-flash-image\",\n  generationConfig: {\n    responseModalities: [\"TEXT\", \"IMAGE\"],\n  }\n});\nconst result = await model.generateContent(\"a mountain lake at dusk\");\nconst imagePart = result.response.candidates[0].content.parts\n  .find(p => p.inlineData);\nconst imageData = imagePart.inlineData.data;\n```\n\n## The Multimodal Gotcha\n\nGemini 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\"]`\n\nwithout including `\"TEXT\"`\n\n, 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.\n\n## Use Firebase Remote Config for the Model Name\n\nFirebase 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`\n\n, your app is broken for every user on an older version. [Firebase Remote Config lets you switch the model name server-side](https://firebase.google.com/docs/ai-logic/solutions/remote-config) without a new app release. Set this up now, before the next transition.\n\nThe pattern is straightforward: store the model name as a Remote Config parameter, fetch it at app startup, and pass it to `getGenerativeModel()`\n\n. Firebase’s Remote Config integration guide for AI Logic walks through the full implementation.\n\n## Why Google Made This Change\n\nGoogle 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`\n\n) generates images roughly 50 percent faster than the original Nano Banana Pro at a lower per-image cost.\n\nThe 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](https://firebase.google.com/docs/ai-logic/generate-images-gemini) has full platform-specific examples for Android, iOS, Flutter, and Web.", "url": "https://wpnews.pro/news/firebase-imagen-shutdown-migrate-to-gemini-image-models-now", "canonical_source": "https://byteiota.com/firebase-imagen-shutdown-migrate-to-gemini-image-models-now/", "published_at": "2026-06-24 05:13:49+00:00", "updated_at": "2026-06-24 05:19:47.858392+00:00", "lang": "en", "topics": ["artificial-intelligence", "generative-ai", "ai-products", "developer-tools"], "entities": ["Firebase", "Google", "Gemini", "Imagen", "Vertex AI", "Firebase Remote Config", "Android", "iOS"], "alternates": {"html": "https://wpnews.pro/news/firebase-imagen-shutdown-migrate-to-gemini-image-models-now", "markdown": "https://wpnews.pro/news/firebase-imagen-shutdown-migrate-to-gemini-image-models-now.md", "text": "https://wpnews.pro/news/firebase-imagen-shutdown-migrate-to-gemini-image-models-now.txt", "jsonld": "https://wpnews.pro/news/firebase-imagen-shutdown-migrate-to-gemini-image-models-now.jsonld"}}