Wanx 2.7 画像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/wan27-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"prompt": "<string>",
"seed": 1073741823
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/wan27-image"
payload = {
"images": ["<string>"],
"prompt": "<string>",
"seed": 1073741823
}
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({images: ['<string>'], prompt: '<string>', seed: 1073741823})
};
fetch('https://api.sinancode.com/v1/generate/bailian/wan27-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/bailian/wan27-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([
'images' => [
'<string>'
],
'prompt' => '<string>',
'seed' => 1073741823
]),
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/bailian/wan27-image"
payload := strings.NewReader("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"seed\": 1073741823\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/bailian/wan27-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"seed\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/wan27-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 \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"seed\": 1073741823\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>"
}画像生成 - Wan2
万相 2.7 画像生成
Wanx 2.7 画像生成・編集モデル、テキストから画像生成と画像編集に対応。imagesを省略するとテキストから画像生成モード、images(最大9枚)を指定すると画像編集モード。
POST
/
generate
/
bailian
/
wan27-image
Wanx 2.7 画像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/wan27-image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"prompt": "<string>",
"seed": 1073741823
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/wan27-image"
payload = {
"images": ["<string>"],
"prompt": "<string>",
"seed": 1073741823
}
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({images: ['<string>'], prompt: '<string>', seed: 1073741823})
};
fetch('https://api.sinancode.com/v1/generate/bailian/wan27-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/bailian/wan27-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([
'images' => [
'<string>'
],
'prompt' => '<string>',
'seed' => 1073741823
]),
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/bailian/wan27-image"
payload := strings.NewReader("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"seed\": 1073741823\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/bailian/wan27-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"seed\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/wan27-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 \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"seed\": 1073741823\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>"
}アリババクラウドの万相 2.7 画像生成・編集モデルを使用して画像を生成します。
モデルの特徴:
- テキストから画像&画像編集 - テキストから画像生成と画像編集の両方をサポート(最大9枚の参照画像)
- 高解像度 - 1K と 2K の出力解像度をサポート
- 長文プロンプト - 最大 5000 文字のプロンプトをサポート
承認
API Tokenを使用して認証を行ってください
ボディ
application/json
タスクパラメータ
入力画像 URL リスト(オプション、0-9枚、画像編集モード用) 省略するとテキストから画像生成モード、指定すると画像編集モード
Maximum array length:
9プロンプト(必須、最大 5000 文字)
Required string length:
1 - 5000ランダムシード(オプション、範囲 0-2147483647)
必須範囲:
0 <= x <= 2147483647出力解像度(オプション、デフォルト 2K) wan2.7-image は 1K、2K に対応
利用可能なオプション:
1K, 2K レスポンス
OK
タスクID
例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I