Flux 2 Klein API
Black Forest Labs FLUX.2 [klein] 是高品質的 4B 與 9B 文字轉圖片及編輯模型,擁有更強的寫實感、更清晰的文字生成,並支援 LoRA 以快速客製化。生成與編輯皆提供基礎版與 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] 是高品質的 4B 與 9B 文字轉圖片及編輯模型,擁有更強的寫實感、更清晰的文字生成,並支援 LoRA 以快速客製化。生成與編輯皆提供基礎版與 LoRA 版本。
提供 4B 與 9B 參數等級的文字轉圖片與編輯。支援 LoRA 的版本(text-to-image-lora、edit-lora)可快速客製化。編輯端點接受自然語言指令,進行精準修改。
WaveSpeedAI 上的 Flux 2 Klein 系列提供 16 個 REST 端點,涵蓋 Image-To-Image, Text-To-Image 等工作流程。每個變體都有各自的定價、參數選項與範例輸出 — 請挑選符合您輸入模態與生產限制的版本,或使用同一組 API 金鑰呼叫多個變體,組合成多步驟的處理流程。
使用您呼叫其他 1,000+ 個 WaveSpeedAI AI 模型時相同的 API 金鑰、帳單帳戶與速率限制額度來執行 Flux 2 Klein。無需另外設定供應商、無需各家 SDK、無需處理各家不同的速率限制 — 一次整合,涵蓋從文字轉圖片、文字轉影片,到音訊合成、3D 生成、放大與編輯的所有功能。
端點
所有 Flux 2 Klein API 端點
WaveSpeedAI 目前提供 16 個 Flux 2 Klein 端點 — 請選擇符合您工作流程的變體。
/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
從註冊到完成生成,只要四個步驟。完整的 Python、Node.js 與 cURL 範例請見下方的 API 區段。
- 01
取得 API 金鑰
註冊 WaveSpeedAI 帳號,並從控制台複製您的 API 金鑰。新帳號會獲贈免費入門點數 — 足以在開始計費前執行數十次 Playground。
- 02
提交 prediction
將您的輸入以 JSON 格式 POST 到 https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-image。端點會立即回傳 prediction id — 生成是非同步進行的,因此推論期間您不需要保持連線。
- 03
輪詢完成狀態
GET https://api.wavespeed.ai/api/v3/predictions/{request_id}/result。狀態為 completed 時回傳輸出;狀態為 failed、cancelled、timeout 或 deleted 時停止並回報錯誤;其他狀態則持續輪詢。
- 04
讀取輸出網址
當狀態為 "completed" 時,從 data.outputs[0] 讀取網址。該網址指向 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 以 4B 參數提供相同的 Klein 架構,適合提示詞迭代與不需要 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 等級使用相同的提示詞格式。以 flux-2-klein-4b 確認提示詞方向與進行 A/B 測試;需要更清晰的文字與寫實感時,再切換到 9b 交付。
- 02
以 edit 進行修飾
先以文字轉圖片生成,再以自然語言指令透過 edit 精修,比重新抽取整張圖更快收斂。
- 03
以 LoRA 維持正式製作的一致性
當整個製作需要固定的風格、角色或品牌身分時,請透過 text-to-image-lora 與 edit-lora 訓練或套用 LoRA 檢查點。
- 04
提示詞中的字體排版
目錄說明:文字生成更清晰。請在提示詞中以引號寫出想要呈現的確切文字,Klein 針對行銷創意中可讀的字體排版進行了調校。
- 05
結構化提示詞勝過套話
主體 + 場景 + 光線 + 攝影機語言,最能發揮 FLUX 的訓練成果。避免使用籠統的畫質修飾語,具體才是關鍵。
定價
Flux 2 Klein API 定價
依輸出計費。最終費用會依您在各變體 Playground 中設定的參數(解析度、時長、輸出數量、參考素材)而調整。
| 端點 | 類型 | 起始價格 |
|---|---|---|
| wavespeed-ai/ | image-to-image | $0.02 |
| wavespeed-ai/ | text-to-image | $0.015 |
| wavespeed-ai/ | image-to-image | $0.015 |
| wavespeed-ai/ | text-to-image | $0.01 |
| wavespeed-ai/ | image-to-image | $0.026 |
| wavespeed-ai/ | text-to-image | $0.02 |
| wavespeed-ai/ | image-to-image | $0.021 |
| wavespeed-ai/ | text-to-image | $0.015 |
| wavespeed-ai/ | image-to-image | $0.017 |
| wavespeed-ai/ | text-to-image | $0.013 |
| wavespeed-ai/ | text-to-image | $0.015 |
| wavespeed-ai/ | image-to-image | $0.021 |
| wavespeed-ai/ | image-to-image | $0.012 |
| wavespeed-ai/ | image-to-image | $0.016 |
| wavespeed-ai/ | text-to-image | $0.01 |
| wavespeed-ai/ | text-to-image | $0.008 |
API
呼叫 Flux 2 Klein API
請到 wavespeed.ai/accesskey 註冊取得 API 金鑰,然後透過 REST 提交 prediction。Playground 會為任何輸入組合產生可直接貼上的範例。
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 則原生支援 LoRA 客製化,在 FLUX 架構中提供更清晰的文字生成,且單次呼叫成本具有競爭力。
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,組合更簡單,寫實表現出色。
常見問題
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] 是高品質的 4B 與 9B 文字轉圖片及編輯模型,擁有更強的寫實感、更清晰的文字生成,並支援 LoRA 以快速客製化。生成與編輯皆提供基礎版與 LoRA 版本。您可以透過程式呼叫,也可以在上方連結的 Playground 試用。
如何呼叫 Flux 2 Klein API?
註冊 WaveSpeedAI 帳號,從 /accesskey 複製您的 API 金鑰,然後將您的輸入以 JSON 格式 POST 到 https://api.wavespeed.ai/api/v3/wavespeed-ai/flux-2-klein-9b/text-to-image。端點會回傳 prediction id。請從約每 2 秒輪詢一次結果端點開始,長時間任務可拉長間隔,並在任何終止狀態時停止。上方提供適用於生產環境的 Python / Node.js / cURL 範例。
Flux 2 Klein API 的費用是多少?
Flux 2 Klein 每次執行 $0.008 起。實際費用會依您設定的參數(解析度、時長、輸出數量、參考素材)而調整。Playground 中「生成」按鈕旁的即時費用預覽會顯示您目前輸入的確切價格。
有哪些 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等。每個變體都有各自的 Playground 頁面與定價。
Flux 2 Klein 的輸出可以商用嗎?
商業使用權依 Black Forest Labs 的模型授權而定。多數 Black Forest Labs 模型允許商用輸出;請參閱各模型 Playground 頁面中的授權摘要,以及 WaveSpeedAI 的服務條款了解平台層級的條件。
為什麼要在 WaveSpeedAI 上使用 Flux 2 Klein,而不是直接使用?
一組 API 金鑰、一個帳單帳戶,即可使用 Flux 2 Klein 以及來自其他供應商的 1,000+ 個 AI 模型。無需設定各家 SDK、無需處理各自獨立的速率限制、無需為每個供應商重寫整合程式碼。價格通常與 Black Forest Labs 的直接 API 相當或更低。
提供者
關於 Black Forest Labs
Flux 2 Klein 背後的團隊,以及 Black Forest Labs 在 WaveSpeedAI 上的完整模型陣容。
Black Forest Labs 打造了 FLUX 開放權重圖像模型系列。FLUX.2 [klein] 提供 4B 與 9B 的文字轉圖片及編輯端點,具有更強的寫實感、更清晰的文字渲染與原生 LoRA 支援,是較大型 FLUX 版本的高性價比替代方案,適合大量圖像管線。
在 WaveSpeedAI 上開始使用 Flux 2 Klein 打造應用
註冊即贈免費入門點數。一組 API 金鑰,涵蓋來自 Black Forest Labs 與所有其他供應商的 1,000+ 個 AI 模型。
/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)