Hermes Agent で GPT Image を使う。
GPT Image 2 は OpenAI の専用画像生成モデルです——テキスト→画像と指示ベースの画像編集に対応し、出力解像度は最大 4K、透明背景もサポートします。Hermes Agent は、チャットで使うのと同じ RunAPI custom プロバイダーと API キーで呼び出し、ComfyUI や GPU のセットアップは不要です。
RunAPI を使って Hermes Agent から OpenAI GPT Image 2 で画像を生成します。
要件:
- https://runapi.ai/v1/text_to_image の RunAPI API を使用します。
- RUNAPI_API_KEY 環境変数から API キーを読み込みます。
- Hermes Agent ですでに設定済みの custom:runapi プロバイダーを使用します。
- model を "gpt-image-2-text-to-image" に設定します。
- 説明的な prompt を書きます。GPT Image 2 は自然言語の指示に忠実に従います——レイアウト、スタイル、テキストオーバーレイ、透明度の要件を記述します。
- 任意で output_resolution を 1k、2k、または 4k に設定します。デフォルトは 1k です。
- レスポンスは task_id を返します。タスクが完了するまでタスクステータスエンドポイントをポーリングし、出力 URL を取得します。
curl -X POST https://runapi.ai/v1/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-text-to-image",
"prompt": "A product photo of a glass perfume bottle on a marble surface, transparent background, studio lighting, the label reads AURORA in gold serif font",
"output_resolution": "2k",
"aspect_ratio": "3:4"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "gpt-image-2-text-to-image"
}
Hermes Agent で GPT Image を使う3ステップ
Configure RunAPI
Set the RUNAPI_API_KEY environment variable in your shell profile. If the custom:runapi provider is already configured in Hermes Agent for chat, the same key and base_url work for GPT Image — no additional setup needed.
export RUNAPI_API_KEY=runapi_xxx
Call GPT Image 2
Send a POST request to the text_to_image endpoint with model set to gpt-image-2-text-to-image. Include a descriptive prompt with layout and style instructions. Set output_resolution to 2k or 4k for higher detail. For editing existing images, use the edit_image endpoint with gpt-image-2-image-to-image and provide source_image_urls.
POST /v1/text_to_image
Get the result
The API returns a task_id immediately. Poll the task status endpoint until the status changes to completed, then retrieve the output image URL from the response. GPT Image 2 typically completes within 10–30 seconds depending on resolution.
task_id: tsk_abc123
GPT Image API パラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
model |
string |
Required. gpt-image-2-text-to-image for generation, gpt-image-2-image-to-image for editing. |
prompt |
string |
Required. Natural language description of the desired image. Supports detailed instructions for layout, text overlays, and style. |
output_resolution |
string |
Optional. Output resolution — 1k (default), 2k, or 4k. Higher resolution costs more per image. |
aspect_ratio |
string |
Optional. Defaults to auto. Supports 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, and more. |
source_image_urls |
array |
Required for edit_image endpoint. One or more URLs of source images to edit. |
Hermes AgentのGPT Imageとは?
GPT Image 2はプロンプトをキーワードリストではなく制作ブリーフとして扱います。生成前に推論ステップを含み、レイアウト・テキスト配置・コンポジションの構造化された指示に従うのに役立ちます。Hermes AgentはRunAPI custom provider経由で呼び出します。
GPT Imageの活用例
構造化プロンプトによるバッチ画像生成
Hermes Agentを通じて構造化デザインブリーフをバッチ処理し、商品カタログ・マーケティングキャンペーン・コンテンツシリーズの画像を生成し、GPT Image 2が各ブリーフのレイアウトとスタイル仕様に厳密に従います。
マルチモーダルコンテンツパイプライン
GPT Image 2をGPTテキストモデルと連結します——まずGPTで詳細なデザインブリーフを生成し、次にGPT Image 2で生成を実行して、ビジュアル出力がコンテンツ戦略と密接に整合するようにします。
透明アセットのブランドスイート生成
透明背景付きのブランドアセット——アイコン・バッジ・UI要素——を生成し、デザインワークフローやHermes Agentのダウンストリームステップで直接合成できます。
GPT Image + Hermes Agent のよくある質問
Yes. Hermes Agent calls GPT Image 2 through the RunAPI text_to_image endpoint. Set the model field to gpt-image-2-text-to-image and send the request with the same RUNAPI_API_KEY you configured for the custom:runapi provider. No ComfyUI or GPU rental required.
GPT Image 2 is OpenAI's dedicated image generation model with higher quality, 4K output, and transparent background support. GPT-4o Image generates images within a chat context but is limited to 1:1, 3:2, or 2:3 aspect ratios. Both are available through RunAPI — use gpt-image-2-text-to-image for standalone generation and gpt-4o-image for chat-integrated image output.
GPT Image 2 is billed per image by output resolution: 1k, 2k, or 4k. GPT-4o Image is billed per image by output count — generating 2 or 4 images in a single request costs more per image. Both use pay-as-you-go billing with no monthly minimum. Check the RunAPI pricing page for current rates.
Yes. Use the edit_image endpoint with model set to gpt-image-2-image-to-image. Pass source images in source_image_urls and describe the edit in natural language — "remove the background," "add sunglasses," "change the text to HELLO." No ComfyUI workflow graphs, no GPU instance, no inpainting masks needed.
It can degrade. Users report that repeated refinement passes sometimes introduce noise patterns or shading degradation. For best results, be specific in the first prompt rather than planning on iterative refinement. If you need multi-step editing, consider using Flux Kontext for the refinement stage.
Yes. Hermes Agent can generate an image with GPT Image 2, upscale it with Topaz, or pass it to Flux Kontext for further editing. All models share the same RunAPI key and the agent handles the chaining.
今すぐ Hermes Agent で GPT Image を試す。
無料の RunAPI キーを取得し、custom:runapi プロバイダーを設定して、OpenAI GPT Image 2 で画像の生成と編集を始めましょう。