DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
ThatPainter
AI image editing

How to Use the Nano Banana API for Image and Video Edits

Nano Banana is Google’s Gemini image-model family—not a standalone API. Learn the current model IDs, SDK setup, image editing workflow, and image-to-video handoff.

By ThatPainter Team Updated 10 min read
Worth Installing

Outdated Drivers Are Slowing You Down

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Outbyte Driver Updater · freeOne free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchScan My Drivers Free →

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ThatPainter is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn More

Nano Banana is not a separate API. It is Google’s name for a family of Gemini image-generation and image-editing models accessed through the Gemini API. For a complete image-to-video workflow, use Nano Banana to design or refine a still image, then pass that image to a video model such as Veo or Gemini Omni Flash.

This guide covers the current model IDs, setup, image generation, conversational editing, resolution controls, video handoff, asynchronous jobs, prompting, costs, and common failures. Model names and availability can change, so verify the live documentation before deploying.

What is the Nano Banana API?

“Nano Banana API” is informal shorthand for using Google’s Gemini API with its Nano Banana image models. Nano Banana itself is not a standalone image app, video editor, or separate developer product.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

As of August 18, 2026, Google documents four variants:

#1 Best Overall
Sale
XPPen Mini Keydial ACK05 Wireless Shortcut Keyboard Bluetooth Programmable Express Remote Control with Dial & Customized Express Keys for Drawing Tablet PC MacBook Windows Images Video Editing
  • Wireless Connection: ACK05 wireless shortcut keyboard supports bluetooth 5.0 connection directly, which is Good Design Award 2023 Winners, providing you a more flexible and clean workspace. You can also connect it via a Bluetooth dongle or USB cable. Total three ways connection bring you stable and fast transmission, also can meet your different work scenarios
  • Please Note: If you do not download the driver, it can only be used as a regular shortcut keyboard. However, if you wish to customize the keys or program it, you must download the driver and configure it accordingly. If your device is an iPad or runs on iOS, after receiving the product, you need to download the "Shortcut Remote" app on your device in order to properly set up and use this product properly
  • Compact Size with Large 1000 mAh Battery: The Wireless Shortcut Remote features a thin profile and weighs only 75 g, easy for one hand to hold. With built-in 1000 mAh battery ensures the continuous working for about 300 hours. Ready to speed up your creation whenever you grab it
  • Customize up to forty Shortcuts: The Wireless Shortcut Remote has ten keys. You are allowed to customize four sets through the driver -- up to forty shortcuts. To switch between the sets, you only need to press a single key. Its capability to work with different applications makes itself a powerful productivity tool not only for creation, but also for study, work, and gaming
  • Anti-Ghosting Performance: The Mini Keydial features a new technology of Anti-ghosting for all ten keys, you can control with multi-keys at the same time, which will give you more customizable possibilities
Nickname Model ID Best for
Nano Banana 2 Lite gemini-3.1-flash-lite-image Fast, high-volume drafts and variations
Nano Banana 2 gemini-3.1-flash-image General image generation, editing, references, and consistency
Nano Banana Pro gemini-3-pro-image Complex brand assets, layouts, localization, and premium output
Nano Banana gemini-2.5-flash-image Legacy integrations that need compatibility

Google recommends newer Nano Banana variants, so tutorials that use only gemini-2.5-flash-image may no longer describe the best current path.

Which Nano Banana model should you choose?

  • Use Nano Banana 2 Lite for thumbnails, quick concepts, and large batches where latency and cost matter more than complex references. It supports 1K output and is not the best choice for demanding multi-reference edits.
  • Use Nano Banana 2 as the default. It offers the strongest balance of quality, speed, editing, image references, and consistency, with 1K, 2K, and 4K output options.
  • Use Nano Banana Pro for detailed creative work, intricate layouts, brand assets, and high-resolution production images. It supports output up to 4K.
  • Use the original Nano Banana only when maintaining an existing legacy integration is more important than migrating.

These models are distinct from access through the Gemini app, Google AI Studio, and Google Cloud. The Gemini app is a consumer interface; AI Studio is useful for experimentation and key creation; the Gemini API is the programmable interface; and Google Cloud provides separate enterprise billing, governance, and deployment options.

Requirements and API-key setup

You need a Google AI Studio or Google Cloud account, a Gemini API key, a current Google GenAI SDK, and Python 3.x or Node.js. Production applications also need quota and billing planning.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create a key in Google AI Studio, then store it outside your source code:

export GEMINI_API_KEY="your-api-key"

In Windows PowerShell:

$env:GEMINI_API_KEY="your-api-key"

The SDK reads GEMINI_API_KEY by default in Google’s examples. Never commit the key to a repository, place it in browser code, or include it in client-side logs. For a server application, use a secrets manager and rotate exposed keys.

Install the current Google GenAI SDK

pip install google-genai pillow

For JavaScript:

npm install @google/genai

SDK interfaces change. The examples below follow Google’s current GenAI SDK and Interactions API documentation; check the getting-started guide and current release before publishing an application.

Rank #2
Sale
Drawing Tablet XPPen StarG640 Digital Graphic Tablet 6x4 Inch Art Tablet with Battery-Free Stylus Pen Tablet for Mac, Windows and Chromebook (Drawing/E-Learning/Remote-Working)
  • Battery-Free Pen: StarG640 drawing tablet is the perfect replacement for a traditional mouse! The XPPen advanced Battery-free PN01 stylus does not require charging, allowing for constant uninterrupted Draw and Play, making lines flow quicker and smoother, enhancing overall performance
  • Ideal for Online Education: XPPen G640 graphics tablet is designed for digital drawing, painting, sketching, E-signatures, online teaching, remote work, photo editing, it's compatible with Microsoft Office apps like Word, PowerPoint, OneNote, Zoom, Xsplit etc. Works perfect than a mouse, visually present your handwritten notes, signatures precisely
  • Compact and Portable: The G640 art tablet is only 2 mm thick, it's as slim as all primary level graphic tablets, allowing you to carry it with you on the go
  • Chromebook Supported: XPPen G640 digital drawing tablet is ready to work seamlessly with Chromebook devices now, so you can create information-rich content and collaborate with teachers and classmates on Google Jamboard’s whiteboard; Take notes quickly and conveniently with Google Keep, and effortlessly sketch diagrams with the Google Canvas
  • Multipurpose Use: Designed for playing OSU! Game, digital drawing, painting, sketch, sign documents digitally, this writing tablet also compatible with Microsoft Office programs like Word, PowerPoint, OneNote and more. Create mind-maps, draw diagrams or take notes as replacement for mouse

Generate an image with Nano Banana 2

The current image-generation examples use interactions.create(). Python:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import base64
from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.1-flash-image",
    input=(
        "Create a cinematic product image of a matte-black travel bottle "
        "on a wet basalt rock beside a mountain stream at dawn. "
        "Soft golden rim light, realistic water droplets, premium outdoor "
        "advertising style, wide 16:9 composition."
    ),
)

with open("product-hero.png", "wb") as output:
    output.write(base64.b64decode(interaction.output_image.data))

JavaScript:

import { GoogleGenAI } from "@google/genai";
import fs from "node:fs";

const ai = new GoogleGenAI({});

const interaction = await ai.interactions.create({
  model: "gemini-3.1-flash-image",
  input:
    "Create a cinematic product image of a matte-black travel bottle " +
    "on a wet basalt rock beside a mountain stream at dawn. " +
    "Soft golden rim light, realistic water droplets, premium outdoor " +
    "advertising style, wide 16:9 composition.",
});

if (interaction.output_image) {
  fs.writeFileSync(
    "product-hero.png",
    Buffer.from(interaction.output_image.data, "base64")
  );
}

Do not assume every response contains only an image. Model output can include text and multiple content blocks. For production code, inspect the response and handle the absence of output_image explicitly.

Edit an existing image with a prompt

Nano Banana accepts text and image input together. Its editing workflow is conversational: describe what should change and what must remain unchanged.

import base64
from google import genai

client = genai.Client()

with open("product-hero.png", "rb") as image_file:
    image_data = base64.b64encode(image_file.read()).decode("utf-8")

interaction = client.interactions.create(
    model="gemini-3.1-flash-image",
    input=[
        {
            "type": "image",
            "data": image_data,
            "mime_type": "image/png",
        },
        {
            "type": "text",
            "text": (
                "Keep the bottle, camera angle, mountain stream, lighting, "
                "and composition unchanged. Replace only the matte-black "
                "finish with brushed copper. Preserve realistic reflections "
                "and water droplets."
            ),
        },
    ],
)

for step in interaction.steps:
    if step.type == "model_output":
        for block in step.content:
            if block.type == "image":
                with open("product-copper.png", "wb") as output:
                    output.write(base64.b64decode(block.data))

You can ask it to add or remove an object, replace a background, change clothing or lighting, alter a product finish, apply a visual style, combine references, or turn a video into a poster, thumbnail, storyboard frame, or other still. Nano Banana 2 is the better choice when consistency across multiple references matters.

Generative editing is not deterministic layer-based masking. “Change only the background” is an instruction, not a guarantee that reflections, edges, shadows, faces, or nearby pixels will remain identical. Preserve the source, compare every result, and use conventional compositing when exact preservation is essential.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Control aspect ratio and resolution

For Gemini 3 image models, request the format explicitly:

Rank #3
Sale
HUION Inspiroy H1060P Graphics Drawing Tablet, 10 x 6.25 in, 12+16 Hot Keys
  • Working Area Configuration - HUION art tablet equips with a 10 x 6.25 inches working area, providing the user with the most comfortable size to work; the 10mm slim structure and minimalist design of appearance make the drawing tablet more attractive.
  • Tilt Function Battery-free Stylus: This computer graphics tablet come with a battery-free stylus PW100, no need to charge, allowing for constant uninterrupted drawing. ±60° tilt support enables imitation of lines input with diverse drawing gestures, with accuracy ensured.
  • Press Keys:12 programmable press keys plus 16 programmable soft keys, you can set shortcut keys on drawing tablet's driver based on your preferences, such as erase, zoom in/out, scroll up and down, and so on.
  • Compatibility: HUION graphics tablet supports Windows 7 or later/ macOS 10.12 or later/ Android 6.0 or later/ Linux (Ubuntu). A USB adapter is required to connect to a Mac computer. H1060P supports various mainstream design and drawing software, including PS, SAI, AI, CDR, etc. (Please note: The H1060P is compatible with Ubuntu, but it requires the use of the Xorg display server. Wayland is not supported.)
  • NOTE: You can easily connect your phone to the art tablet via the OTG connector; while iPhone and iPad are NOT at the moment. The cursor will not show up in the SAMSUNG Galaxy S series at present. If you are not sure whether the product is compatible with your Phone or any help, please contact us.
interaction = client.interactions.create(
    model="gemini-3.1-flash-image",
    input="A cinematic 16:9 establishing shot of a neon-lit Tokyo alley in rain",
    response_format={
        "type": "image",
        "mime_type": "image/jpeg",
        "aspect_ratio": "16:9",
        "image_size": "2K",
    },
)

Use uppercase values such as 1K, 2K, and 4K; lowercase forms may be rejected. Nano Banana 2 Lite is limited to 1K.

  • 1K: prompt testing and rough drafts.
  • 2K: a practical default for web and social assets.
  • 4K: final work that genuinely benefits from additional detail.

Generate at the intended aspect ratio whenever possible. Cropping afterward can remove carefully composed negative space or alter the subject’s placement.

Build the Nano Banana-to-video workflow

The most reliable creative pipeline is:

  1. Generate a key image with Nano Banana 2.
  2. Review product geometry, identity, logos, hands, faces, and text.
  3. Make constrained still-image edits until the design is approved.
  4. Use the approved still as an image-to-video starting frame or visual reference.
  5. Generate several motion variations.
  6. Finish the chosen clip in a conventional editor.

Keep the roles separate:

  • Nano Banana: image creation, image editing, composition, style transfer, and video-to-image work.
  • Gemini Omni Flash: conversational video generation and editing, including text_to_video, image_to_video, reference_to_video, and edit tasks.
  • Veo: dedicated cinematic video-generation workflows, including image-to-video and related video operations.
  • Traditional editing software: precise cuts, timeline assembly, color, audio, captions, and delivery exports.

Route A: Nano Banana image to Veo

Use the still as a starting frame or reference for the subject, costume, product design, and environment. Google’s Veo guide demonstrates this Nano Banana-to-Veo handoff.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Because Veo methods and model IDs can vary between Gemini API, preview, and Google Cloud endpoints, copy the exact current method from that guide rather than hard-coding an old example. Conceptually, the request looks like this:

operation = client.models.generate_videos(
    model="veo-3.1-generate-preview",
    prompt=(
        "Slow cinematic camera push toward the bottle. "
        "Water droplets slide down the surface. "
        "The mountain stream moves naturally in the background. "
        "Preserve the bottle's shape, label placement, and copper finish."
    ),
    image=starting_image,
)

Route B: Gemini Omni Flash

Omni Flash is the more natural choice when you want a conversational video transformation or edit. Specify the appropriate task mode in the video configuration, or use a prompt that clearly states the intended operation. Consult Google’s Omni documentation for the current model and request shape.

Poll asynchronous video operations

Video generation normally returns an operation rather than an immediately downloadable binary. Your application should:

Rank #4
Sale
XPPen Deco 01 V3 10x6 Drawing Tablet, 16K Battery-Free Stylus, 8 Keys
  • Word-first 16K Pressure Levels: The upgraded stylus features 16,384 levels of pressure sensitivity and supports up to 60 degrees of tilt, delivering smoother lines and shading for a natural drawing experience. With no battery or charging needed, it operates like a real pen, making it easy for beginners to create effortlessly. This functionality helps novice artists develop their skills and explore their creativity without the intimidation of complex tools
  • Designed for Beginners: This drawing pad desinged with 8 customizable shortcuts for both right and left-hand users, express keys create a highly ergonomic and convenient work platform
  • Perfectly Adapted for Android: The XPPen Deco 01 V3 art tablet supports connections with Android devices running version 10.0 and above. It is recommended to download the XPPen Tools Android application, which adapts to your smartphone's screen aspect ratio, ensuring accurate mapping. It also supports mapping on Android screens with different aspect ratios in portrait mode
  • Large Drawing Space, Bigger Bold Inspiration: This expansive drawing pad has10 x 6.25-inch helps you break through the limit between shortcut keys and drawing area
  • Easy Connectivity for Beginners: The Deco 01 V3 offers USB-C to USB-C connectivity, plus adapters for USB C. This ensures easy connection to various devices, allowing beginner artists to set up quickly and focus on their creativity without compatibility concerns. Whether using a laptop, tablet, or desktop, the Deco 01 V3 provides a seamless experience, making it an ideal choice for those just starting their digital art journey
  1. Submit the request.
  2. Record the operation name and source asset.
  3. Poll at a sensible interval, such as 5–10 seconds.
  4. Use exponential backoff for transient network failures.
  5. Stop after a defined maximum wait, rather than blocking indefinitely.
  6. Check for an error field before downloading.
  7. Save the video and metadata such as model, prompt, timestamp, and exposed seed.
  8. Delete temporary uploads when they are no longer needed.

At timeout, show a status such as “generation still processing; check status later” and retain the operation identifier. Retry safely only where the endpoint supports idempotent behavior; otherwise, an automatic retry may create and charge for a duplicate job.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Prompt templates for stronger results

Image generation

Create a [shot type] of [subject] in [environment].

Subject: [identity, materials, shape, clothing, logo placement]
Composition: [camera angle, perspective, subject position, negative space]
Lighting: [time of day, key light, contrast, reflections, shadows]
Style: [photorealistic, editorial, cinematic, illustration]
Output: [aspect ratio, resolution, intended use]

Constrained image editing

Using the supplied image, change only [target element].

Make the change: [replacement, material, color, texture]
Integrate it with: [lighting, perspective, reflections]
Keep unchanged: [identity, composition, camera angle, background,
logo, text, and all other objects]

Image-to-video

Animate the supplied image into [duration and style].

Camera: [locked-off, dolly, crane, handheld, orbit]
Motion: [subject movement, environmental movement, speed, direction]
Continuity: Preserve [identity, geometry, clothing, palette].
Do not add [objects, text, logos, cuts].
Audio: [ambient sound, dialogue, music direction, or silent]

Change one variable at a time: composition first, then identity and geometry, lighting, background, motion, and finally resolution. A prompt such as “change only the red sofa to dark green leather” is usually more controllable than rewriting the entire scene.

Common problems and fixes

Invalid or unavailable model ID

Show both the nickname and official model ID in configuration, and check Google’s current model documentation. Older code may refer to gemini-2.5-flash-image, legacy Generate Content calls, or preview Veo IDs. Do not assume an Imagen integration remains available: Google’s documentation lists a shutdown date of August 17, 2026, so verify its present status.

The response contains text instead of an image

Check that you selected an image model, used the supported endpoint, and requested an image response where required. The response may contain interleaved text and image blocks, so inspect interaction.steps instead of assuming output_image always exists.

The edit changes too much

Use “change only” language, name every important invariant, provide a higher-quality source, and split a complex edit into smaller operations. For pixel-level accuracy, use a conventional editor with an explicit mask.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Logos, labels, or typography are wrong

Do not rely on generated text for final legal or marketing copy. Generate the visual without the final wording, then add exact text in an image editor. Inspect trademarks, small labels, faces, hands, and product geometry at 100 percent. Google’s image documentation also states that generated images include a SynthID watermark.

Best Value
Sale
Wacom Intuos Small, Bluetooth Graphic Drawing Tablet with Pen + Software
  • Wacom Intuos Small Bluetooth Graphics Drawing Tablet: Enjoy industry leading tablet performance in superior control and precision with Wacom's EMR, battery free technology that feels like pen on paper
  • Works With All Software: Wacom Intuos tablet can be used in any software program to explore new facets of digital creativity; draw, paint, edit photos/videos, create designs, and mark up documents
  • Wireless Superior Connectivity: Connect wirelessly via Bluetooth or directly using USB-A cable which enables you to work, draw or create whether it's at a desk, on the sofa, in classroom or even outside
  • Software and Training Included: Only Wacom gives you software with every purchase. Register your Intuos tablet and gain access to some of the best creative software and Wacom's online training
  • Wacom is the Global Leader in Drawing Tablet and Displays: For over 40 years in pen display and tablet market, you can trust that Wacom to help you bring your vision, ideas and creativity to life

Identity drifts

Reuse a consistent reference image, describe invariant features, and provide multiple reference views where supported. Avoid regenerating a person or product from text alone across every iteration.

Input-file errors

Verify the MIME type, file size, video format, and file accessibility. Large images and video should use Google’s documented Files API or file-input method rather than oversized inline base64. A public URL is not automatically fetchable by the API, and an expired or unauthorized file URI will fail.

Timeouts, quota errors, and unexpected charges

Log the model and operation name, use bounded polling, handle transient errors separately from permanent errors, and monitor quota. Keep drafts short and low resolution, cache approved stills, avoid regenerating unchanged inputs, and batch work only within your rate limits.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Costs and production considerations

Pricing depends on model, resolution, endpoint, region, and account tier. Google’s pricing page currently shows Veo 3.1 examples ranging from $0.05 per generated second for 720p Lite to $0.60 per second for 4K Standard; these figures were checked against the documentation supplied for this article and may change. Consult the live Gemini API pricing page before budgeting.

Use the fastest suitable model for prompt iteration, then render the approved version with a higher-quality model or resolution. Track retries because a failed network request is not necessarily proof that the server did not start a billable job. Store source images, prompts, model IDs, operation IDs, outputs, and timestamps so results can be reproduced or audited.

For enterprise deployment, Google Cloud offers separate generative-media and Vertex AI products with centralized billing and governance. Do not assume that a consumer Gemini plan, Flow access, Gemini API quota, and Google Cloud entitlement are interchangeable.

Rights, safety, and finishing

Obtain the necessary rights for uploaded photographs, video, likenesses, music, logos, trademarks, copyrighted characters, and client-owned product material. Images found through search are not automatically licensed for reuse. Follow Google’s image-generation policies and rights guidance.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For creators who do not need code, the Gemini app or Google Flow may be more convenient. Developers can start with AI Studio and the Gemini API; organizations needing governance may prefer Google Cloud. Dedicated tools such as Runway or Adobe Firefly may fit specialized creative workflows, while DaVinci Resolve is better for deterministic editing, color, audio, and timeline control.

The practical division is simple: design and refine the still with Nano Banana, animate or edit it with Veo or Gemini Omni Flash, then finish the selected footage in a conventional editor.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

More from the Paint Desk

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.