← All models
Google: Nano Banana
gemini-2.5-flash-imageimages
Google Gemini 2.5 Flash Image (Nano Banana) — image generation and editing from text and references. Fast, keeps composition on edits, supports image-to-image.
Price
Released
Oct 7, 2025
Parameters
promptrequiredaspect_ratio1:12:33:23:44:34:55:49:1616:921:9resolution1ksize1526x654816x12241224x816750x13321332x750866x11541154x866894x11181118x8941000x1000imageimage-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-2.5-flash-image",
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-2.5-flash-image",
image=open("photo.png", "rb"), # один или несколько референсов
prompt="Добавь неоновую вывеску на фасад, сохрани композицию",
)
with open("edited.png", "wb") as f:
f.write(base64.b64decode(edited.data[0].b64_json))
