← All models
Google: Nano Banana 2
gemini-3.1-flash-image-previewimages
Refreshed Nano Banana with sharper details. Balance only.
Price
Released
Feb 26, 2026
Parameters
promptrequiredaspect_ratio1:12:33:23:44:34:55:49:1616:921:9resolution1k2k4ksize1526x654816x12241224x816750x13321332x750866x11541154x866894x11181118x8941000x10003054x13081632x24482448x16321732x23082308x17321788x22362236x17881500x26662666x15002000x20002448x32643264x24484320x18502120x37703770x21202528x31623162x25282308x34643464x23082828x2828imageimage-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="gemini-3.1-flash-image-preview",
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="gemini-3.1-flash-image-preview",
image=open("photo.png", "rb"), # один или несколько референсов
prompt="Добавь неоновую вывеску на фасад, сохрани композицию",
)
with open("edited.png", "wb") as f:
f.write(base64.b64decode(edited.data[0].b64_json))
