Nano Banana 2
Nano Banana 2 (officially known as Gemini 3.1 Flash Image) is Google’s upgraded AI image generation and editing model that brings advanced visual creation capabilities to a broad audience. It generates detailed, expressive images from text and image prompts with sharp details, richer lighting, and improved adherence to complex instructions. Nano Banana 2 also supports multi-object and multi-character consistency, accurate text rendering within images, and flexible resolution control up to 4K. It is now integrated across Google’s AI platforms including the Gemini app, Search AI Mode, and other Gemini-powered services.
API Options
Platform-level options for task execution and delivery.
-
taskType
string required value: imageInference -
Identifier for the type of task being performed
-
taskUUID
string required UUID v4 -
UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.
-
outputType
string default: URL -
Image output type.
Allowed values 3 values
-
outputFormat
string default: JPG -
Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.
- `JPG`: Best for photorealistic images with smaller file sizes (no transparency).
- `PNG`: Lossless compression, supports high quality and transparency (alpha channel).
- `WEBP`: Modern format providing superior compression and transparency support.
**Transparency**: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., `PNG`, `WEBP`, `TIFF`). `JPG` does not support transparency.Allowed values 3 values
-
outputQuality
integer min: 20 max: 99 default: 95 -
Compression quality of the output. Higher values preserve quality but increase file size.
-
webhookURL
string URI -
Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.
Learn more 1 resource
- Webhooks PLATFORM
- Webhooks
-
deliveryMethod
string default: sync -
Determines how the API delivers task results.
Allowed values 2 values
- Returns complete results directly in the API response.
- Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse.
Learn more 1 resource
- Task Polling PLATFORM
-
uploadEndpoint
string URI -
Specifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.
Common use cases:
- Cloud storage: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.
- CDN integration: Upload to content delivery networks for immediate distribution.
// S3 presigned URL for secure upload https://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600 // Google Cloud Storage presigned URL https://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789 // Custom storage endpoint https://storage.example.com/uploads/generated-image.jpgThe content data will be sent as the request body to the specified URL when generation is complete.
-
safety
object -
Content safety checking configuration for image generation.
Properties 2 properties
-
safety»checkContentcheckContent
boolean default: false -
Enable or disable content safety checking. When enabled, defaults to
fastmode.
-
safety»modemode
string default: none -
Safety checking mode for image generation.
Allowed values 2 values
- Disables checking.
- Performs a single check.
-
-
ttl
integer min: 60 -
Time-to-live (TTL) in seconds for generated content. Only applies when
outputTypeisURL.
-
includeCost
boolean default: false -
Include task cost in the response.
-
numberResults
integer min: 1 max: 20 default: 1 -
Number of results to generate. Each result uses a different seed, producing variations of the same parameters.
Inputs
Input resources for the task (images, audio, etc). These must be nested inside the inputs object.
inputs object.-
inputs»referenceImagesreferenceImages
array of strings min items: 1max items: 14 -
List of reference images (UUID, URL, Data URI, or Base64).
Generation Parameters
Core parameters for controlling the generated content.
-
model
string required value: google:4@3 -
Identifier of the model to use for generation.
Learn more 3 resources
-
positivePrompt
string required min: 3 max: 45000 -
Text prompt describing elements to include in the generated output.
Learn more 2 resources
-
width
integer paired with height -
Width of the generated media in pixels.
Learn more 2 resources
-
height
integer paired with width -
Height of the generated media in pixels.
Learn more 2 resources
-
resolution
string -
Resolution preset for the output. When used with input media, automatically matches the aspect ratio from the input.
Allowed values 4 values
-
seed
integer min: 0 max: 9223372036854776000 -
Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.
Learn more 1 resource
Settings
Technical parameters to fine-tune the inference process. These must be nested inside the settings object.
settings object.-
settings»systemPromptsystemPrompt
string min: 1 max: 50000 -
System-level instruction that guides the model's behavior and output style across the entire generation.
-
settings»temperaturetemperature
float min: 0 max: 1 step: 0.01 -
Controls randomness in generation. Lower values produce more deterministic outputs, higher values increase variation and creativity.
-
settings»topPtopP
float min: 0 max: 1 step: 0.01 -
Nucleus sampling parameter that controls diversity by limiting the probability mass. Lower values make outputs more focused, higher values increase diversity.
-
settings»thinkingthinking
string -
Controls the depth of internal reasoning the model performs before generating a response.
Allowed values 2 values
Provider Settings
Parameters specific to this model provider. These must be nested inside the providerSettings.google object.
providerSettings.google object.-
providerSettings»google»imageSearchimageSearch
boolean default: false -
Enable image search grounding to incorporate visual references from the web into image generation.
-
providerSettings»google»safetyTolerancesafetyTolerance
string default: none -
Safety filter tolerance level. Use
offto use Google's defaults.Allowed values 5 values
-
providerSettings»google»webSearchwebSearch
boolean default: false -
Enable live web search grounding to incorporate real-world, up-to-date information into image generation.
Neon Food-Truck Poster
{
"taskType": "imageInference",
"taskUUID": "16830039-18a1-48fc-b10a-3f40efdf519a",
"model": "google:4@3",
"positivePrompt": "A premium commercial poster for a futuristic night market food truck parked under glowing neon signs in a rainy street, cinematic composition, ultra-detailed stainless steel truck, colorful steam rising from gourmet ramen bowls, diverse crowd in stylish streetwear, reflections on wet pavement, vibrant magenta and cyan lighting, crisp depth, dramatic perspective. Include a large illuminated menu board on the truck with clearly readable text: 'MIDNIGHT RAMEN', 'OPEN LATE', 'TONKOTSU', 'SPICY MISO', 'VEGAN SHOYU'. Add a small hanging sign that reads 'TOKYO LANE'. High-end food photography styling mixed with cyberpunk atmosphere, sharp details, expressive lighting, clean typography, no gibberish text.",
"width": 1264,
"height": 848,
"settings": {
"temperature": 0.72,
"topP": 0.9,
"thinking": "HIGH"
},
"providerSettings": {
"google": {
"safetyTolerance": "off"
}
}
}{
"taskType": "imageInference",
"taskUUID": "16830039-18a1-48fc-b10a-3f40efdf519a",
"imageUUID": "a92e81cb-5e64-4bda-b378-0028ca847637",
"imageURL": "https://im.runware.ai/image/os/a13d12/ws/2/ii/a92e81cb-5e64-4bda-b378-0028ca847637.jpg",
"seed": 1465087545,
"cost": 0.06895
}Grounded Travel Poster
{
"taskType": "imageInference",
"taskUUID": "9b064579-dc1a-4667-8c05-3da9bbf98d89",
"model": "google:4@3",
"positivePrompt": "A premium editorial travel poster for Kyoto, Japan in peak spring season, featuring a serene canal lined with cherry blossoms, traditional wooden machiya houses, warm lantern light, distant temple rooftops, and stylish contemporary typography reading 'KYOTO' with smaller subtitle text 'Spring City Guide'. Elegant magazine-cover composition, ultra-detailed petals, cinematic golden-hour lighting, realistic water reflections, balanced negative space for layout, refined color grading, crisp legible text, sophisticated tourism campaign aesthetic.",
"width": 1264,
"height": 848,
"settings": {
"temperature": 0.72,
"topP": 0.95,
"thinking": "HIGH"
},
"providerSettings": {
"google": {
"webSearch": true,
"safetyTolerance": "off"
}
}
}{
"taskType": "imageInference",
"taskUUID": "9b064579-dc1a-4667-8c05-3da9bbf98d89",
"imageUUID": "2d578240-50ca-4bc2-9f48-d6027c04b30f",
"imageURL": "https://im.runware.ai/image/os/a22d05/ws/2/ii/2d578240-50ca-4bc2-9f48-d6027c04b30f.jpg",
"seed": 538258016,
"cost": 0.06895
}Tri-Reference Fashion Collage
{
"taskType": "imageInference",
"taskUUID": "ad37991f-9336-4899-96d1-a1ce6584843b",
"model": "google:4@3",
"positivePrompt": "Create a luxury fashion editorial composition that merges the subject from reference image 1, the jewelry styling motifs from reference image 2, and the architectural environment from reference image 3. Show the model standing confidently in the modern interior, wearing an elegant ivory tailored outfit accented with bold layered gold jewelry. Preserve a premium magazine aesthetic, refined pose, cinematic sunlight, crisp textile detail, realistic skin texture, balanced shadows, and sophisticated color harmony. Add a subtle high-end cover-shoot feeling with strong composition and excellent material realism.",
"width": 1264,
"height": 848,
"settings": {
"temperature": 0.72,
"topP": 0.95,
"thinking": "HIGH"
},
"providerSettings": {
"google": {
"safetyTolerance": "off"
}
},
"inputs": {
"referenceImages": [
"https://assets.runware.ai/assets/inputs/75aefcce-72ed-4724-938d-5ee8e4aa7135.jpg",
"https://assets.runware.ai/assets/inputs/126c9bf9-6190-448a-a23b-d454ca664c45.jpg",
"https://assets.runware.ai/assets/inputs/63051915-2949-4583-abd2-03d7d59312ce.jpg"
]
}
}{
"taskType": "imageInference",
"taskUUID": "ad37991f-9336-4899-96d1-a1ce6584843b",
"imageUUID": "0cd975bc-cc0f-4b35-acaf-4af962f6451e",
"imageURL": "https://im.runware.ai/image/os/a23d05/ws/2/ii/0cd975bc-cc0f-4b35-acaf-4af962f6451e.jpg",
"seed": 705629215,
"cost": 0.06979
}Retro Arcade Poster
{
"taskType": "imageInference",
"taskUUID": "f61cb15d-3d7f-40d8-a5ab-bdc8ad3361a5",
"model": "google:4@3",
"positivePrompt": "A bold retro-futurist arcade poster for a fictional game called 'NEON DRIFT'. A chrome magenta sports hovercar races through a glowing synthwave city at night, giant holographic billboards, electric rain, teal and pink reflections on the street, dramatic cinematic perspective, dense atmosphere, razor-sharp details, expressive lighting, polished poster composition. Include crisp readable title text at the top: 'NEON DRIFT'. Include smaller subtitle text at the bottom: 'MIDNIGHT CIRCUIT CHAMPIONSHIP'. High contrast, premium graphic design, vibrant colors, clean typography, ultra-detailed, visually striking.",
"width": 1264,
"height": 848,
"settings": {
"thinking": "HIGH",
"temperature": 0.82,
"topP": 0.95,
"systemPrompt": "Generate a highly polished image that prioritizes instruction following, coherent composition, accurate embedded text rendering, and rich cinematic lighting."
},
"providerSettings": {
"google": {
"imageSearch": false,
"webSearch": false,
"safetyTolerance": "off"
}
}
}{
"taskType": "imageInference",
"taskUUID": "f61cb15d-3d7f-40d8-a5ab-bdc8ad3361a5",
"imageUUID": "360d09c1-6934-42dc-a7bd-b5b0ccbd0858",
"imageURL": "https://im.runware.ai/image/os/a24d12/ws/2/ii/360d09c1-6934-42dc-a7bd-b5b0ccbd0858.jpg",
"seed": 1466209441,
"cost": 0.06895
}