Flux 2 Pro 画像から画像
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input_urls": [
"https://example.com/image1.png",
"https://example.com/image2.png"
],
"prompt": "The jar in image 1 is filled with capsules exactly same as image 2",
"aspect_ratio": "auto",
"resolution": "1K"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image"
payload = {
"input_urls": ["https://example.com/image1.png", "https://example.com/image2.png"],
"prompt": "The jar in image 1 is filled with capsules exactly same as image 2",
"aspect_ratio": "auto",
"resolution": "1K"
}
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({
input_urls: ['https://example.com/image1.png', 'https://example.com/image2.png'],
prompt: 'The jar in image 1 is filled with capsules exactly same as image 2',
aspect_ratio: 'auto',
resolution: '1K'
})
};
fetch('https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image', 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/flux2-pro-image-to-image",
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([
'input_urls' => [
'https://example.com/image1.png',
'https://example.com/image2.png'
],
'prompt' => 'The jar in image 1 is filled with capsules exactly same as image 2',
'aspect_ratio' => 'auto',
'resolution' => '1K'
]),
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/flux2-pro-image-to-image"
payload := strings.NewReader("{\n \"input_urls\": [\n \"https://example.com/image1.png\",\n \"https://example.com/image2.png\"\n ],\n \"prompt\": \"The jar in image 1 is filled with capsules exactly same as image 2\",\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\"\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/flux2-pro-image-to-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input_urls\": [\n \"https://example.com/image1.png\",\n \"https://example.com/image2.png\"\n ],\n \"prompt\": \"The jar in image 1 is filled with capsules exactly same as image 2\",\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image")
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 \"input_urls\": [\n \"https://example.com/image1.png\",\n \"https://example.com/image2.png\"\n ],\n \"prompt\": \"The jar in image 1 is filled with capsules exactly same as image 2\",\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\"\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>"
}画像生成 - Flux2
Flux2 Pro Image to Image
Flux 2 Pro モデルを使用した高品質画像編集(非同期)
POST
/
generate
/
k
/
flux2-pro-image-to-image
Flux 2 Pro 画像から画像
curl --request POST \
--url https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input_urls": [
"https://example.com/image1.png",
"https://example.com/image2.png"
],
"prompt": "The jar in image 1 is filled with capsules exactly same as image 2",
"aspect_ratio": "auto",
"resolution": "1K"
}
'import requests
url = "https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image"
payload = {
"input_urls": ["https://example.com/image1.png", "https://example.com/image2.png"],
"prompt": "The jar in image 1 is filled with capsules exactly same as image 2",
"aspect_ratio": "auto",
"resolution": "1K"
}
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({
input_urls: ['https://example.com/image1.png', 'https://example.com/image2.png'],
prompt: 'The jar in image 1 is filled with capsules exactly same as image 2',
aspect_ratio: 'auto',
resolution: '1K'
})
};
fetch('https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image', 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/flux2-pro-image-to-image",
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([
'input_urls' => [
'https://example.com/image1.png',
'https://example.com/image2.png'
],
'prompt' => 'The jar in image 1 is filled with capsules exactly same as image 2',
'aspect_ratio' => 'auto',
'resolution' => '1K'
]),
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/flux2-pro-image-to-image"
payload := strings.NewReader("{\n \"input_urls\": [\n \"https://example.com/image1.png\",\n \"https://example.com/image2.png\"\n ],\n \"prompt\": \"The jar in image 1 is filled with capsules exactly same as image 2\",\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\"\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/flux2-pro-image-to-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input_urls\": [\n \"https://example.com/image1.png\",\n \"https://example.com/image2.png\"\n ],\n \"prompt\": \"The jar in image 1 is filled with capsules exactly same as image 2\",\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/k/flux2-pro-image-to-image")
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 \"input_urls\": [\n \"https://example.com/image1.png\",\n \"https://example.com/image2.png\"\n ],\n \"prompt\": \"The jar in image 1 is filled with capsules exactly same as image 2\",\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\"\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>"
}Flux2 Pro モデルを使用して画像から高品質な画像を生成します。
承認
API Tokenを使用して認証を行ってください
ボディ
application/json
Task parameters
入力画像URLリスト(必須、1-8枚の画像)
Required array length:
1 - 8 elements例:
[
"https://example.com/image1.png",
"https://example.com/image2.png"
]
プロンプト(必須、3-5000文字)
Required string length:
3 - 5000例:
"The jar in image 1 is filled with capsules exactly same as image 2"
アスペクト比(オプション、デフォルト値 auto)
利用可能なオプション:
1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, auto 例:
"auto"
解像度(オプション、デフォルト値 1K)
利用可能なオプション:
1K, 2K 例:
"1K"
レスポンス
OK
タスクID
例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I