Model chooser / Generate or edit images / Recurring
Product shots, ad variants and article images at scale need good quality at a predictable cost per image. Nano Banana 2 ranks sixth on the text-to-image arena at roughly a third of the leader's price per image, from a vendor with stable API terms.
Why Nano Banana 2 (Gemini 3.1 Flash Image)
How to use it
Gemini API, TypeScript
Edit the parts in capitals, then run it.
import { GoogleGenAI } from "@google/genai";
import { writeFileSync } from "node:fs";
const ai = new GoogleGenAI({}); // reads GEMINI_API_KEY
const prompt = `Product photo of PRODUCT on a light oak table, soft window light,
50mm, shallow depth of field, muted palette with one BRAND COLOUR accent. No text.`;
const interaction = await ai.interactions.create({
model: "gemini-3.1-flash-image",
input: prompt,
});
writeFileSync("product.png", Buffer.from(interaction.output_image.data, "base64"));
Alternatives that also work
Pick it when quality outweighs cost, such as hero images for a launch. Flare is the default for most apps and ranks first.
Pick it when the images carry text, such as ad variants with headlines in several languages.
Pick it when volume is large enough that a GPU costs less than per-image pricing. Apache 2.0.
Watch out for
Sources
Checked . Models change monthly; we re-check this page when they do.
Wiring it into a workflow that runs every week, with evals, fallbacks and a cost you can predict, is the work. Fifteen minutes, no deck.