- サードパーティ
- ゼロデータ保持
品質と速度を向上させた、Google の第2世代画像生成モデルです。
| モデル情報 | |
|---|---|
| 利用規約とライセンス | リンク ↗ |
| 詳細情報 | リンク ↗ |
| ゼロデータ保持 | はい |
| 料金 | Cloudflare ダッシュボードで料金を見る ↗ |
const response = await env.AI.run(
'google/nano-banana-2',
{
prompt:
'A futuristic cyberpunk city at night with towering skyscrapers, neon signs in Japanese and English, flying cars, and rain-slicked streets reflecting colorful lights',
aspect_ratio: '16:9',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/nano-banana-2",
"input": {
"prompt": "A futuristic cyberpunk city at night with towering skyscrapers, neon signs in Japanese and English, flying cars, and rain-slicked streets reflecting colorful lights",
"aspect_ratio": "16:9"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/google/nano-banana-2/futuristic-city.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}抽象アート — 現代的な抽象表現主義の絵画です
const response = await env.AI.run(
'google/nano-banana-2',
{
prompt:
'An abstract expressionist painting with bold splashes of cobalt blue, crimson red, and gold leaf accents on a large canvas',
aspect_ratio: '1:1',
output_format: 'png',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/nano-banana-2",
"input": {
"prompt": "An abstract expressionist painting with bold splashes of cobalt blue, crimson red, and gold leaf accents on a large canvas",
"aspect_ratio": "1:1",
"output_format": "png"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/google/nano-banana-2/abstract-art.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Google 検索あり — 時事向けに Web 検索グラウンディングを使います
const response = await env.AI.run(
'google/nano-banana-2',
{
prompt: 'An illustration of the latest Mars rover exploring the Martian surface',
aspect_ratio: '16:9',
google_search: true,
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/nano-banana-2",
"input": {
"prompt": "An illustration of the latest Mars rover exploring the Martian surface",
"aspect_ratio": "16:9",
"google_search": true
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/google/nano-banana-2/with-google-search.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}高解像度ポートレート — 指定アスペクト比の 4K ポートレートです
const response = await env.AI.run(
'google/nano-banana-2',
{
prompt:
'A professional studio portrait of a woman with dramatic side lighting, wearing elegant jewelry',
aspect_ratio: '3:4',
output_format: 'jpg',
resolution: '4K',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/nano-banana-2",
"input": {
"prompt": "A professional studio portrait of a woman with dramatic side lighting, wearing elegant jewelry",
"aspect_ratio": "3:4",
"output_format": "jpg",
"resolution": "4K"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/google/nano-banana-2/high-resolution-portrait.jpg"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}prompt
string必須▶image_input[]
arraymaxItems: 3aspect_ratio
stringenum: match_input_image, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9output_format
stringenum: jpg, pngresolution
stringenum: 1K, 2K, 4Kgoogle_search
booleanimage_search
booleanimage
stringformat: uri