OpenClaw で Flux 2 を使う。
Black Forest Labs の Flux 2 は2つの品質層を提供します——Pro は1枚あたり5セントで高速かつ手頃な生成を、Flex はより高い忠実度の出力を実現します。どちらもテキスト→画像とマルチソース remix に対応し、解像度は 1k または 2k を選べます。OpenClaw agent は、チャットで使うのと同じ RunAPI キーで呼び出します。
RunAPI を使って Flux 2 Pro で画像を生成します。
要件:
- https://runapi.ai/v1/text_to_image の RunAPI text_to_image エンドポイントを呼び出します
- model を "flux-2-pro-text-to-image" に設定します
- 認可には RUNAPI_API_KEY 環境変数を使用します
- 任意で output_resolution を "1k" または "2k" に、aspect_ratio で寸法を制御します
- レスポンスは非同期です——タスクが完了するまでタスクステータスエンドポイントをポーリングし、画像 URL を取得します
curl -X POST https://runapi.ai/v1/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-pro-text-to-image",
"prompt": "a ceramic vase with dried flowers on a linen tablecloth, natural window light, 35mm film grain",
"aspect_ratio": "3:4",
"output_resolution": "2k"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "flux-2-pro-text-to-image"
}
OpenClaw で Flux 2 を使う3ステップ
Configure RunAPI
Set the RUNAPI_API_KEY environment variable. If you already configured RunAPI as an OpenClaw provider for chat, the same key works for Flux 2 image generation — no extra setup needed.
export RUNAPI_API_KEY=runapi_xxx
Call Flux 2
Send a POST request to the text_to_image endpoint with model set to flux-2-pro-text-to-image. Include a prompt, and optionally set aspect_ratio (1:1, 4:3, 16:9, etc.) and output_resolution (1k or 2k). For multi-source remixing, use the remix_image endpoint with source_image_urls instead.
text_to_image
Get the result
The endpoint returns a task ID. Poll the task status endpoint until the status changes to completed, then retrieve the generated image URL from the response. RunAPI SDKs and the CLI handle polling automatically.
task_id: tsk_abc123
Flux 2 API パラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
model |
string |
Required. flux-2-pro-text-to-image, flux-2-flex-text-to-image, flux-2-pro-remix-image, or flux-2-flex-remix-image. |
prompt |
string |
Text description of the image to generate. |
aspect_ratio |
string |
Optional. Output aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, or 2:3. Remix endpoints also accept auto. |
output_resolution |
string |
Optional. 1k (default) or 2k. Higher resolution costs more per image. |
source_image_urls |
array |
Required for remix_image. Array of source image URLs to blend or transform. |
callback_url |
string |
Optional. Webhook URL for async completion notification. |
OpenClaw上のFlux 2とは?
Flux 2はBlack Forest Labsによる本番グレードの画像モデルで、素材の忠実度が本物の写真と見分けがつかないレベルです。マルチリファレンスコンディショニングと400万画素出力をサポートし、ファインチューニングなしにブランド一貫性のある結果を得られます。OpenClaw agentはRunAPIのtext_to_imageエンドポイントからチャットと同じAPIキーを使って呼び出します。
Flux 2の活用例
フォトリアルな商品写真
ECカタログ・広告・ブランドコンテンツ向けに本物と見分けがつかない商品写真を生成し、実物撮影が不要で素材忠実度が優れています。
一貫したキャラクターと人物生成
マルチリファレンスコンディショニングを使って一連の画像にわたって同じ外見を維持するブランドアンバサダーやキャラクターを生成し、各出力を手動調整する必要がありません。
高解像度の背景とシーン
細部の精度が大判印刷や動画制作に十分な400万画素出力で映画感のある背景・建築シーン・環境画像を生成します。
Flux 2 + OpenClaw のよくある質問
Pro is the faster, more affordable tier at 5 cents per 1k image. Flex produces higher-fidelity output at 14 cents per 1k image. Both share the same API parameters and support text_to_image and remix_image endpoints.
Users report Flux 2 matches or beats Midjourney on photorealism and material fidelity, with the advantage that it runs through a standard API endpoint rather than a Discord bot. It has caught up on text rendering too, though Ideogram V3 still leads on small-point typography.
Yes. Each variant bills per image with resolution-based pricing. For example, Flux 2 Pro costs 5 cents at 1k and 7 cents at 2k. Flux 2 Flex costs 14 cents at 1k and 24 cents at 2k. Check the RunAPI pricing page for current rates.
Flux Kontext specializes in text-guided editing and character consistency with a single input image. Flux 2 focuses on text-to-image generation and multi-source remixing with Pro/Flex quality tiers and selectable output resolution. Both are by Black Forest Labs and available through the same RunAPI key.
Async. The API returns a task ID immediately. Poll the task status endpoint or set a callback_url webhook to receive the completed image URL. RunAPI SDKs and the CLI handle polling automatically.
今すぐ OpenClaw で Flux 2 を試す。
無料の RunAPI キーを取得し、プロンプトを OpenClaw に貼り付けて、Flux 2 Pro または Flex で画像生成を始めましょう。