HERMES + QWEN 2 IMAGE

Hermes Agent で Qwen 2 Image を使う。

Qwen 2 Image は Alibaba の画像生成・編集モデルです。Hermes Agent は RunAPI カスタムプロバイダーエンドポイントを通じて呼び出します。プロンプトを送るだけで画像 URL が返ってきます。テキストから画像、画像編集、画像リミックスの 3 つのモデルバリアントをサポートしています。

1 つの API キー · テキストから画像エンドポイント · 非同期タスクポーリング
Use RunAPI to generate an image with Qwen 2 Image.

Requirements:
- Call the RunAPI text_to_image endpoint at https://runapi.ai/api/v1/task/text_to_image.
- Set the model to "qwen-2-text-to-image".
- Read the API key from the RUNAPI_API_KEY environment variable.
- Use the custom:runapi provider configured in Hermes Agent.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the image URL from the output.
- For image editing, use model "qwen-2-edit-image" and include an image_url field.
- For remixing, use model "qwen-2-remix-image" and include an image_url field.
curl -X POST https://runapi.ai/api/v1/task/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-2-text-to-image",
    "prompt": "A traditional Chinese ink painting of misty mountains at dawn, elegant brushwork"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "qwen-2-text-to-image"
}
curl コマンドをコピーしてテスト qwen-2
仕組み

3 ステップで Hermes Agent で Qwen 2 Image を使う

1

RunAPI を設定する

RunAPI API キーを環境変数として設定します。まだ Hermes Agent カスタムプロバイダーとして RunAPI を追加していない場合は、Hermes Agent セットアップガイドに従って custom:runapi を base_url https://runapi.ai/v1 で追加します。

export RUNAPI_API_KEY=runapi_xxx
2

Qwen 2 Image を呼び出す

プロンプトを Hermes Agent に貼り付けるか、text_to_image エンドポイントを直接呼び出します。生成には qwen-2-text-to-image、編集には qwen-2-edit-image、リミックスには qwen-2-remix-image を model フィールドに設定します。

text_to_image
3

結果を取得する

エンドポイントはタスク ID を返します。ステータスが completed に変わるまでタスクステータスエンドポイントをポーリングし、出力から画像 URL を読み取ります。RunAPI SDK は自動的にポーリングを処理します。

task_id: tsk_abc123
パラメーター

Qwen 2 Image API パラメーター

パラメータ 説明
model string 必須。qwen-2-text-to-image、qwen-2-edit-image、または qwen-2-remix-image。
prompt string テキスト説明または編集指示。
image_url string 編集またはリミックスモード用のソース画像。
size string 省略可。出力サイズ。

Hermes AgentのQwen 2 Imageとは?

Qwen 2 ImageはAlibaba製の画像モデルで、1つのAPIで生成・編集・リミックスの3モードを提供します。Hermes Agentはcustom:runapi provider経由で呼び出します。複雑なマルチオブジェクトシーンを処理し、中国語・英語・混合言語プロンプトをネイティブに理解するため、多言語コンテンツパイプラインに特に有用です。

Qwen 2 Imageの活用例

agentワークフローでの反復的画像編集

1回のHermes Agentの実行で複数のQwen 2編集ステップを連結します——初期画像を生成してから背景の差し替え・色調調整・要素追加などのテキストガイドによる変更を順番に適用します。

スタートアップ向けコスト効率的な画像生成

Qwen 2 Imageを、商品モックアップ・SNSコンテンツ・開発時のプレースホルダーアートなどの大量画像生成タスクに対するコスト効率的な選択肢として活用します。

バイリンガルコンテンツ制作

翻訳なしに中英プロンプトから画像を生成し、単一ワークフローでバイリンガルマーケティングキャンペーンやローカライズされた商品ページのビジュアルを制作します。

FAQ

Qwen 2 Image + Hermes Agent よくある質問

Hermes Agent 全般セットアップ

まだ設定していませんか?Hermes Agent の RunAPI セットアップガイドから始めてください。

Hermes Agent セットアップガイド →

Qwen 2 Image モデルカタログ

Qwen 2 Image の全バリアント、料金、API ドキュメントを確認します。

Qwen 2 Image モデル →

今すぐ Hermes Agent で Qwen 2 Image を試す。

無料の RunAPI キーを取得し、プロンプトを Hermes Agent に貼り付けて生成を始めましょう。