惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Project Zero
Project Zero
F
Fortinet All Blogs
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
爱范儿
爱范儿
博客园_首页
S
Security @ Cisco Blogs
H
Heimdal Security Blog
Cyberwarzone
Cyberwarzone
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
T
Threatpost
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
S
Security Affairs
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cisco Talos Blog
Cisco Talos Blog
博客园 - 聂微东
P
Privacy & Cybersecurity Law Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
NISL@THU
NISL@THU
G
GRAHAM CLULEY
人人都是产品经理
人人都是产品经理
L
LangChain Blog
The Register - Security
The Register - Security
L
LINUX DO - 最新话题
博客园 - 【当耐特】
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
IT之家
IT之家
云风的 BLOG
云风的 BLOG
量子位
D
Darknet – Hacking Tools, Hacker News & Cyber Security
PCI Perspectives
PCI Perspectives
腾讯CDC
大猫的无限游戏
大猫的无限游戏
美团技术团队
N
News | PayPal Newsroom
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Docker
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Cloudbric
Cloudbric

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Imagen 3 & 4 Shut Down June 24: Migrate to Gemini Image (2026)
Anup Karanjkar · 2026-06-22 · via DEV Community

June 24, 2026. That is the shutdown date for every Imagen model on Firebase AI Logic — imagen-3.0-generate-002, imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, imagen-4.0-fast-generate-001. All of them. If you have been putting off this migration, you have run out of runway.

The replacement is Google's Gemini Image models — internally called "Nano Banana," publicly named gemini-2.5-flash-image. The migration is mostly a one-function rename and a response structure update, around 90 minutes of work for most codebases. The catch: one Imagen capability, mask-based editing, has no replacement at all. That separate deadline hits June 30.

What Goes Dark and When

Firebase AI Logic's migration documentation confirms these shutdown dates:

  • imagen-3.0-generate-002 — June 24, 2026

  • imagen-4.0-generate-001 — June 24, 2026

  • imagen-4.0-ultra-generate-001 — June 24, 2026

  • imagen-4.0-fast-generate-001 — June 24, 2026

  • imagen-3.0-capability-001 (mask editing: inpainting, outpainting, object removal) — June 30, 2026

Vertex AI runs on a slightly different clock — Google recommends migrating before June 30, with a hard shutdown date of August 17 for Vertex AI users on legacy Imagen endpoints. Firebase AI Logic is the shorter deadline. Don't assume extra time if your app uses the Firebase SDK.

The Core Migration: Python

Three things change simultaneously: the method name, the model identifier, and the response structure. All three break if you miss any one of them.

Before (Imagen):

import google.generativeai as genai

client = genai.Client(api_key="YOUR_KEY")

response = client.models.generate_images(
    model="imagen-4.0-generate-001",
    prompt="A red fox running through snow",
    config={"number_of_images": 1, "output_mime_type": "image/jpeg"}
)

image_bytes = response.generated_images[0].image.image_bytes

After (Gemini Image):

import google.generativeai as genai

client = genai.Client(api_key="YOUR_KEY")

response = client.models.generate_content(
    model="gemini-2.5-flash-image",
    contents="A red fox running through snow"
)

image_bytes = response.candidates[0].content.parts[0].inline_data.data

generate_images becomes generate_content. The response path shifts from .generated_images[0].image.image_bytes to .candidates[0].content.parts[0].inline_data.data. The config dict drops entirely — gemini-2.5-flash-image does not accept number_of_images as a parameter. If you need multiple images, call the API multiple times.

The response structure change is where most migration bugs land. Imagen returned a typed ImageGenerationResponse with a strongly-typed .images array. Gemini Image returns a GenerateContentResponse with a mixed .parts array. If your call generates both text and an image in the same response (Gemini Image supports this; Imagen did not), you cannot reliably grab index 0 — you need to filter parts by type.

TypeScript / Node.js

// Before
const response = await ai.models.generateImages({
  model: 'imagen-4.0-generate-001',
  prompt: 'A red fox running through snow',
  config: { numberOfImages: 1, outputMimeType: 'image/jpeg' }
});
const imageBytes = response.generatedImages[0].image.imageBytes;

// After
const response = await ai.models.generateContent({
  model: 'gemini-2.5-flash-image',
  contents: 'A red fox running through snow'
});
const imageBytes = response.candidates[0].content.parts[0].inlineData.data;

Same pattern: method rename, model name, response path. The camelCase shifts to match — inlineData rather than inline_data in the JavaScript SDK. Watch for that.

Firebase SDK Migration (Swift and Kotlin)

Mobile developers using Firebase AI Logic have platform-specific SDK changes on top of the model swap.

Swift — Before:

let imagenModel = FirebaseAI.imagenModel(modelName: "imagen-4.0-generate-001")
let response = try await imagenModel.generateImages(from: "A red fox in snow")
let imageData = response.images.first?.data

Swift — After:

let geminiModel = FirebaseAI.generativeModel(modelName: "gemini-2.5-flash-image")
let response = try await geminiModel.generateContent("A red fox in snow")
let imageData = response.candidates.first?.content.parts
    .compactMap { $0 as? InlineDataPart }
    .first?.data

Kotlin — Before:

val imagenModel = Firebase.ai.imagenModel("imagen-4.0-generate-001")
val response = imagenModel.generateImages("A red fox in snow")
val imageData = response.images.firstOrNull()?.data

Kotlin — After:

val geminiModel = Firebase.ai.generativeModel("gemini-2.5-flash-image")
val response = geminiModel.generateContent("A red fox in snow")
val imageData = response.candidates.firstOrNull()?.content?.parts
    ?.filterIsInstance()
    ?.firstOrNull()?.inlineData?.data

The Swift version uses .compactMap { $0 as? InlineDataPart } to filter the parts array. Kotlin uses filterIsInstance<InlineDataPart>(). Both are more verbose than the old response.images.first, but both handle the mixed-parts response correctly regardless of whether the model returns text alongside the image.

The Gap Nobody Has a Solution For

imagen-3.0-capability-001 handles mask-based editing — inpainting (fill a masked region with generated content), outpainting (extend the canvas beyond its borders), and object removal (fill with background). Its shutdown date is June 30, not June 24. That is not extra time; it is a separate deadline for a separate endpoint being retired without a direct replacement.

Google's DevRel team confirmed this in a developer forum thread on June 18 with 147 replies. The frustration was pointed: developers using Imagen mask editing for product photo cleanup, e-commerce background removal, and virtual try-on have no equivalent Gemini Image API call. The recommended path from the Google team was to migrate core generation to gemini-2.5-flash-image now, and handle the mask editing gap via third-party services until Google ships a native solution — with no ETA given.

If mask editing is a peripheral feature in your app, stub it out with an error message and plan a replacement later. If mask editing is central to your product value, you need a fallback before June 30. Stability AI's SDXL inpainting API accepts similar mask formats. Replicate hosts several inpainting models at comparable quality levels. Cloudflare Workers AI includes a Stable Diffusion inpainting endpoint that skips GPU infrastructure management entirely. None of these are drop-in replacements, but all expose mask-based editing that won't disappear on you in eight days.

What the Outputs Actually Look Like After Migration

The API is not the only thing that changes. Run your existing prompt library through Gemini Image before cutting prod traffic over.

Aspect ratios. Imagen 4 accepted explicit parameters: 1:1, 4:3, 3:4, 16:9, 9:16. Gemini Image defaults to 1:1 and reads aspect ratio guidance from the prompt itself. For landscape or portrait outputs, add directional language — "horizontal landscape image" or "vertical portrait format" — directly in the prompt. Missing this is the most common migration regression reported in the Google developer forums.

Text rendering. Imagen 4.0-ultra was the benchmark for readable text within generated images. Gemini Image handles text better than Imagen 3 did, but trails 4.0-ultra on multi-word phrases, sub-12px apparent font sizes, and text on complex backgrounds. If your prompts include specific text strings like business cards, labels, or signage, benchmark explicitly before launch.

Safety filtering. Gemini Image runs Gemini's content safety system, which is more conservative than Imagen's on ambiguous content. Prompts involving artistic violence, medical imagery, or certain cultural content that Imagen processed without intervention may now return refusals. Run your full prompt corpus through Google AI Studio — free tier handles this — and note which prompts need adjustment before touching production code.

SynthID watermarks. Both Imagen and Gemini Image embed SynthID digital watermarks. The implementations differ in their metadata format. If your pipeline reads, strips, or validates SynthID data, test that code path against Gemini Image outputs specifically.

Price per image. Imagen used flat per-image pricing. Gemini Image on Vertex AI bills per output token — a typical 1024×1024 JPEG runs 400–600 image output tokens. At current Vertex AI rates, that lands higher than Imagen's standard tier for most workloads. Run cost projections against your actual usage before cutting over if you generate at volume.

Vertex AI Migration

Vertex AI users have a slightly different SDK path. The old Imagen endpoint was imagegeneration@006 under the Vision Models library. The replacement uses the Generative Models SDK:

from vertexai.generative_models import GenerativeModel

# Before
from vertexai.preview.vision_models import ImageGenerationModel
model = ImageGenerationModel.from_pretrained("imagegeneration@006")
response = model.generate_images(prompt="A red fox in snow")
image = response.images[0]

# After
model = GenerativeModel("gemini-2.5-flash-image")
response = model.generate_content("A red fox in snow")
image_data = response.candidates[0].content.parts[0].inline_data.data

Check your Vertex AI quota for gemini-2.5-flash-image before migration. The default is 60 requests per minute per region — separate from text model quotas and separate from the old Imagen quotas. If you are running at any meaningful volume, file a quota increase request through Google Cloud Console today. Standard processing is 24–48 hours, and the buffer before Vertex AI shutdown on August 17 disappears faster than it looks.

Migration Checklist

  1. Grep the codebase for imagenModel, generate_images, generateImages, imagegeneration@, and every Imagen model name string. One pass surfaces every file that needs updating.

  2. Run your 20 most-used prompts through gemini-2.5-flash-image in Google AI Studio (free tier). Document output differences — especially aspect ratios and text rendering. Adjust prompts before touching code.

  3. Update method names, model identifiers, and response parsing paths in a feature branch. The code changes are mechanical; the response structure update is where bugs hide.

  4. Check Vertex AI quota for gemini-2.5-flash-image and request an increase if needed.

  5. If the app uses mask-based editing: stand up a third-party fallback before June 30. This takes longer than the core migration — start it today.

  6. Deploy to staging, run the full test suite. Snapshot tests will need to be reset — model outputs differ.

  7. Cut Firebase production traffic to Gemini Image by June 24. Keep the old Imagen code paths behind a feature flag for one week as a rollback target.

Speed on the other side of this migration is genuinely better: Imagen 4 averaged 4–6 seconds per 1024×1024 image; Gemini Image averages 2–3 seconds. Users notice. The mask editing gap is real, and Google has given no timeline for closing it. The rest of the migration is three renamed functions and a different response path. Start the grep now.

Originally published at wowhow.cloud