Nano Banana Edit 画像編集
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/nano-banana-edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"image_urls": [
"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
],
"prompt": "turn this photo into a character figure. Behind it, place a box with the character's image printed on it",
"image_size": "1:1",
"output_format": "png"
}
EOFimport requests
url = "https://api.sinancode.com/v1/generate/k/nano-banana-edit"
payload = {
"image_urls": ["https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"],
"prompt": "turn this photo into a character figure. Behind it, place a box with the character's image printed on it",
"image_size": "1:1",
"output_format": "png"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image_urls: [
'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png'
],
prompt: 'turn this photo into a character figure. Behind it, place a box with the character\'s image printed on it',
image_size: '1:1',
output_format: 'png'
})
};
fetch('https://api.sinancode.com/v1/generate/k/nano-banana-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sinancode.com/v1/generate/k/nano-banana-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_urls' => [
'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png'
],
'prompt' => 'turn this photo into a character figure. Behind it, place a box with the character\'s image printed on it',
'image_size' => '1:1',
'output_format' => 'png'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sinancode.com/v1/generate/k/nano-banana-edit"
payload := strings.NewReader("{\n \"image_urls\": [\n \"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png\"\n ],\n \"prompt\": \"turn this photo into a character figure. Behind it, place a box with the character's image printed on it\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sinancode.com/v1/generate/k/nano-banana-edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_urls\": [\n \"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png\"\n ],\n \"prompt\": \"turn this photo into a character figure. Behind it, place a box with the character's image printed on it\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/nano-banana-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_urls\": [\n \"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png\"\n ],\n \"prompt\": \"turn this photo into a character figure. Behind it, place a box with the character's image printed on it\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}画像生成 - Nano Banana
Nano Banana Edit
Nano Banana Edit モデルを使用した画像編集(非同期)
POST
/
generate
/
k
/
nano-banana-edit
Nano Banana Edit 画像編集
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/nano-banana-edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"image_urls": [
"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
],
"prompt": "turn this photo into a character figure. Behind it, place a box with the character's image printed on it",
"image_size": "1:1",
"output_format": "png"
}
EOFimport requests
url = "https://api.sinancode.com/v1/generate/k/nano-banana-edit"
payload = {
"image_urls": ["https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"],
"prompt": "turn this photo into a character figure. Behind it, place a box with the character's image printed on it",
"image_size": "1:1",
"output_format": "png"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image_urls: [
'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png'
],
prompt: 'turn this photo into a character figure. Behind it, place a box with the character\'s image printed on it',
image_size: '1:1',
output_format: 'png'
})
};
fetch('https://api.sinancode.com/v1/generate/k/nano-banana-edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sinancode.com/v1/generate/k/nano-banana-edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image_urls' => [
'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png'
],
'prompt' => 'turn this photo into a character figure. Behind it, place a box with the character\'s image printed on it',
'image_size' => '1:1',
'output_format' => 'png'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sinancode.com/v1/generate/k/nano-banana-edit"
payload := strings.NewReader("{\n \"image_urls\": [\n \"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png\"\n ],\n \"prompt\": \"turn this photo into a character figure. Behind it, place a box with the character's image printed on it\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sinancode.com/v1/generate/k/nano-banana-edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"image_urls\": [\n \"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png\"\n ],\n \"prompt\": \"turn this photo into a character figure. Behind it, place a box with the character's image printed on it\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/nano-banana-edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_urls\": [\n \"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png\"\n ],\n \"prompt\": \"turn this photo into a character figure. Behind it, place a box with the character's image printed on it\",\n \"image_size\": \"1:1\",\n \"output_format\": \"png\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}Google DeepMind の Nano Banana モデルを使用して既存の画像を編集します。
承認
API Tokenを使用して認証を行ってください
ボディ
application/json
タスクパラメータ
画像URLリスト(必須)- 編集用の入力画像リスト、最大10枚
Required array length:
1 - 10 elements例:
[
"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
]
プロンプト(必須、最大5000文字)- 画像編集のテキスト記述
Required string length:
1 - 5000例:
"turn this photo into a character figure. Behind it, place a box with the character's image printed on it"
画像サイズ(オプション、デフォルト 1:1)- 画像アスペクト比
利用可能なオプション:
1:1, 9:16, 16:9, 3:4, 4:3, 3:2, 2:3, 5:4, 4:5, 21:9, auto 例:
"1:1"
出力形式(オプション)- 画像出力形式
利用可能なオプション:
png, jpeg 例:
"png"
レスポンス
OK
タスクID
例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I