Spiral gives your agent every tool with one account. Browse the tools →

VS Code · ImageReleased 2026-05-28

How to Use Nano Banana 2 in VS Code

Nano Banana 2 creates images and revises existing artwork through conversation. It covers both tasks in one model, while Nano Banana 2 Text to Image and Nano Banana 2 Image Editing organize them separately.

Prompts to try with Nano Banana 2 in VS Code

Copy an example into VS Code, or ask in your own words.

Use Nano Banana 2 to create a square 2K diagram explaining the three main stages documented in our architecture notes. Use short labels and flag any label that needs review.

Nano Banana 2VS Code
Try asking
  • Generate a product photo with Nano Banana 2: a matte black water bottle on wet slate, soft morning light, 1:1. Tell me the price first. Save the result in ./assets.

  • Make four logo concepts for a coffee brand called "Northline" with Nano Banana 2.

  • Create a 16:9 hero image of a quiet mountain cabin at dusk with Nano Banana 2.

  • Generate a 9:16 poster with Nano Banana 2 for a jazz night called "Blue Hour", deep navy and brass tones.

How to set up Nano Banana 2 in VS Code

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the hosted server

    Use Add to VS Code on the console's Agents & MCP page, or run:

    code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}'
  2. Sign in

    VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.

Use the Spiral skill

  1. Send VS Code this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Nano Banana 2

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "gemini",
        "model": "gemini-3.1-flash-image",
        "input": {
          "contents": [
            {}
          ]
        }
      }'

Then paste one of the prompts above: VS Code finds Nano Banana 2 on Spiral, shows the price and runs it.

Nano Banana 2 providers and prices

Spiral runs Nano Banana 2 through Gemini and Vertex AI. Open a card for today's price, with every fee included. Name one in your prompt, or let VS Code pick.

GeminiImage
Nano Banana 2
gemini-3.1-flash-image
Vertex AIImage
Nano Banana 2
gemini-3.1-flash-image

What can you do with Nano Banana 2 in VS Code?

Create illustrations and explanatory graphics for your project with Nano Banana 2. A coding agent can turn project notes into visual drafts and help review the results before adding them to the interface.

Social campaign artwork

Develop a campaign image from a written brief or revise a supplied draft. Specify the placement, subject, and short headline before working on alternate compositions.

Educational diagrams

Turn lesson notes into a labeled illustration, or improve an existing diagram. Keep labels brief and check the relationships between illustrated elements.

Event poster drafts

Create a poster concept or revise supplied artwork around an approved title and date. Keep detailed event information outside the generated image if it requires small lettering.

Presentation infographics

Build a visual explanation from verified notes or revise an existing slide graphic. Use a few clear labels instead of embedding paragraphs.

Localized promotional artwork

Start with an existing promotional image and replace its text with approved translated copy. Review wording, line breaks, and retained design details.

Background revisions

Revise the setting around a supplied subject to explore a different scene. Inspect the subject afterward for unintended changes.

Illustration style studies

Use a supplied image as the starting point for a different illustration treatment. Compare the results before choosing a direction.

Lighting revisions

Adjust the lighting in an existing image through a focused editing request. Change one aspect at a time so the result is easier to evaluate.

Nano Banana 2 success rate and speed on Spiral

Success and speed over the last 24 hours, across every run of these tools on Spiral.

Success rate
54.6%
Fastest median run time
15.4s
Runs, last 24 hours
1,006
ToolSuccessMedian timeRuns
Nano Banana 224.2%26.9s264
Nano Banana 265.4%15.4s742

Questions about Nano Banana 2 in VS Code

Can VS Code use Nano Banana 2?

Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run Nano Banana 2 like any built-in tool.

How much does Nano Banana 2 cost in VS Code?

$0.0874 per 1K image ($0.0583 at 0.5K, $0.131 at 2K, $0.197 at 4K). Prompt: $0.65 per 1M tokens. Reasoning: $3.90 per 1M tokens. Google Search: $0.0182 per query. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your VS Code plan is separate.

Do I need a Gemini account to use Nano Banana 2 in VS Code?

No. Spiral runs Nano Banana 2 on its own Gemini account. You sign in to Spiral once and never paste a key.

How long does it take to set up Nano Banana 2 in VS Code?

About two minutes: add the hosted server, then sign in.

Which provider runs Nano Banana 2?

Spiral offers Nano Banana 2 through Gemini and Vertex AI. Name one in your prompt, or let VS Code pick.

Does VS Code wait while Nano Banana 2 runs?

Nano Banana 2 runs in the background. VS Code starts the run, checks on it and gives you the image when it's ready.

What is Nano Banana 2 useful for?

Use it for visual drafts that combine illustrations and short labels, such as posters, educational diagrams, and infographics. It also supports conversational revisions, so you can develop a design through specific follow-up requests.

How large can Nano Banana 2 images be?

Nano Banana 2 supports output from 0.5K through 4K, with 1K as the default. Choose the composition as well as the resolution: square, portrait, landscape, and panoramic formats serve different placements.

Can Nano Banana 2 handle text inside images?

It can produce and translate text within artwork, but small lettering and long paragraphs remain weaknesses. Keep image copy short and check the spelling before using the result.

Will Nano Banana 2 preserve a character exactly?

Character consistency is imperfect. Compare the face, clothing, and distinguishing details after each revision before accepting a sequence of images.

Can Nano Banana 2 localize artwork?

Yes, it can translate and localize text within an image. Give it the intended audience and approved wording, then review the translated artwork before publication.

Get started

Start using Nano Banana 2 in VS Code

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into VS Code:

Set up VS Code

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options