通义万相图像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/qwen-image-plus \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"prompt": "<string>",
"negative_prompt": "<string>",
"prompt_extend": true,
"seed": 1073741823
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/qwen-image-plus"
payload = {
"images": ["<string>"],
"prompt": "<string>",
"negative_prompt": "<string>",
"prompt_extend": True,
"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>',
negative_prompt: '<string>',
prompt_extend: true,
seed: 1073741823
})
};
fetch('https://api.sinancode.com/v1/generate/bailian/qwen-image-plus', 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/qwen-image-plus",
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>',
'negative_prompt' => '<string>',
'prompt_extend' => true,
'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/qwen-image-plus"
payload := strings.NewReader("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\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/qwen-image-plus")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/qwen-image-plus")
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 \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\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>"
}{
"error_code": "<string>",
"message": "<string>"
}图片生成 - 千问
通义千问 图片编辑
阿里百炼通义万相图像生成模型,支持文生图和图片编辑两种模式。不传 images 参数为文生图模式,传入 images 参数(最多3张)为图片编辑模式。
POST
/
generate
/
bailian
/
qwen-image-plus
通义万相图像生成
curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/qwen-image-plus \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"prompt": "<string>",
"negative_prompt": "<string>",
"prompt_extend": true,
"seed": 1073741823
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/qwen-image-plus"
payload = {
"images": ["<string>"],
"prompt": "<string>",
"negative_prompt": "<string>",
"prompt_extend": True,
"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>',
negative_prompt: '<string>',
prompt_extend: true,
seed: 1073741823
})
};
fetch('https://api.sinancode.com/v1/generate/bailian/qwen-image-plus', 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/qwen-image-plus",
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>',
'negative_prompt' => '<string>',
'prompt_extend' => true,
'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/qwen-image-plus"
payload := strings.NewReader("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\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/qwen-image-plus")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/qwen-image-plus")
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 \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\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>"
}{
"error_code": "<string>",
"message": "<string>"
}使用阿里云通义千问-图像编辑模型 (qwen-image-edit-plus) 进行图片编辑。
模型特点:
- 多图输入输出 - 支持多图输入和多图输出
- 文字修改 - 精确修改图内文字
- 物体操作 - 增删或移动物体,改变主体动作
- 风格迁移 - 迁移图片风格及增强画面细节
授权
请使用您的 API Token 进行认证
请求体
application/json
任务参数
输入图片列表(可选,0-3张图片,用于图片编辑模式) 不传则为文生图模式,传入则为图片编辑模式
Maximum array length:
3正向提示词(必填,最大 800 字符)
Required string length:
1 - 800负向提示词(可选,最大 500 字符)
Maximum string length:
500启用提示词智能改写(可选,默认 true)
随机种子(可选,范围 0-2147483647)
必填范围:
0 <= x <= 2147483647图片尺寸(可选,默认 13281328) 可选值:1664928, 14721140, 13281328, 11401472, 9281664
可用选项:
1664*928, 1472*1140, 1328*1328, 1140*1472, 928*1664 响应
OK
Task ID
示例:
"01234567-89ab-cdef-0123-456789abcdef"
⌘I