出力解像度
公開 endpoint スキーマから 1k, 2k をサポートしています。
最大 10 枚の元画像とマスク編集に対応する Qwen 2.1 画像編集
curl -X POST https://runapi.ai/api/v1/qwen_2_1/edit_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-2.1-edit-image",
"source_image_urls": [
"https://cdn.runapi.ai/public/samples/image.jpg"
],
"prompt": "このモデルで本番向けの結果を作成してください。"
}'
import { Qwen21Client } from "@runapi.ai/qwen-2-1";
const client = new Qwen21Client();
const result = await client.editImage.run({
model: "qwen-2.1-edit-image",
source_image_urls: ["https://cdn.runapi.ai/public/samples/image.jpg"],
prompt: "このモデルで本番向けの結果を作成してください。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/qwen_2_1/edit_image",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"qwen-2.1-edit-image","source_image_urls":["https://cdn.runapi.ai/public/samples/image.jpg"],"prompt":"このモデルで本番向けの結果を作成してください。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/qwen_2_1/edit_image");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'qwen-2.1-edit-image',
'source_image_urls' => ['https://cdn.runapi.ai/public/samples/image.jpg'],
'prompt' => 'このモデルで本番向けの結果を作成してください。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.editImage().run({"model":"qwen-2.1-edit-image","source_image_urls":["https://cdn.runapi.ai/public/samples/image.jpg"],"prompt":"このモデルで本番向けの結果を作成してください。"});
task.waitForResult();
require "runapi/qwen_2_1"
client = RunApi::Qwen21::Client.new
result = client.edit_image.run(
model: "qwen-2.1-edit-image",
source_image_urls: ["https://cdn.runapi.ai/public/samples/image.jpg"],
prompt: "このモデルで本番向けの結果を作成してください。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.editImage.Run({"model":"qwen-2.1-edit-image","source_image_urls":["https://cdn.runapi.ai/public/samples/image.jpg"],"prompt":"このモデルで本番向けの結果を作成してください。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model qwen-2.1-edit-image \
--endpoint edit_image \
--wait
2 個のバージョンを利用可能
| プロバイダー | Alibaba |
| モデル ID | qwen-2.1-edit-image |
| モダリティ | 画像 |
| タスク種別 | Asynchronous |
| API エンドポイント | /api/v1/qwen_2_1/edit_image |
| 請求単位 | 回 |
| 入力パラメータ | aspect_ratio, background, callback_url, enable_prompt_expansion, mask_url, model, output_format, output_resolution, prompt, seed, source_image_urls |
| 最大解像度 | 1k, 2k |
| アスペクト比 | auto, 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, 9:21 |
| 出力形式 | png, webp, jpeg |
| カタログ状態 | 近日公開 |
無料で登録し、ダッシュボードから qwen-2.1-edit-image 用の API キーを作成します。
/api/v1/qwen_2_1/edit_image に qwen-2.1-edit-image のモデル ID とパラメータを指定して POST リクエストを送信します。
タスクをポーリングするかコールバックに従って、完了した qwen-2.1-edit-image の結果を取得します。
公開 endpoint スキーマから 1k, 2k をサポートしています。
aspect_ratio, background, enable_prompt_expansion, mask_url, output_format を含む 9 個のドキュメント済みパラメータを設定できます。
1 個の公開 endpoint を提供しています: edit_image。
非同期タスクはコールバック URL を受け付け、完了通知を送信します。
seedInteger seed for reproducible results; omit for a random seed.
promptImage editing prompt. With mask_url, describes what to generate inside the white area of the mask.
mask_urlPublic mask image URL for local editing: white marks the area to change, black is kept. Requires exactly one source image and cannot be combined with a transparent background; aspect_ratio and enable_prompt_expansion are ignored.
backgroundBackground type. A transparent background requires output_format png or webp and cannot be combined with mask_url; describe only the subject in the prompt. (opaque, transparent)
aspect_ratioOutput aspect ratio. auto follows the first source image. Ignored when mask_url is set. (auto, 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, 9:21)
callback_urlWebhook URL for asynchronous task updates.
output_formatOutput image format. jpeg cannot be combined with a transparent background. (png, webp, jpeg)
output_resolutionOutput image resolution. (1k, 2k)
source_image_urlsPublic source image URLs; one to ten images, in the order the prompt refers to them.
enable_prompt_expansionWhether RunAPI expands the prompt before generation. Ignored when mask_url is set.
テキスト prompt からビジュアルアセットを作成します。
prompt に沿って既存画像を変換します。
SDK で再現可能な生成を行います。
quickstart に表示されるモデル ID を渡してください。
はい。呼び出しまたは単位ごとの従量課金です。
はい。variant はリクエストのパラメーターです。model ID を変更するだけで切り替えられ、コード変更、再認証、別の請求設定は不要です。全 variant が同じ API key とリクエスト形式を共有します。
streaming が利用可能な場合、RunAPI はエンドツーエンドで配信します。LLM モデルは token 単位の streaming に対応し、メディアモデルは非同期タスクの polling または webhook callback で結果を届けます。
公開 GitHub repo に issue を作成するか、[email protected] にメールしてください。該当する生成を調査できるよう task ID と model ID を添えてください。
いいえ。RunAPI API key だけでこの variant とカタログ内の全モデルを利用できます。提供元のアカウントは不要です。