Image generation with Gemini (aka Nano Banana)

A shared folder with AI prompts and code snippets

From workspace: Google Gemini

Team: Nano Banana

Total snippets: 5

Google Gemini

Image generation with Gemini (aka Nano Banana)

5 snippets

Image generation (text-to-image) REST

curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [{ "parts":...

Image generation (text-to-image) Go

package main import ( "context" "fmt" "os" "google.golang.org/genai" ) func main() { ctx := context.Background() client, err := genai.NewClient(ctx, nil) if err != nil { log.Fatal(err) } result, _ :=...

Image generation (text-to-image) Javascript

import { GoogleGenAI, Modality } from "@google/genai"; import * as fs from "node:fs"; async function main() { const ai = new GoogleGenAI({}); const prompt = "Create a picture of a nano banana dish in a fancy restaurant with a Gemini...

Image generation (text-to-image) Python

The following code demonstrates how to generate an image based on a descriptive prompt.

from google import genai from google.genai import types from PIL import Image from io import BytesIO client = genai.Client() prompt = ( "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme" ) response =...

About

Gemini can generate and process images conversationally. You can prompt Gemini with text, images, or a combination of both allowing you to create, edit, and iterate on visuals with unprecedented control:

Text-to-Image: Generate high-quality images from simple or complex text descriptions. Image + Text-to-Image (Editing): Provide an image and use text prompts to add, remove, or modify elements, change the style, or adjust the color...

Google Gemini - Image generation with Gemini (aka Nano Banana) - AI Prompts & Code Snippets | Snippets AI