$npx -y skills add inference-sh/skills --skill nano-banana-2Generate images with Google Gemini 3.1 Flash Image Preview (Nano Banana 2) via inference.sh CLI. Capabilities: text-to-image, image editing, multi-image input (up to 14 images), Google Search grounding. Triggers: nano banana 2, nanobanana 2, gemini 3.1 flash image, gemini 3 1 fla
| 1 | > **Install the belt CLI skill:** `npx skills add belt-sh/cli` |
| 2 | |
| 3 | # Nano Banana 2 - Gemini 3.1 Flash Image Preview |
| 4 | |
| 5 | Generate images with Google Gemini 3.1 Flash Image Preview via [inference.sh](https://inference.sh) CLI. |
| 6 | |
| 7 | ## Quick Start |
| 8 | |
| 9 | > Requires inference.sh CLI (`belt`). [Install instructions](https://raw.githubusercontent.com/inference-sh/skills/refs/heads/main/cli-install.md) |
| 10 | |
| 11 | ```bash |
| 12 | belt login |
| 13 | |
| 14 | belt app run google/gemini-3-1-flash-image-preview --input '{"prompt": "a banana in space, photorealistic"}' |
| 15 | ``` |
| 16 | |
| 17 | |
| 18 | ## Examples |
| 19 | |
| 20 | ### Basic Text-to-Image |
| 21 | |
| 22 | ```bash |
| 23 | belt app run google/gemini-3-1-flash-image-preview --input '{ |
| 24 | "prompt": "A futuristic cityscape at sunset with flying cars" |
| 25 | }' |
| 26 | ``` |
| 27 | |
| 28 | ### Multiple Images |
| 29 | |
| 30 | ```bash |
| 31 | belt app run google/gemini-3-1-flash-image-preview --input '{ |
| 32 | "prompt": "Minimalist logo design for a coffee shop", |
| 33 | "num_images": 4 |
| 34 | }' |
| 35 | ``` |
| 36 | |
| 37 | ### Custom Aspect Ratio |
| 38 | |
| 39 | ```bash |
| 40 | belt app run google/gemini-3-1-flash-image-preview --input '{ |
| 41 | "prompt": "Panoramic mountain landscape with northern lights", |
| 42 | "aspect_ratio": "16:9" |
| 43 | }' |
| 44 | ``` |
| 45 | |
| 46 | ### Image Editing (with input images) |
| 47 | |
| 48 | ```bash |
| 49 | belt app run google/gemini-3-1-flash-image-preview --input '{ |
| 50 | "prompt": "Add a rainbow in the sky", |
| 51 | "images": ["https://example.com/landscape.jpg"] |
| 52 | }' |
| 53 | ``` |
| 54 | |
| 55 | ### High Resolution (4K) |
| 56 | |
| 57 | ```bash |
| 58 | belt app run google/gemini-3-1-flash-image-preview --input '{ |
| 59 | "prompt": "Detailed illustration of a medieval castle", |
| 60 | "resolution": "4K" |
| 61 | }' |
| 62 | ``` |
| 63 | |
| 64 | ### With Google Search Grounding |
| 65 | |
| 66 | ```bash |
| 67 | belt app run google/gemini-3-1-flash-image-preview --input '{ |
| 68 | "prompt": "Current weather in Tokyo visualized as an artistic scene", |
| 69 | "enable_google_search": true |
| 70 | }' |
| 71 | ``` |
| 72 | |
| 73 | ## Input Options |
| 74 | |
| 75 | | Parameter | Type | Description | |
| 76 | |-----------|------|-------------| |
| 77 | | `prompt` | string | **Required.** What to generate or change | |
| 78 | | `images` | array | Input images for editing (up to 14). Supported: JPEG, PNG, WebP | |
| 79 | | `num_images` | integer | Number of images to generate | |
| 80 | | `aspect_ratio` | string | Output ratio: "1:1", "16:9", "9:16", "4:3", "3:4", "auto" | |
| 81 | | `resolution` | string | "1K", "2K", "4K" (default: 1K) | |
| 82 | | `output_format` | string | Output format for images | |
| 83 | | `enable_google_search` | boolean | Enable real-time info grounding (weather, news, etc.) | |
| 84 | |
| 85 | ## Output |
| 86 | |
| 87 | | Field | Type | Description | |
| 88 | |-------|------|-------------| |
| 89 | | `images` | array | The generated or edited images | |
| 90 | | `description` | string | Text description or response from the model | |
| 91 | | `output_meta` | object | Metadata about inputs/outputs for pricing | |
| 92 | |
| 93 | ## Prompt Tips |
| 94 | |
| 95 | **Styles**: photorealistic, illustration, watercolor, oil painting, digital art, anime, 3D render |
| 96 | |
| 97 | **Composition**: close-up, wide shot, aerial view, macro, portrait, landscape |
| 98 | |
| 99 | **Lighting**: natural light, studio lighting, golden hour, dramatic shadows, neon |
| 100 | |
| 101 | **Details**: add specific details about textures, colors, mood, atmosphere |
| 102 | |
| 103 | ## Sample Workflow |
| 104 | |
| 105 | ```bash |
| 106 | # 1. Generate sample input to see all options |
| 107 | belt app sample google/gemini-3-1-flash-image-preview --save input.json |
| 108 | |
| 109 | # 2. Edit the prompt |
| 110 | # 3. Run |
| 111 | belt app run google/gemini-3-1-flash-image-preview --input input.json |
| 112 | ``` |
| 113 | |
| 114 | ## Python SDK |
| 115 | |
| 116 | ```python |
| 117 | from inferencesh import inference |
| 118 | |
| 119 | client = inference() |
| 120 | |
| 121 | # Basic generation |
| 122 | result = client.run({ |
| 123 | "app": "google/gemini-3-1-flash-image-preview@0c7ma1ex", |
| 124 | "input": { |
| 125 | "prompt": "A banana in space, photorealistic" |
| 126 | } |
| 127 | }) |
| 128 | print(result["output"]) |
| 129 | |
| 130 | # Stream live updates |
| 131 | for update in client.run({ |
| 132 | "app": "google/gemini-3-1-flash-image-preview@0c7ma1ex", |
| 133 | "input": { |
| 134 | "prompt": "A futuristic cityscape at sunset" |
| 135 | } |
| 136 | }, stream=True): |
| 137 | if update.get("progress"): |
| 138 | print(f"progress: {update['progress']}%") |
| 139 | if update.get("output"): |
| 140 | print(f"output: {update['output']}") |
| 141 | ``` |
| 142 | |
| 143 | ## Related Skills |
| 144 | |
| 145 | ```bash |
| 146 | # Original Nano Banana (Gemini 3 Pro Image, Gemini 2.5 Flash Image) |
| 147 | npx skills add inference-sh/skills@nano-banana |
| 148 | |
| 149 | # Full platform skill (all apps) |
| 150 | npx skills add inference-sh/skills@infsh-cli |
| 151 | |
| 152 | # All image generation models |
| 153 | npx skills add inference-sh/skills@ai-image-generation |
| 154 | ``` |
| 155 | |
| 156 | Browse all image apps: `belt app store --category image` |
| 157 | |
| 158 | ## Documentation |
| 159 | |
| 160 | - [Running Apps](https://inference.sh/docs/apps/running) - How to run apps via CLI |
| 161 | - [Streaming Results](https://inference.sh/docs/api/sdk/streaming) - Real-time progress updates |
| 162 | - [File Handling](https://inference.sh/docs/api/sdk/files) - Working with images |