Nano Banana 2 は Google の Gemini 3.1 Flash Image(モデル ID gemini-3.1-flash-image)です。Google 公式の入口は Gemini アプリと Google AI Studio で、YingTu は LaoZhang API 経由で使う独立したサイトです。
Turn the pet in the reference image into a boxed collectible toy: matte vinyl finish, keeping its fur colors, markings and tongue-out expression. It sits in a clear bubble on cardboard printed with grass and bones, with a frisbee, a bone and a tiny dog bowl in the side compartments. The box reads "PARK HERO". White background, soft studio light, product photography.
Dress the pet in the reference image in a pumpkin Halloween costume: an orange pumpkin suit with a little green leaf hat. It sits on front steps covered in fallen leaves, next to small pumpkins and a basket of candy. Warm early-evening light, blurred string lights behind, keep the breed, fur colors and markings. A cute holiday photo.
Turn the reference photo into a Japanese anime illustration: clean line art, cel shading, large expressive eyes, keeping the short hair, denim jacket, white T-shirt and the pose by the window. Outside the window, a summer afternoon street with blue sky and clouds, bright and airy light. Keep the composition and expression of the original.
Turn the person in the reference image into a sheet of 6 chibi stickers: waving hello, making a heart, sipping coffee, listening with headphones, falling asleep on a desk and jumping for joy. Each sticker has a thick white die-cut border and a slight drop shadow, keeping the hairstyle, denim jacket and facial features. Light grey background, neat grid, flat cartoon style, high resolution.
Make a standard ID photo of the person in the reference image: facing the camera, shoulders level, natural expression, dressed in a dark suit and white shirt with tidy hair. Plain blue background (#438EDB), even shadowless frontal light, a little space above the head, high resolution. Keep the face and features unchanged.
Cut out the product from the reference image and make an e-commerce main image: pure white background (#FFFFFF), product centered at about 80% of the frame, front view slightly from above, with a soft natural shadow underneath. Fix perspective and white balance, remove clutter and glare, keep the shape, color and print unchanged, sharp and high resolution.
An explainer card about photosynthesis: a cross-section illustration of a leaf in the middle, with arrows showing sunlight, carbon dioxide and water going in, and oxygen and glucose coming out. Title at the top "How Do Plants Eat?", a one-line summary at the bottom. Fresh green palette, children's science book style, clear and accurate labels.
A 45° isometric miniature city block: an old train station with a clock tower in the middle, surrounded by a café, a bookshop, a small park and a tram, with people and bikes on the streets. Detailed 3D render, soft evening light, warm streetlights just turning on, plain light background, like a fine tabletop model.
ビジネス用プロフィール写真
どちらも顔立ちを保ち、2 枚のビジネス写真はほぼ同じです。
入力画像(AI 生成)
Nano Banana Pro
Nano Banana 2 · 14 秒
プロンプト
Turn the person in the reference image into a professional headshot: beige blazer, chest-up framing, body slightly angled and smiling at the camera. Blurred modern office background, soft key light from the left with a rim light, 85mm lens look, natural skin tones, same facial features. Suitable for LinkedIn and a résumé.
Restore this old photo: remove scratches, creases, mold spots and noise, fill in missing areas, sharpen it, then colorize it naturally with period-accurate skin, clothing and background colors. Keep every face, expression, pose and the composition exactly the same, no beautifying, so it looks like it was shot on color film at the time.
import base64
import mimetypes
import os
import sys
import requests
API_KEY = os.environ.get("LAOZHANG_API_KEY")
ifnot API_KEY:
raise RuntimeError("Set the LAOZHANG_API_KEY environment variable before running this example.")
API_URL = "https://api2.laozhang.ai/v1beta/models/gemini-3.1-flash-image:generateContent"
REQUEST_TIMEOUT_SECONDS = 500
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
payload = {
"contents": [{
"parts": [
{"text": "A clean product photo of a matte ceramic coffee mug on a light stone table, soft window light, natural shadows, minimal styling."}
]
}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"imageSize": "2K"
}
}
}
try:
response = requests.post(
API_URL,
headers=headers,
json=payload,
timeout=REQUEST_TIMEOUT_SECONDS,
)
except requests.Timeout as error:
print(
"Request timed out after 500 seconds. The result status may be unknown; ""check call and billing logs before retrying.",
file=sys.stderr,
)
raise SystemExit(1) from error
if response.status_code != 200:
print(f"API error {response.status_code}: {response.text}", file=sys.stderr)
raise SystemExit(1)
try:
result = response.json()
except ValueError as error:
print("API returned a non-JSON response.", file=sys.stderr)
raise SystemExit(1) from error
ifnotisinstance(result, dict):
print("API returned an unexpected JSON shape.", file=sys.stderr)
raise SystemExit(1)
image_part = Nonefor candidate in result.get("candidates", []):
for part in candidate.get("content", {}).get("parts", []):
inline_data = part.get("inlineData") or part.get("inline_data")
if inline_data and inline_data.get("data"):
image_part = inline_data
breakif image_part:
breakifnot image_part:
response_id = result.get("responseId", "not provided")
print(f"No image data in response. responseId={response_id}", file=sys.stderr)
raise SystemExit(1)
mime_type = image_part.get("mimeType") or image_part.get("mime_type") or"image/png"
encoded_image = image_part["data"]
if encoded_image.startswith("data:"):
header, encoded_image = encoded_image.split(",", 1)
mime_type = header[5:].split(";", 1)[0] or mime_type
extension_by_mime = {
"image/jpeg": "jpg",
"image/png": "png",
"image/webp": "webp",
"image/gif": "gif",
}
extension = extension_by_mime.get(mime_type, "bin")
output_path = f"output.{extension}"withopen(output_path, "wb") as output_file:
output_file.write(base64.b64decode(encoded_image, validate=True))
print(f"Image saved: {output_path} ({mime_type})")
よくある質問
ここは Nano Banana 2 の公式サイトですか?
いいえ。Nano Banana 2 は Google の Gemini 3.1 Flash Image で、公式の入口は Gemini アプリと Google AI Studio です。YingTu は同じモデル(gemini-3.1-flash-image)を LaoZhang API で呼び出し、1 枚ごとに課金する独立したスタジオです。