curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"prompt": "<string>",
"n": 3,
"negative_prompt": "<string>",
"prompt_extend": true,
"seed": 1073741823,
"size": "<string>"
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0"
payload = {
"images": ["<string>"],
"prompt": "<string>",
"n": 3,
"negative_prompt": "<string>",
"prompt_extend": True,
"seed": 1073741823,
"size": "<string>"
}
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>',
n: 3,
negative_prompt: '<string>',
prompt_extend: true,
seed: 1073741823,
size: '<string>'
})
};
fetch('https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0', 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-2.0",
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>',
'n' => 3,
'negative_prompt' => '<string>',
'prompt_extend' => true,
'seed' => 1073741823,
'size' => '<string>'
]),
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-2.0"
payload := strings.NewReader("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"n\": 3,\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"size\": \"<string>\"\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-2.0")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"n\": 3,\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0")
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 \"n\": 3,\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"size\": \"<string>\"\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>"
}Qwen Image 2.0
Qwen Image 2.0 accelerated model, supports text-to-image and image editing with flexible resolution and multi-image output (1-6 images).
curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"prompt": "<string>",
"n": 3,
"negative_prompt": "<string>",
"prompt_extend": true,
"seed": 1073741823,
"size": "<string>"
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0"
payload = {
"images": ["<string>"],
"prompt": "<string>",
"n": 3,
"negative_prompt": "<string>",
"prompt_extend": True,
"seed": 1073741823,
"size": "<string>"
}
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>',
n: 3,
negative_prompt: '<string>',
prompt_extend: true,
seed: 1073741823,
size: '<string>'
})
};
fetch('https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0', 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-2.0",
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>',
'n' => 3,
'negative_prompt' => '<string>',
'prompt_extend' => true,
'seed' => 1073741823,
'size' => '<string>'
]),
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-2.0"
payload := strings.NewReader("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"n\": 3,\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"size\": \"<string>\"\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-2.0")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n \"<string>\"\n ],\n \"prompt\": \"<string>\",\n \"n\": 3,\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"size\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/qwen-image-2.0")
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 \"n\": 3,\n \"negative_prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"size\": \"<string>\"\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>"
}- Free Resolution - Supports flexible width and height, total pixels between 512x512 and 2048x2048
- Multi-Image Output - Generate 1-6 images per request
- Text-to-Image & Image Editing - Supports both text-to-image generation and image editing modes
Authorizations
Please use your API Token for authentication
Body
Task parameters
Input image list (optional, 0-3 images, for image editing mode) Omit for text-to-image mode, provide for image editing mode
3Prompt (required, max 800 characters)
1 - 800Number of output images (optional, 1-6, default 1)
1 <= x <= 6Negative prompt (optional, max 500 characters)
500Enable smart prompt rewriting (optional, default true)
Random seed (optional, range 0-2147483647)
0 <= x <= 2147483647Image size (optional, default 20482048) qwen-image-2.0 supports flexible dimensions, total pixels between 512512 and 20482048 Recommended resolutions: 26881536(16:9) 15362688(9:16) 20482048(1:1) 23681728(4:3) 17282368(3:4)
Response
OK
Task ID
"01234567-89ab-cdef-0123-456789abcdef"