qwen image max 文字转图像
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "qwen-image-max",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "A futuristic laboratory with glowing blue holographic displays and a robotic assistant.",
"negative_prompt": "dark, messy, scary",
"aspect_ratio": "16:9",
"prompt_extend": true,
"seed": 12345678
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "qwen-image-max",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "A futuristic laboratory with glowing blue holographic displays and a robotic assistant.",
"negative_prompt": "dark, messy, scary",
"aspect_ratio": "16:9",
"prompt_extend": True,
"seed": 12345678
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'qwen-image-max',
callback_url: 'https://your-domain.com/api/callback',
input: {
prompt: 'A futuristic laboratory with glowing blue holographic displays and a robotic assistant.',
negative_prompt: 'dark, messy, scary',
aspect_ratio: '16:9',
prompt_extend: true,
seed: 12345678
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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.crun.ai/api/v1/client/job/CreateTask",
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([
'model' => 'qwen-image-max',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'prompt' => 'A futuristic laboratory with glowing blue holographic displays and a robotic assistant.',
'negative_prompt' => 'dark, messy, scary',
'aspect_ratio' => '16:9',
'prompt_extend' => true,
'seed' => 12345678
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"qwen-image-max\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"A futuristic laboratory with glowing blue holographic displays and a robotic assistant.\",\n \"negative_prompt\": \"dark, messy, scary\",\n \"aspect_ratio\": \"16:9\",\n \"prompt_extend\": true,\n \"seed\": 12345678\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"qwen-image-max\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"A futuristic laboratory with glowing blue holographic displays and a robotic assistant.\",\n \"negative_prompt\": \"dark, messy, scary\",\n \"aspect_ratio\": \"16:9\",\n \"prompt_extend\": true,\n \"seed\": 12345678\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"qwen-image-max\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"A futuristic laboratory with glowing blue holographic displays and a robotic assistant.\",\n \"negative_prompt\": \"dark, messy, scary\",\n \"aspect_ratio\": \"16:9\",\n \"prompt_extend\": true,\n \"seed\": 12345678\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}{
"code": 422,
"message": "Missing Params or Type Error",
"errors": [
"specific error field message"
]
}Qwen Image Max
Qwen Image Max - 文生图
相比 Plus 系列,Qwen Image Max 系列提升了图像真实感与自然度,可有效减少 AI 合成痕迹,并在人物质感、纹理细节和文字渲染等方面表现突出。
POST
/
api
/
v1
/
client
/
job
/
CreateTask
qwen image max 文字转图像
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "qwen-image-max",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "A futuristic laboratory with glowing blue holographic displays and a robotic assistant.",
"negative_prompt": "dark, messy, scary",
"aspect_ratio": "16:9",
"prompt_extend": true,
"seed": 12345678
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "qwen-image-max",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "A futuristic laboratory with glowing blue holographic displays and a robotic assistant.",
"negative_prompt": "dark, messy, scary",
"aspect_ratio": "16:9",
"prompt_extend": True,
"seed": 12345678
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'qwen-image-max',
callback_url: 'https://your-domain.com/api/callback',
input: {
prompt: 'A futuristic laboratory with glowing blue holographic displays and a robotic assistant.',
negative_prompt: 'dark, messy, scary',
aspect_ratio: '16:9',
prompt_extend: true,
seed: 12345678
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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.crun.ai/api/v1/client/job/CreateTask",
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([
'model' => 'qwen-image-max',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'prompt' => 'A futuristic laboratory with glowing blue holographic displays and a robotic assistant.',
'negative_prompt' => 'dark, messy, scary',
'aspect_ratio' => '16:9',
'prompt_extend' => true,
'seed' => 12345678
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"qwen-image-max\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"A futuristic laboratory with glowing blue holographic displays and a robotic assistant.\",\n \"negative_prompt\": \"dark, messy, scary\",\n \"aspect_ratio\": \"16:9\",\n \"prompt_extend\": true,\n \"seed\": 12345678\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"qwen-image-max\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"A futuristic laboratory with glowing blue holographic displays and a robotic assistant.\",\n \"negative_prompt\": \"dark, messy, scary\",\n \"aspect_ratio\": \"16:9\",\n \"prompt_extend\": true,\n \"seed\": 12345678\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"qwen-image-max\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"A futuristic laboratory with glowing blue holographic displays and a robotic assistant.\",\n \"negative_prompt\": \"dark, messy, scary\",\n \"aspect_ratio\": \"16:9\",\n \"prompt_extend\": true,\n \"seed\": 12345678\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}{
"code": 422,
"message": "Missing Params or Type Error",
"errors": [
"specific error field message"
]
}查询任务状态
提交任务后,使用统一查询端点查看进度并获取结果:获取任务信息
了解如何查询任务状态及获取生成结果
对于生产环境,我们建议在创建任务时使用
callback_url 参数,以便在生成完成时自动接收通知,而非持续轮询状态端点。相关资源
模型概览
探索所有可用模型
通用 API
查询账户剩余积分
授权
所有 API 均需通过 API Key 进行身份验证。
获取 API Key:
- 访问 API Key 管理页面 获取您的 API Key
使用方式: 将以下内容添加至请求头:
x-api-key: YOUR_API_KEY
注意事项:
- 请妥善保管您的 API Key,切勿与他人共享
- 若怀疑 API Key 已泄露,请立即在管理页面进行重置
请求体
application/json
用于生成的模型名称,必填字段。
- 使用本端点时必须填写
qwen-image-max
可用选项:
qwen-image-max Qwen Image Max 文字转图像生成任务的输入参数
Show child attributes
Show child attributes
可选。用于接收任务完成通知的回调 URL。
- 生成完成后,系统将以 POST 方式向该 URL 推送任务状态与结果
- 回调数据结构与任务状态查询接口返回的
data对象一致 - 您的回调端点需支持接收包含结果的 JSON 格式 POST 请求
- 成功接收后需返回 HTTP 200 状态码
示例:
"https://your-domain.com/api/callback"
响应
请求成功
响应状态码
- 200: 成功 - 请求已成功处理
- 401: 未授权 - 身份凭证缺失或无效
- 402: 额度不足 - 账户余额不足以完成本次操作
- 404: 未找到 - 请求的资源或端点不存在
- 422: 验证错误 - 请求参数未通过验证
- 429: 请求限速 - 该资源的请求次数已超出限制
- 455: 服务不可用 - 系统正在维护中
- 500: 服务器错误 - 处理请求时发生意外错误
- 501: 生成失败 - 内容生成任务失败
- 505: 功能已禁用 - 所请求的功能当前已被禁用
可用选项:
200, 401, 402, 404, 422, 429, 455, 500, 501, 505 响应消息,失败时为错误描述
示例:
"success"
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I
