Skip to main content

Overview

Nano Banana is varg’s recommended default image model, powered by Google Gemini. It excels at both text-to-image generation and reference-based image editing. Two generations are available:
Model IDGenerationModeCredits~Cost
nano-banana-proGen 1Text-to-image5$0.05
nano-banana-pro/editGen 1Image editing (requires input)5$0.05
nano-banana-2Gen 2Text-to-image + editing5$0.05
nano-banana-2/editGen 2Image editing (explicit)5$0.05

Quick start

import { createVarg } from "vargai/ai"

const varg = createVarg({ apiKey: process.env.VARG_API_KEY! })

const result = await varg.imageModel("nano-banana-pro").generate({
  prompt: "a cozy coffee shop interior, warm lighting, plants on shelves",
  aspectRatio: "16:9",
})

console.log(result.image.url)

Capabilities

Text-to-image

Generate images from text descriptions:
const result = await varg.imageModel("nano-banana-pro").generate({
  prompt: "professional headshot, woman in business attire, studio lighting",
  aspectRatio: "1:1",
})

Image editing

Edit an existing image using a text prompt and reference image:
const original = Image({
  model: varg.imageModel("nano-banana-pro"),
  prompt: "woman in casual clothes standing in a park",
  aspectRatio: "9:16",
})

const edited = Image({
  model: varg.imageModel("nano-banana-pro/edit"),
  prompt: { text: "same woman wearing an elegant red dress", images: [original] },
  aspectRatio: "9:16",
})
nano-banana-pro/edit requires an input image. Plain text prompts without a reference image will fail.

Multi-image reference

Provide up to 14 reference images for complex editing:
const edited = Image({
  model: varg.imageModel("nano-banana-pro/edit"),
  prompt: {
    text: "combine these two characters into one scene",
    images: [characterA, characterB],
  },
})

Nano Banana 2 (next-gen)

The Gen 2 model supports auto aspect ratio and web search capabilities:
cURL
curl -X POST https://api.varg.ai/v1/image \
  -H "Authorization: Bearer $VARG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "a photorealistic mountain landscape at sunset"
  }'

Parameters

prompt
string | { text: string, images: Image[] }
required
Text prompt for generation. For editing, provide { text, images } with reference images.
aspect_ratio
string
default:"1:1"
Output aspect ratio. Supported: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16. Nano Banana 2 also supports "auto".
files
array
Array of { url: string } objects for reference images (API). Up to 14 images for pro, up to 6 for Nano Banana 2.
provider_options
object
Supports resolution ("1K", "2K", "4K" — default varies by model), safety_filter_level, web_search (Nano Banana 2 only).

Pricing

ModelCreditsUSD
nano-banana-pro5$0.05
nano-banana-pro/edit5$0.05
nano-banana-25$0.05
nano-banana-2/edit5$0.05
The cheapest image generation with the best quality-to-cost ratio.

Tips

  • Use Nano Banana as your default image model. At 5 credits, it’s the best value for text-to-image.
  • Image editing is the killer feature. Generate a base image, then iteratively refine with /edit.
  • Perfect for video reference frames. Generate an image with Nano Banana, then animate with Kling V3 or Seedance 2.
  • Multi-image prompts let you combine characters, transfer styles, or composite scenes.
  • 4K resolution is available via provider options for hero images that need maximum detail.

Flux

Alternative image generation. Flux Pro for highest quality.

Phota

Identity-preserving generation with profile-based control.

Grok Imagine Image

Cheapest image model at 3 credits.

Seedance 2

Animate your Nano Banana images with Seedance image-to-video.