一個驗證,對應所有 provider
一組 RunAPI key 即可解鎖整個 catalog。無需分開帳戶,亦無需為每個整合輪換密鑰。
透過 RunAPI 使用 Qwen 2 API,包含 model skill、統一驗證與按用量計費。
curl -X POST https://runapi.ai/api/v1/qwen_2/edit_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-2-text-to-image",
"source_image_url": "https://cdn.runapi.ai/public/samples/image.jpg",
"prompt": "生成一幅等距插畫:溫馨的家中辦公室,暖色燈光,書桌上放有植物。"
}'
import { Qwen2Client } from "@runapi.ai/qwen-2";
const client = new Qwen2Client();
const result = await client.editImage.run({
model: "qwen-2-text-to-image",
source_image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
prompt: "生成一幅等距插畫:溫馨的家中辦公室,暖色燈光,書桌上放有植物。",
});
<?php
require __DIR__ . "/vendor/autoload.php";
use RunApi\Qwen2\Qwen2Client;
$client = new Qwen2Client();
$result = $client->editImage->run([
'model' => 'qwen-2-text-to-image',
'source_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
'prompt' => '生成一幅等距插畫:溫馨的家中辦公室,暖色燈光,書桌上放有植物。',
]);
require "runapi/qwen_2"
client = RunApi::Qwen2::Client.new
result = client.edit_image.run(
model: "qwen-2-text-to-image",
source_image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
prompt: "生成一幅等距插畫:溫馨的家中辦公室,暖色燈光,書桌上放有植物。"
)
npx skills add runapi-ai/qwen-2 -g
# Claude Code
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
# Codex
codex plugin install runapi-mcp@agents
# Cursor / Windsurf / VS Code
npx @runapi.ai/mcp init cursor
Qwen 2 是阿里巴巴的視覺生成模型,支援文字生成圖片及圖片編輯。它以通義萬相為基礎,輸出細節豐富,文字與畫面對應準確。
| Endpoint | 解析度 | 時長 | 價格 | |
|---|---|---|---|---|
| edit_image | — | — | $0.06 / 張圖片 |
以下為 qwen-2-edit-image 的定價。其他變體保留各自的 endpoint 定價。
挑選符合輸出類型、品質門檻與延遲目標的模型與變體。
設定 RunAPI key,並在 coding workspace 安裝 model skill。
使用 skill 指引,在你的 app 內加入模型功能。
透過 task ID 查詢、在支援時串流,或處理 webhook callback。
一組 RunAPI key 即可解鎖整個 catalog。無需分開帳戶,亦無需為每個整合輪換密鑰。
按次以 USD 收費,每月結算。失敗的生成不會收費。
型別化 schema 與 setup 備註打包在 model skill 內,讓實作從正確契約開始。
文字生成圖片及圖片編輯(edit-image)——涵蓋從零生成圖片,以及對來源圖片的指定區域進行編輯。
通義萬相是 Alibaba 的視覺生成平台,為 Qwen 2 提供支援,負責底層的圖片理解及生成能力。
image-edit 端點接受來源圖片及文字指令,對特定區域進行針對性修改,同時保留圖片其餘部分。
能——Qwen 2 具備出色的多語言文字理解能力,包括中文、日文及韓文,適用於 prompt 詮釋及視覺內容。
Qwen 2 同時支援文字生成圖片及圖片編輯,而 Z Image 則專注於快速文字生成圖片。
先選最平而且符合你質素要求的版本。大多數團隊會先用快速版本,之後再升級到 pro 用於正式生產。