Profile

google / nano-banana-2

Nano Banana 2 is a fast and versatile text-to-image model. It excels at creating high-quality images, from photorealistic scenes to complex infographics with accurate text, and can optionally use Google Search to generate content based on real-time information.

Priced by megapixels

Model Input

Input

The text prompt for image generation.

The aspect ratio of the generated image.

The resolution of the generated image.

Use Google Search to generate images based on recent or real-time information. Send an empty object to enable.

Additional Settings

Customize your input with more control.

The category for this safety setting.

The probability threshold at which content is blocked.

The category for this safety setting.

The probability threshold at which content is blocked.

The category for this safety setting.

The probability threshold at which content is blocked.

The category for this safety setting.

The probability threshold at which content is blocked.

A list of unique safety settings for blocking unsafe content. This setting can only be configured via the API.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Fill in the input form and click submit to see the output
Logs (1 lines)

Model Pricing

Pricing

Model pricing varies by the resolution of your output image.

512
$0.0450
per image
1K
$0.0670
per image
2K
$0.1010
per image
4K
$0.1510
per image

Model Details

Model Details

Nano Banana 2 is a highly efficient and versatile text-to-image model, optimized for a balance of speed, quality, and cost. It is an excellent choice for a wide variety of creative and commercial applications, from generating marketing assets to creating photorealistic scenes and artistic illustrations from simple text prompts.

The model's deep language understanding allows it to interpret detailed, narrative descriptions to produce coherent and high-quality images. Key capabilities include:

- **Photorealism and Artistic Versatility:** Create stunning, realistic product mockups, professional-looking photographs, and explore a vast range of artistic styles by describing camera angles, lighting, and composition. - **Accurate Text Rendering:** Generate logos, infographics, and other designs that require legible and stylized text directly within the image. - **Real-Time Generation with Google Search:** By enabling the `google_search` option, the model can access real-time information to create timely and relevant images, such as a chart of current weather conditions or a graphic of a recent sporting event.

For best results, write descriptive, narrative prompts rather than just listing keywords. Explain the context and intent of the image, and don't hesitate to iterate with follow-up prompts to refine the output.

### Example Usage ```javascript import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("google/nano-banana-2", { input: { prompt: "Create a modern, minimalist logo for a coffee shop called 'The Daily Grind' in a clean, bold, sans-serif font. The color scheme is black and white.", aspect_ratio: "1:1", resolution: "2K", google_search: false }, }); ```

## Safety & Content Moderation The `safety_settings` parameter allows you to adjust the content moderation filters for your requests. You can configure a blocking threshold for four different categories of potentially harmful content. This provides more granular control for specific use cases, such as allowing more "dangerous" content when generating dialogue or scenes for a video game. This setting can only be configured via the API.

The available `category` options are: - `HARM_CATEGORY_HARASSMENT` - `HARM_CATEGORY_HATE_SPEECH` - `HARM_CATEGORY_SEXUALLY_EXPLICIT` - `HARM_CATEGORY_DANGEROUS_CONTENT`

The `threshold` determines the probability level at which content is blocked: - `BLOCK_NONE`: Always show content, regardless of safety probability. - `BLOCK_ONLY_HIGH`: Block content with a high probability of being unsafe. - `BLOCK_MEDIUM_AND_ABOVE`: Block content with a medium or high probability of being unsafe. - `BLOCK_LOW_AND_ABOVE`: Block content with a low, medium, or high probability of being unsafe. - `OFF`: Turn off the safety filter.

```javascript const result = await modelrunner.subscribe("google/nano-banana-2", { input: { prompt: "A gritty, noir art style comic panel of a detective in the rain.", safety_settings: [ { category: "HARM_CATEGORY_DANGEROUS_CONTENT", threshold: "BLOCK_MEDIUM_AND_ABOVE" }, { category: "HARM_CATEGORY_HATE_SPEECH", threshold: "BLOCK_LOW_AND_ABOVE" } ] }, }); ```