模型支援企業部落格
500+ AI 模型 API,全部整合在一個 API 中。就在 CometAPI
模型 API
開發者
快速入門說明文件API 儀表板
資源
AI模型部落格企業更新日誌關於
2025 CometAPI. 保留所有權利。隱私政策服務條款
Home/Models/Flux/FLUX 2 FLEX
F

FLUX 2 FLEX

每次請求:$0.008
FLUX 2 FLEX 是一款多功能、可適應的模型,旨在在各種使用情境與硬體配置中靈活部署。它提供可擴展的效能與可調整的品質設定,非常適合需要動態資源分配的應用。此模型在品質、速度與資源效率之間達到最佳平衡。
新
商業用途
Playground
概覽
功能
定價
API

什麼是 FLUX.2 [flex]

FLUX.2 [flex] 是 Black Forest Labs 的 FLUX.2 系列中「靈活控制」版本:一款以生產應用為導向的文字→圖像與圖像編輯模型,提供可調整的推理參數(steps、guidance scale、seed),讓開發者能在速度與保真度之間取捨,並精準調整字體排版/細節表現。Flex 支援多參考編輯(Flex 方案最多可使用 10 張參考圖片),可編輯最高約 ~4 百萬像素的圖像。


FLUX.2 [flex] 擅長的方面

  • 精準控制品質與速度之間的平衡(使用者可自行選擇推理步數與 guidance scale)。
  • 優異的文字/字體排版渲染能力,相較許多同類模型更出色——推薦用於海報、UI 模擬稿、資訊圖表。
  • 多參考編輯:可在最多 10 張輸入圖片(Flex)之間結合並保留身份/品牌元素,同時維持一致的光照與材質。
  • 高原生解析度與編輯能力:輸出最高可達 4MP;對大多數工作流程,建議的操作範圍為 ≤2MP。
  • 支援結構化提示詞:可使用 JSON 或自然語言提示詞;「prompt upsampling」可自動豐富簡短提示詞。

FLUX.2 [flex] 與同類模型的比較

簡表(摘要):

  • Nano Banana Pro(Google/內部名稱;高保真競品):在高解析度下具備相近的原始保真度;在某些供應商版本中,Nano Banana 可支援更大的輸出尺寸;使用者比較顯示,兩者在擬真度方面相當,但在提示詞行為與編輯一致性上各有優勢。
  • Qwen-Image / Hunyuan Image:根據發表時的比較,FLUX.2 在文字→圖像與編輯多參考任務上的主觀勝率更高(見發表報導)。
  • Midjourney / 商業 SaaS:Midjourney 常透過升頻管線來提升最終像素數以參與競爭;FLUX.2 則強調原生高解析度輸出與更緊密的多參考編輯。獨立評測者認為,兩者在構圖風格與原生像素細節上各有取捨。

實務結論:FLUX.2 的賣點在於多參考編輯、穩健的字體排版能力,以及一系列可讓團隊在吞吐量/品質/成本之間選擇折衷方案的端點。獨立測試者認為,它在同一發布窗口中的頂尖模型中具有競爭力。

[flex] 專屬參數:

ParameterTypeDefaultDescription
stepsinteger50[僅限 flex] 推理步數。最大值:50,預設值:50。數值越高 = 細節越多,但速度越慢。
guidancefloat4.5[僅限 flex] Guidance scale。控制輸出對提示詞的遵循程度。最小值:1.5,最大值:10,預設值:4.5。數值越高 = 越貼近提示詞。

如何存取 Flux.2 Flex API

步驟 1:註冊 API 金鑰

登入 cometapi.com。若您尚未成為我們的使用者,請先註冊。登入您的 CometAPI console。取得介面的存取憑證 API key。在個人中心的 API token 處點擊「Add Token」,取得 token key:sk-xxxxx 並提交。

步驟 2:向 Flux.2 Flex API 發送請求

選擇 “flux-2-flex ”端點來發送 API 請求,並設定 request body。請求方法與 request body 可從我們網站的 API 文件取得。我們的網站也提供 Apifox 測試以方便您使用。將 <YOUR_API_KEY> 替換為您帳戶中的實際 CometAPI key。base url 為 flux generate image(https://api.cometapi.com/flux/v1/flux-2-flex)

將您的問題或請求填入 content 欄位——這就是模型將會回應的內容。處理 API 回應以取得生成的答案。

步驟 3:擷取並驗證結果

生成完成後,您可以使用 /flux/v1/get_result 端點查詢已生成的圖片或監控處理狀態。處理完成後,API 會回傳任務狀態與輸出資料。

👇 立即開始建置 Flux image generation – API 文件

常見問題

What makes FLUX.2 [flex] different from other FLUX.2 models?

FLUX.2 [flex] is specialized for typography and text rendering, making it the best choice for preserving small details and generating text-heavy content.

Does FLUX.2 [flex] support adjustable generation steps?

Yes, FLUX.2 [flex] offers 'Quality with control' by allowing adjustable usage of steps and guidance, unlike the standard settings in [pro] and [max].

How many reference images can FLUX.2 [flex] handle?

Like the other FLUX.2 models, [flex] supports up to 8 reference images via the API (10 in Playground) for multi-reference generation.

What is the pricing for FLUX.2 [flex]?

FLUX.2 [flex] is priced at $0.06 per megapixel (MP), positioning it between the [pro] and [max] models.

Is FLUX.2 [flex] suitable for photo editing?

Yes, FLUX.2 [flex] combines powerful editing capabilities with its text specialization, allowing for changes to objects, colors, and adding text overlays sequentially.

What resolution does FLUX.2 [flex] support?

FLUX.2 [flex] supports high-resolution output up to 4 megapixels (4MP) across any aspect ratio, suitable for professional creative work.

When should I choose [flex] over [pro]?

Choose FLUX.2 [flex] when your project involves significant text elements, typography, or requires fine-grained control over generation steps that [pro] does not offer.

FLUX 2 FLEX 的功能

探索 FLUX 2 FLEX 的核心功能,專為提升效能和可用性而設計。了解這些功能如何為您的專案帶來效益並改善使用者體驗。

FLUX 2 FLEX 的定價

探索 FLUX 2 FLEX 的競爭性定價,專為滿足各種預算和使用需求而設計。我們靈活的方案確保您只需為實際使用量付費,讓您能夠隨著需求增長輕鬆擴展。了解 FLUX 2 FLEX 如何在保持成本可控的同時提升您的專案效果。
彗星價格 (USD / M Tokens)官方價格 (USD / M Tokens)折扣
每次請求:$0.008
每次請求:$0.01
-20%

FLUX 2 FLEX 的範例程式碼和 API

FLUX.2 Flex 是 Black Forest Labs 的 FLUX.2 影像生成系列中面向開發者的中階成員。它會公開生成參數(尤其是採樣步數與引導尺度),讓開發者能在延遲與文字/排版保真度及影像細節之間進行取捨。
POST
/flux/v1/{model}
Python
JavaScript
Curl
import os
import requests

# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
COMETAPI_KEY = os.environ.get("COMETAPI_KEY") or "<YOUR_COMETAPI_KEY>"

# API endpoint for FLUX.2 [flex]
url = "https://api.cometapi.com/flux/v1/flux-2-flex"

# Request headers
headers = {
    "Authorization": COMETAPI_KEY,
    "Content-Type": "application/json",
    "Accept": "*/*",
}

# Request payload with all available parameters
# See: https://docs.bfl.ml/api-reference/models/generate-or-edit-an-image-with-flux2-[flex]
payload = {
    # Required: Text prompt for image generation
    "prompt": "A futuristic cyberpunk cityscape at sunset, neon signs with readable text 'WELCOME TO 2077', flying cars, ultra detailed, 8k",
    # Optional: Enable prompt upsampling for enhanced details (default: true)
    "prompt_upsampling": True,
    # Output dimensions (multiple of 16, min 64, max 4MP total)
    "width": 1920,
    "height": 1080,
    # FLEX-specific: Number of inference steps (1-50, default: 50)
    # Higher values produce more detailed images but take longer
    "steps": 50,
    # FLEX-specific: Guidance scale (1.5-10, default: 5)
    # Higher values improve prompt adherence at cost of reduced realism
    "guidance": 5.0,
    # Seed for reproducible results (optional)
    "seed": 42,
    # Moderation level: 0 (strict) to 5 (permissive), default: 2
    "safety_tolerance": 2,
    # Output format: "jpeg" or "png"
    "output_format": "jpeg",
}

# Submit the generation task
print("Submitting FLUX.2 [flex] image generation task...")
response = requests.post(url, headers=headers, json=payload)
result = response.json()

print(f"Status Code: {response.status_code}")
print(f"Task ID: {result.get('id')}")
print(f"Cost: {result.get('cost')} credits")
print(f"Output Megapixels: {result.get('output_mp')}")

Python Code Example

import os
import requests

# Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
COMETAPI_KEY = os.environ.get("COMETAPI_KEY") or "<YOUR_COMETAPI_KEY>"

# API endpoint for FLUX.2 [flex]
url = "https://api.cometapi.com/flux/v1/flux-2-flex"

# Request headers
headers = {
    "Authorization": COMETAPI_KEY,
    "Content-Type": "application/json",
    "Accept": "*/*",
}

# Request payload with all available parameters
# See: https://docs.bfl.ml/api-reference/models/generate-or-edit-an-image-with-flux2-[flex]
payload = {
    # Required: Text prompt for image generation
    "prompt": "A futuristic cyberpunk cityscape at sunset, neon signs with readable text 'WELCOME TO 2077', flying cars, ultra detailed, 8k",
    # Optional: Enable prompt upsampling for enhanced details (default: true)
    "prompt_upsampling": True,
    # Output dimensions (multiple of 16, min 64, max 4MP total)
    "width": 1920,
    "height": 1080,
    # FLEX-specific: Number of inference steps (1-50, default: 50)
    # Higher values produce more detailed images but take longer
    "steps": 50,
    # FLEX-specific: Guidance scale (1.5-10, default: 5)
    # Higher values improve prompt adherence at cost of reduced realism
    "guidance": 5.0,
    # Seed for reproducible results (optional)
    "seed": 42,
    # Moderation level: 0 (strict) to 5 (permissive), default: 2
    "safety_tolerance": 2,
    # Output format: "jpeg" or "png"
    "output_format": "jpeg",
}

# Submit the generation task
print("Submitting FLUX.2 [flex] image generation task...")
response = requests.post(url, headers=headers, json=payload)
result = response.json()

print(f"Status Code: {response.status_code}")
print(f"Task ID: {result.get('id')}")
print(f"Cost: {result.get('cost')} credits")
print(f"Output Megapixels: {result.get('output_mp')}")

JavaScript Code Example

// Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
const COMETAPI_KEY = process.env.COMETAPI_KEY || "<YOUR_COMETAPI_KEY>";

// API endpoint for FLUX.2 [flex]
const url = "https://api.cometapi.com/flux/v1/flux-2-flex";

// Request payload with all available parameters
// See: https://docs.bfl.ml/api-reference/models/generate-or-edit-an-image-with-flux2-[flex]
const payload = {
    // Required: Text prompt for image generation
    prompt: "A futuristic cyberpunk cityscape at sunset, neon signs with readable text 'WELCOME TO 2077', flying cars, ultra detailed, 8k",
    
    // Optional: Enable prompt upsampling for enhanced details (default: true)
    prompt_upsampling: true,
    
    // Output dimensions (multiple of 16, min 64, max 4MP total)
    width: 1920,
    height: 1080,
    
    // FLEX-specific: Number of inference steps (1-50, default: 50)
    // Higher values produce more detailed images but take longer
    steps: 50,
    
    // FLEX-specific: Guidance scale (1.5-10, default: 5)
    // Higher values improve prompt adherence at cost of reduced realism
    guidance: 5.0,
    
    // Seed for reproducible results (optional)
    seed: 42,
    
    // Moderation level: 0 (strict) to 5 (permissive), default: 2
    safety_tolerance: 2,
    
    // Output format: "jpeg" or "png"
    output_format: "jpeg"
};

// Submit the generation task
console.log("Submitting FLUX.2 [flex] image generation task...");

const response = await fetch(url, {
    method: "POST",
    headers: {
        "Authorization": COMETAPI_KEY,
        "Content-Type": "application/json",
        "Accept": "*/*"
    },
    body: JSON.stringify(payload)
});

const result = await response.json();

console.log(`Status Code: ${response.status}`);
console.log(`Task ID: ${result.id}`);
console.log(`Cost: ${result.cost} credits`);
console.log(`Output Megapixels: ${result.output_mp}`);

Curl Code Example

#!/bin/bash
# Get your CometAPI key from https://api.cometapi.com/console/token
# Export it as: export COMETAPI_KEY="your-key-here"

curl --location --request POST 'https://api.cometapi.com/flux/v1/flux-2-flex' \
--header "Authorization: $COMETAPI_KEY" \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data-raw '{
    "prompt": "A futuristic cyberpunk cityscape at sunset, neon signs with readable text WELCOME TO 2077, flying cars, ultra detailed, 8k",
    "prompt_upsampling": true,
    "width": 1920,
    "height": 1080,
    "steps": 50,
    "guidance": 5.0,
    "seed": 42,
    "safety_tolerance": 2,
    "output_format": "jpeg"
}'

更多模型

G

Nano Banana 2

輸入:$0.4/M
輸出:$2.4/M
核心能力概覽:解析度:最高可達 4K(4096×4096),與 Pro 相當。參考圖片一致性:最多支援 14 張參考圖片(10 個物件 + 4 個角色),維持風格與角色一致性。極端寬高比:新增 1:4、4:1、1:8、8:1 比例,適合長圖、海報與橫幅。文字渲染:進階文字生成,適用於資訊圖表與行銷海報版面。搜尋強化:整合 Google Search + Image Search。Grounding:內建思考過程;在生成前會先對複雜提示進行推理。
D

Doubao Seedream 5

每次請求:$0.028
Seedream 5.0 Lite 是一款統一式多模態圖像生成模型,具備深度思考與線上搜尋能力,在理解、推理與生成能力上全方位升級。
F

FLUX 2 MAX

每次請求:$0.008
FLUX.2 [max] 是來自 Black Forest Labs(BFL)的頂級視覺智能模型,專為生產級工作流程設計:行銷、產品攝影、電子商務、創意製作流程,以及任何需要一致的角色/產品形象、精準文字渲染,並在多百萬像素解析度下呈現照片級寫實細節的應用。其架構經過精心設計,具備強大的提示遵循能力、多參考融合(最多可輸入十張圖像),以及有根據的生成(在產生圖像時能夠納入最新的網路脈絡)。
X

Black Forest Labs/FLUX 2 MAX

每次請求:$0.056
FLUX.2 [max] 是 Black Forest Labs(BFL)推出的 FLUX.2 系列中旗艦級、最高品質的變體。其定位為專業級的文字→圖像生成與圖像編輯模型,重點在於極致保真度、對提示詞的遵從度,以及在角色、物件、光照與色彩上的編輯一致性。BFL 與合作夥伴的註冊目錄將 FLUX.2 [max] 描述為頂級的 FLUX.2 變體,具備多重參考編輯與有據生成等特性。
O

GPT Image 1.5

輸入:$6.4/M
輸出:$25.6/M
GPT-Image-1.5 是 OpenAI 的 GPT Image 系列中的圖像模型。它是一個原生多模態的 GPT 模型,旨在根據文字提示生成圖像,並在嚴格遵循使用者指示的同時對輸入圖像進行高保真編輯。
D

Doubao Seedream 4.5

每次請求:$0.032
Seedream 4.5 是 ByteDance/Seed 的多模態圖像模型(文字→圖像 + 圖像編輯),專注於生產級的圖像保真度、更強的提示詞遵循度,以及大幅改進的編輯一致性(主體保留、文字/字體排版渲染與人臉真實感)。

相關部落格

如何使用 Flux.2 API?您需要知道的一切
Nov 27, 2025
flux-2
flux-2-dev
flux-2-flex
flux-2-pro

如何使用 Flux.2 API?您需要知道的一切

FLUX.2 是 Black Forest Labs 的第二代影像生成與影像編輯模型系列(於 2025 年 11 月 25 日發布)。它提供生產級
Flux.2 Flex API
Nov 26, 2025
flux-2
flux-2-flex

Flux.2 Flex API

FLUX.2 Flex 是 Black Forest Labs FLUX.2 影像生成系列中面向開發者的中階產品。它公開了生成參數(特別是採樣步數和引導比例),以便開發者可以在延遲、文字/排版保真度和圖像細節之間進行權衡。
什麼是 Flux.2,並且 Flux 2 現在可在 CometAPI 上使用
Nov 26, 2025
flux-2
flux-2-dev
flux-2-flex
flux-2-pro

什麼是 Flux.2,並且 Flux 2 現在可在 CometAPI 上使用

FLUX.2 是 Black Forest Labs 新近宣布的圖像生成與編輯模型系列,提供生產級的保真度與多參考編輯。