← All models
Google: Nano Banana 2.1
google/gemini-nano-banana-2.1images
Nano Banana 2.1 (Gemini Nano Banana 2.1) is Google's image generation and editing model on the Flash tier, succeeding Nano Banana 2 and Nano Banana Pro. It improves product recontextualization, mask- and ink-based editing, and factual accuracy, and renders photorealistic skin tones, detailed materials, lighting, and coherent backgrounds. It accepts text and image inputs, returns images with optional text, and supports 1K, 2K, and 4K output plus extended aspect ratios.
Price
Released
Oct 6, 2026
Parameters
promptrequired, up to 20,000 charactersaspect_ratio1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9resolution1k2k4ksize1526x654816x12241224x816750x13321332x750866x11541154x866894x11181118x894500x20001000x10002000x5003054x13081632x24482448x16321732x23082308x17321788x22362236x17881500x26662666x15001000x40002000x20004000x10002448x32643264x24484320x18502120x37703770x21202528x31623162x25282308x34643464x23081414x56562828x28285656x1414imageimage-to-image (via /v1/images/edits)How to use via API
import base64
from openai import OpenAI
client = OpenAI(base_url="https://api.mixen.ai/v1", api_key="mxn-...")
img = client.images.generate(
model="google/gemini-nano-banana-2.1",
prompt="Милый кот-космонавт на Марсе",
size="1526x654", # либо extra_body={"aspect_ratio": "1:1", "resolution": "1k"}
n=1,
)
with open("image.png", "wb") as f:
f.write(base64.b64decode(img.data[0].b64_json))
# image-to-image: передать референс(ы) через multipart
edited = client.images.edit(
model="google/gemini-nano-banana-2.1",
image=open("photo.png", "rb"), # один или несколько референсов
prompt="Добавь неоновую вывеску на фасад, сохрани композицию",
)
with open("edited.png", "wb") as f:
f.write(base64.b64decode(edited.data[0].b64_json))
