メインコンテンツへスキップ
POST
/
generate
/
k
/
nano-banana-2
Nano Banana 2 画像生成
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/nano-banana-2 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A beautiful landscape with mountains and a lake at sunset",
  "aspect_ratio": "auto",
  "google_search": false,
  "image_input": [
    ""
  ],
  "output_format": "jpg",
  "resolution": "1K"
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
Google DeepMind の Nano Banana 2 (Gemini 2.0 Flash) モデルを使用して画像を生成します。 主な特徴:
  • 統合された生成と編集 - テキストから画像生成と画像編集を一つのエンドポイントで実現
  • Google 検索拡張 - Google 検索を活用し、リアルタイムデータに基づいた画像を生成
  • マルチ画像入力 - 編集や参照用に最大14枚の入力画像をサポート
  • 柔軟な解像度 - 1K、2K、4K の出力解像度をサポート
  • 多様なアスペクト比 - 1:1 から 21:9 まで幅広いアスペクト比に対応

承認

Authorization
string
header
必須

API Tokenを使用して認証を行ってください

ボディ

application/json

タスクパラメータ

prompt
string
必須

Prompt 画像生成のためのテキスト記述(必須、最大20000文字)

Required string length: 1 - 20000
:

"A beautiful landscape with mountains and a lake at sunset"

aspect_ratio
enum<string>
デフォルト:auto

AspectRatio 画像のアスペクト比(オプション、デフォルトは auto)

利用可能なオプション:
1:1,
1:4,
1:8,
2:3,
3:2,
3:4,
4:1,
4:3,
4:5,
5:4,
8:1,
9:16,
16:9,
21:9,
auto
:

"auto"

GoogleSearch Google 検索による拡張を使用するかどうか(オプション、デフォルトは false)

:

false

image_input
string[]

ImageInput 入力画像のリスト(オプション、最大14枚、各画像最大30MBまでサポート)

Maximum array length: 14
:
[""]
output_format
enum<string>
デフォルト:jpg

OutputFormat 出力画像のフォーマット(オプション、デフォルトは jpg)

利用可能なオプション:
jpg,
png
:

"jpg"

resolution
enum<string>
デフォルト:1K

Resolution 画像の解像度(オプション、デフォルトは 1K)

利用可能なオプション:
1K,
2K,
4K
:

"1K"

レスポンス

成功

task_id
string
必須

タスクID

:

"01234567-89ab-cdef-0123-456789abcdef"