Flux 2 Klein API
Black Forest Labs の FLUX.2 [klein] は、リアリズムの向上、よりくっきりした文字生成、高速なカスタマイズのための LoRA 対応を備えた、高品質な4Bと9Bのテキストから画像・編集モデルです。生成と編集の両方に、Base と LoRA のバリアントがあります。
テキストから画像と編集に、4Bと9Bのパラメーター階層があります。LoRA対応のバリアント(text-to-image-lora、edit-lora)で、高速なカスタマイズができます。編集エンドポイントは、自然言語の指示を受け付け、精密な修正ができます。
/filters:quality(82)/examples/171cf1aac2374b34dc5104be9b274f5c/1783683809472857164_TpbltDLU.webp)
概要
Flux 2 Klein APIについて
Flux 2 Kleinでできること、Black Forest Labsのモデルラインナップにおける位置づけ、そして多くのチームに選ばれる理由。
Flux 2 KleinはBlack Forest Labsの画像生成・編集モデルで、WaveSpeedAIのREST APIから利用できます。Black Forest Labs の FLUX.2 [klein] は、リアリズムの向上、よりくっきりした文字生成、高速なカスタマイズのための LoRA 対応を備えた、高品質な4Bと9Bのテキストから画像・編集モデルです。生成と編集の両方に、Base と LoRA のバリアントがあります。
テキストから画像と編集に、4Bと9Bのパラメーター階層があります。LoRA対応のバリアント(text-to-image-lora、edit-lora)で、高速なカスタマイズができます。編集エンドポイントは、自然言語の指示を受け付け、精密な修正ができます。
WaveSpeedAIのFlux 2 Kleinファミリーには、Image-To-Image, Text-To-Imageのワークフローをカバーする16個のRESTエンドポイントがあります。各バリアントには、それぞれ独自の料金、パラメーター、作例があります。入力の種類と本番環境の制約に合うものを選ぶか、同じAPIキーで複数を呼び出して、多段階のパイプラインを組み立ててください。
WaveSpeedAIの他の1,000以上のAIモデルと同じAPIキー、請求アカウント、レート制限の枠組みでFlux 2 Kleinを実行できます。ベンダーごとの設定も、プロバイダーごとのSDKも、ベンダーごとのレート制限も不要です。1つの連携で、テキストから画像、テキストから動画から、音声合成、3D生成、高画質化、編集まで、すべてカバーできます。
エンドポイント
Flux 2 KleinのAPIエンドポイント一覧
WaveSpeedAIで現在利用可能なFlux 2 Kleinのエンドポイントは16個です。ワークフローに合ったバリアントを選んでください。
/filters:quality(82)/media/images/1782719270072146594_r4sCKT3c.webp)
Flux 2 Klein Base 4b Edit Lora
FLUX.2 [klein] Base 4B Edit with LoRA support enables precise image-to-image editing with natural language instructions, multi-reference support, and LoRA customization. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1782719335346716016_SFOX7gpy.webp)
Flux 2 Klein Base 4b Text To Image Lora
FLUX.2 [klein] Base 4B with LoRA support is a compact 4-billion-parameter text-to-image model that delivers fast generation with quality results and LoRA customization. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1782719395763490557_HkV4envE.webp)
Flux 2 Klein Base 4b Edit
FLUX.2 [klein] Base 4B Edit enables precise image-to-image editing with natural language instructions and multi-reference support. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1782719439857315177_L5f7hrBK.webp)
Flux 2 Klein Base 4b Text To Image
FLUX.2 [klein] Base 4B is a compact 4-billion-parameter text-to-image model that delivers fast generation with quality results. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1778817893253269754_jtSluDMW.webp)
Flux 2 Klein Base 9b Edit Lora
FLUX.2 [klein] Base 9B Edit with LoRA support is a high-quality image editing model with 9B parameters, offering precise modifications using natural language instructions and personalized styles via custom LoRA adapters. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1778817876606439425_xAlRlNgH.webp)
Flux 2 Klein Base 9b Text To Image Lora
FLUX.2 [klein] Base 9B with LoRA support is a high-quality text-to-image model with 9B parameters, offering enhanced realism, crisper text generation, and fast LoRA customization. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1778817863672548628_rWNW8fpz.webp)
Flux 2 Klein Base 9b Edit
FLUX.2 [klein] Base 9B Edit is a high-quality image editing model with 9B parameters, offering precise modifications using natural language instructions. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/1778817841762781102_9SipyHR0.webp)
Flux 2 Klein Base 9b Text To Image
FLUX.2 [klein] Base 9B is a high-quality text-to-image model with 9B parameters, offering enhanced realism and crisper text generation. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408105759_4m08lxjt.webp)
Flux 2 Klein 4b Edit Lora
FLUX.2 [klein] 4B Edit with LoRA support enables precise image-to-image editing with natural language instructions, multi-reference support, and LoRA customization. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408105752_entzjhk3.webp)
Flux 2 Klein 4b Text To Image Lora
FLUX.2 [klein] 4B with LoRA support is a compact 4-billion-parameter text-to-image model that delivers fast generation with quality results and LoRA customization. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408110447_b1nzgxbj.webp)
Flux 2 Klein 9b Text To Image Lora
FLUX.2 [klein] 9B with LoRA support is a high-quality text-to-image model with 9B parameters, offering enhanced realism, crisper text generation, and fast LoRA customization. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408110457_1sq5no86.webp)
Flux 2 Klein 9b Edit Lora
FLUX.2 [klein] 9B Edit with LoRA support is a high-quality image editing model with 9B parameters, offering precise modifications using natural language instructions and personalized styles via custom LoRA adapters. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408105808_3tz63pqc.webp)
Flux 2 Klein 4b Edit
FLUX.2 [klein] 4B Edit enables precise image-to-image editing with natural language instructions and multi-reference support. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408110505_n00qc1zm.webp)
Flux 2 Klein 9b Edit
FLUX.2 [klein] 9B Edit is a high-quality image editing model with 9B parameters, offering precise modifications using natural language instructions. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408110512_kl8lhm6d.webp)
Flux 2 Klein 9b Text To Image
FLUX.2 [klein] 9B is a high-quality text-to-image model with 9B parameters, offering enhanced realism and crisper text generation. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
/filters:quality(82)/media/images/20260408105817_vfnx9s7f.webp)
Flux 2 Klein 4b Text To Image
FLUX.2 [klein] 4B is a compact 4-billion-parameter text-to-image model that delivers fast generation with quality results. Ready-to-use REST inference API, best performance, no cold starts, affordable pricing.
作例
Flux 2 Kleinの実力を見る
Flux 2 Klein APIで実際に生成された出力です。動画にカーソルを合わせるとプレビュー、クリックすると原寸のビューアで開きます。
使い方
Flux 2 Klein APIの使い方
登録から生成完了まで4ステップ。Python、Node.js、cURLの完全なサンプルは、下のAPIセクションにあります。
- 01
APIキーを取得
WaveSpeedAIのアカウントに登録し、ダッシュボードからAPIキーをコピーします。新規アカウントには無料のスタータークレジットが付くので、課金が始まる前にプレイグラウンドを数十回実行できます。
- 02
予測を送信
入力をJSONとしてhttps://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-imageにPOSTします。エンドポイントはすぐに予測IDを返します。生成は非同期なので、推論中に接続を開いたままにする必要はありません。
- 03
完了までポーリング
https://api.wavespeed.ai/api/v3/predictions/{request_id}/resultにGETします。completedなら出力を返し、failed、cancelled、timeout、deletedならエラーで停止し、それ以外のステータスの間はポーリングを続けます。
- 04
出力URLを読み取る
ステータスが"completed"になったら、data.outputs[0]からURLを読み取ります。URLは、WaveSpeedAIのCDN上にある生成されたメディアを指します。呼び出したFlux 2 Kleinのバリアントに応じて、画像、動画、音声、3Dファイルのいずれかです。
活用例
Flux 2 Kleinで作れるもの
開発者やクリエイターがFlux 2 Klein APIでよく使うワークフロー。
くっきりした文字の9Bテキストから画像
wavespeed-ai/flux-2-klein-9b/text-to-image は、リアリズムの向上とよりくっきりした文字生成を備えた、高品質な9Bのテキストから画像モデルです。納品作業向けの、より高精細な Klein 階層です。
速度とコストのための4B階層
wavespeed-ai/flux-2-klein-4b/text-to-image は、同じ Klein アーキテクチャを4Bパラメーターで提供します。9Bの精細さまでは必要ない、プロンプトの試行や大量処理のパイプラインに便利です。
自然言語による画像編集
wavespeed-ai/flux-2-klein-9b/edit は、自然言語の指示で精密な修正を行います。ベースの画像を生成してから、完全に再生成する代わりに、編集で磨き込めます。
LoRAによるカスタマイズ
text-to-image-lora と edit-lora のバリアントは、スタイル、キャラクター、ブランドの一貫性のための、高速な LoRA カスタマイズに対応しています。ベースモデルをファインチューニングせずに、学習済みの LoRA チェックポイントを適用できます。
リアリズムの向上
カタログ上、Klein の各バリアントでリアリズムが向上しています。具体的なライティング、素材、カメラの表現を含むプロンプトを書いて、FLUX のフォトリアルな学習の成果を引き出しましょう。
4Bと9Bの階層の選び方
4Bと9Bのエンドポイントで、プロンプト形式は共通です。方向性を探るのは4Bで行い、納品は9Bに切り替えます。編集のバリアントも、同じ階層構成です。
コツ
Flux 2 Kleinのプロンプトのコツ
Flux 2 Kleinからより良い出力を得るための実践的なアドバイス。本番のパイプラインで画像モデル全般に通用するパターンに基づいています。
- 01
試行は4B、納品は9B
4Bと9Bの階層で、プロンプト形式は共通です。プロンプトの方向性やA/Bテストには flux-2-klein-4b を使い、よりくっきりした文字とリアリズムが重要な納品には 9b に切り替えます。
- 02
修正には edit を使う
text-to-image で生成し、自然言語の指示で edit を使って磨きます。生成全体を引き直すより、早く収束します。
- 03
制作での一貫性のための LoRA
制作全体でスタイル、キャラクター、ブランドのアイデンティティを一貫させたいときは、text-to-image-lora と edit-lora で LoRA チェックポイントを学習または適用してください。
- 04
プロンプト内のタイポグラフィ
カタログ上の特長は、よりくっきりした文字生成です。描画したい文字は、プロンプト内に引用符で囲んで正確に書いてください。Klein は、マーケティングのクリエイティブで読みやすいタイポグラフィになるよう調整されています。
- 05
構造化されたプロンプトは定型文に勝る
被写体、シーン、ライティング、カメラの表現を組み合わせると、FLUX の学習から最もうまく引き出せます。一般的な品質修飾語は避けてください。具体性が勝ちます。
料金
Flux 2 Klein APIの料金
料金は出力ごとです。最終的な請求額は、各バリアントのプレイグラウンドで設定するパラメーター(解像度、長さ、出力数、参照入力)に応じて変わります。
API
Flux 2 Klein APIを呼び出す
wavespeed.ai/accesskeyでAPIキーに登録し、RESTで予測を送信します。プレイグラウンドでは、入力の組み合わせに応じて、そのまま貼り付けられるサンプルが生成されます。
POSThttps://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-image
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-image" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $WAVESPEED_API_KEY" \
-d '{
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"size": "1024*1024"
}')
TASK=$(printf '%s' "$SUBMIT_RESPONSE" | jq 'if has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "$TASK" | jq -r '.id')
if [ -z "$PREDICTION_ID" ] || [ "$PREDICTION_ID" = "null" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/$PREDICTION_ID/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body "$RESULT_URL" \
-H "Authorization: Bearer $WAVESPEED_API_KEY")
RESULT=$(printf '%s' "$RESPONSE" | jq 'if has("data") then .data else . end')
STATUS=$(printf '%s' "$RESULT" | jq -r '.status')
case "$STATUS" in
completed) printf '%s\n' "$RESULT" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "$RESULT" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneconst submitUrl = "https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-image";
const apiKey = process.env.WAVESPEED_API_KEY;
if (!apiKey) throw new Error('Set WAVESPEED_API_KEY');
async function requestJson(url, options = {}) {
const response = await fetch(url, options);
if (!response.ok) throw new Error(await response.text());
return response.json();
}
// 1. Submit the prediction.
const body = await requestJson(submitUrl, {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"size": "1024*1024"
}),
});
const task = body.data ?? body;
const resultUrl = `https://api.wavespeed.ai/api/v3/predictions/${task.id}/result`;
// 2. Poll until the prediction finishes.
while (true) {
const resultBody = await requestJson(resultUrl, {
headers: { "Authorization": `Bearer ${apiKey}` },
});
const result = resultBody.data ?? resultBody;
if (result.status === "completed") {
console.log(result.outputs);
break;
}
if (["failed", "cancelled", "timeout", "deleted"].includes(result.status)) throw new Error(JSON.stringify(result));
await new Promise(resolve => setTimeout(resolve, 2000));
}import json
import os
import time
from urllib.request import Request, urlopen
api_key = os.environ["WAVESPEED_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
payload = {
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"size": "1024*1024"
}
def request_json(url, data=None):
request = Request(url, data=data, headers=headers, method="POST" if data else "GET")
with urlopen(request) as response:
return json.load(response)
# 1. Submit the prediction.
body = request_json("https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-image", json.dumps(payload).encode())
task = body.get("data", body)
result_url = f"https://api.wavespeed.ai/api/v3/predictions/{task['id']}/result"
# 2. Poll until the prediction finishes.
while True:
result_body = request_json(result_url)
result = result_body.get("data", result_body)
status = result.get("status")
if status == "completed":
print(result.get("outputs", []))
break
if status in {"failed", "cancelled", "timeout", "deleted"}:
raise RuntimeError(result)
time.sleep(2)比較
Flux 2 Kleinと他モデルの比較
WaveSpeedAI上の類似モデルではなくFlux 2 Kleinを選ぶべきケース。
Flux 2 Klein vs Seedream 5 Lite
Seedream 5 Lite は、タイポグラフィを重視し、複数画像の一貫性のための Sequential バリアントを備えています。Flux 2 Klein は、FLUX アーキテクチャで、LoRA によるカスタマイズと、よりくっきりした文字生成を標準でカバーし、1回あたりのコストでも競争力があります。
Flux 2 Klein vs GPT Image 2
GPT Image 2 には、明示的な品質階層(low/medium/high)と、参照画像による編集があります。Flux 2 Klein は、専用の LoRA エンドポイントと、コストと品質のトレードオフのための4B/9Bのサイズ階層を備えています。
Flux 2 Klein vs Qwen Image
Qwen Image は、複数画像の Edit-Plus、カメラアングル、レイヤー合成をカバーします。Flux 2 Klein は、LoRA対応の、高品質なテキストから画像と自然言語の編集に集中しており、機能はシンプルで、リアリズムに強みがあります。
FAQ
Flux 2 Klein API — よくある質問
料金、ライセンス、連携など、WaveSpeedAIでFlux 2 Kleinを実行する際のよくある質問。
Flux 2 Klein APIとは何ですか?
Flux 2 Kleinは、Black Forest Labsの画像生成モデルで、WaveSpeedAI上でREST APIとして提供されています。Black Forest Labs の FLUX.2 [klein] は、リアリズムの向上、よりくっきりした文字生成、高速なカスタマイズのための LoRA 対応を備えた、高品質な4Bと9Bのテキストから画像・編集モデルです。生成と編集の両方に、Base と LoRA のバリアントがあります。プログラムから呼び出すことも、上にリンクされたプレイグラウンドで試すこともできます。
Flux 2 Klein APIはどう呼び出しますか?
WaveSpeedAIのアカウントに登録し、/accesskeyからAPIキーをコピーして、入力をJSONとしてhttps://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-imageにPOSTします。エンドポイントは予測IDを返します。結果のエンドポイントを約2秒ごとにポーリングし、長時間かかるタスクでは間隔を広げ、終端ステータスになったら停止してください。本番運用向けのPython / Node.js / cURLのサンプルは上にあります。
Flux 2 Klein APIの料金はいくらですか?
Flux 2 Kleinは1回あたり$0.008からです。実際の料金は、設定するパラメーター(解像度、長さ、出力数、参照入力)に応じて変わります。プレイグラウンドの「生成」ボタンの横に表示されるリアルタイムの料金プレビューで、現在の入力での正確な料金を確認できます。
Flux 2 Kleinにはどのバリアントがありますか?
WaveSpeedAIでは、16個のFlux 2 Kleinエンドポイントが利用可能です:wavespeed-ai/flux-2-klein-base-4b/edit-lora, wavespeed-ai/flux-2-klein-base-4b/text-to-image-lora, wavespeed-ai/flux-2-klein-base-4b/edit, wavespeed-ai/flux-2-klein-base-4b/text-to-image, wavespeed-ai/flux-2-klein-base-9b/edit-lora, wavespeed-ai/flux-2-klein-base-9b/text-to-image-lora, wavespeed-ai/flux-2-klein-base-9b/edit, wavespeed-ai/flux-2-klein-base-9b/text-to-imageほか。各バリアントには、専用のプレイグラウンドページと料金があります。
Flux 2 Kleinの出力を商用利用できますか?
商用利用の権利は、Black Forest Labsのモデルライセンスに従います。Black Forest Labsのほとんどのモデルは出力の商用利用を認めています。具体的なライセンスの概要は各モデルのプレイグラウンドページで、プラットフォーム全体の条件はWaveSpeedAIの利用規約でご確認ください。
なぜ直接ではなくWaveSpeedAIでFlux 2 Kleinを使うのですか?
Flux 2 Kleinと、他のプロバイダーの1,000以上のAIモデルを、1つのAPIキー、1つの請求アカウントで利用できます。ベンダーごとのSDK設定も、個別のレート制限も、ベンダーごとの連携コードの書き直しも不要です。料金は、通常Black Forest Labsの直接のAPIと同等かそれ以下です。
提供元
Black Forest Labsについて
WaveSpeedAIにおけるFlux 2 Kleinと、Black Forest Labsのモデルラインナップ全体を手がけるチーム。
Black Forest Labs は、オープンウェイトの画像モデルのファミリー、FLUX を生み出しました。FLUX.2 [klein] は、リアリズムの向上、よりくっきりした文字描画、ネイティブな LoRA 対応を備えた、4Bと9Bのテキストから画像・編集エンドポイントを提供します。大量の画像パイプライン向けに、より大きな FLUX バリアントよりコスト効率の高い選択肢です。
WaveSpeedAIでFlux 2 Kleinを使った開発を始めよう
登録時に無料のスタータークレジットを進呈。Black Forest Labsをはじめ、あらゆるプロバイダーの1,000以上のAIモデルを、1つのAPIキーで。
/filters:quality(82)/examples/5c90a7890cbd39ca11d17dc1216ff484/1783683875315920517_jTDMV4dn.webp)
/filters:quality(82)/examples/6d616d34f5de1126c1a1fa4d75c28c92/1783683876694736715_B5GQZ8hr.webp)
/filters:quality(82)/examples/749de35a5d58f586fa821a9646a601d2/1783683879735484148_hpocZ7VJ.webp)
/filters:quality(82)/examples/3026f17d8160ff37791c6fe203407579/1783683883679666545_jXENW6fo.webp)