輸出解析度
支援公開 endpoint 架構中的 1k, 2k。
curl -X POST https://runapi.ai/api/v1/qwen_3/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-3-text-to-image",
"prompt": "生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。"
}'
import { Qwen3Client } from "@runapi.ai/qwen-3";
const client = new Qwen3Client();
const result = await client.textToImage.run({
model: "qwen-3-text-to-image",
prompt: "生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/qwen_3/text_to_image",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"qwen-3-text-to-image","prompt":"生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/qwen_3/text_to_image");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'qwen-3-text-to-image',
'prompt' => '生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToImage().run({"model":"qwen-3-text-to-image","prompt":"生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。"});
task.waitForResult();
require "runapi/qwen_3"
client = RunApi::Qwen3::Client.new
result = client.text_to_image.run(
model: "qwen-3-text-to-image",
prompt: "生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToImage.Run({"model":"qwen-3-text-to-image","prompt":"生成一張 4K 產品主視覺圖:啞黑色水瓶置於米色石材表面,柔和側光。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model qwen-3-text-to-image \
--endpoint text_to_image \
--wait
4 個版本可用
選擇任一模型,幾秒內即可開始生成。
| 提供者 | Alibaba |
| 模型 ID | qwen-3-text-to-image |
| 模態 | Image |
| 任務類型 | Asynchronous |
| API 端點 | /api/v1/qwen_3/text_to_image |
| 計費單位 | call |
| 輸入參數 | aspect_ratio, callback_url, enable_prompt_expansion, enable_safety_checker, model, negative_prompt, output_format, output_resolution, prompt, seed |
| 最大解析度 | 1k, 2k |
| 長寬比 | 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9 |
| 輸出格式 | png, jpeg |
| 目錄狀態 | 可直接上線 |
免費註冊後,從控制台建立 qwen-3-text-to-image 的 API 金鑰。
向 /api/v1/qwen_3/text_to_image 傳送 POST 請求,並傳入 qwen-3-text-to-image 模型 ID 與參數。
輪詢工作或依照回呼取得已完成的 qwen-3-text-to-image 結果。
支援公開 endpoint 架構中的 1k, 2k。
可設定 8 個已記錄的參數,包括 aspect_ratio, enable_prompt_expansion, enable_safety_checker, negative_prompt, output_format。
公開 1 個公共 endpoint:text_to_image。
非同步任務接受回呼 URL 以接收完成通知。
seedInteger seed for reproducible results.
promptImage generation prompt.
aspect_ratioOutput aspect ratio. (1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9)
callback_urlWebhook URL for asynchronous task updates.
output_formatOutput image format. (png, jpeg)
negative_promptContent to avoid in the generated image.
output_resolutionOutput image resolution. (1k, 2k)
enable_safety_checkerWhether RunAPI checks generated content for safety.
enable_prompt_expansionWhether RunAPI expands the prompt before generation.
為缺少棚拍照片的電商型錄,自動生成生活風格產品照片。
在定稿前快速發想場景與角色概念。
大規模生成部落格文章與專欄所需的獨特封面與插圖。
傳入 quickstart 顯示的 model ID。
每個金鑰的速率限制會依使用方案而調整。請查看定價頁面以了解目前限制。
可以——variant 只是旗標。只要變更 model 參數即可切換。
只要支援串流,RunAPI 就會端到端串流。
請在公開 GitHub repo 提交 issue,或寄信給支援。