FLUX API:FLUX 3、FLUX 2、Kontext 和 FLUX 3 Video
Black Forest Labs 现在发布了多个 FLUX 图像模型和一个视频模型。本指南介绍哪种任务该用哪个 FLUX、各模型在每种尺寸下的价格,以及如何通过一个 API 调用它们。
Revana 上的 FLUX 模型
FLUX 是 Black Forest Labs 的图像模型系列,现在也有了视频模型。目录中提供最新一代的 FLUX 3,以及 FLUX 2 和 Kontext 编辑模型。它们都使用同一种请求格式:
| 模型 | 模型 id | 功能 | 尺寸 | 参考图 | 起价 | 线路 |
|---|---|---|---|---|---|---|
| FLUX 3 | flux-3 | 文生图、编辑 | 1K, 1.5K, 2K, 4K | 最多 10 张 | $0.05 / 张 | 一条线路 |
| FLUX 2 Pro | flux-2-pro | 文生图、编辑 | 1 到 4 MP | 最多 8 张 | $0.03 / 张 | 两条线路 |
| FLUX 2 Max | flux-2-max | 文生图、编辑 | 1 到 4 MP | 最多 8 张 | $0.07 / 张 | 一条线路 |
| FLUX Kontext Pro | flux-kontext-pro | 文生图、编辑 | 模型默认值 | 最多 4 张 | $0.04 / 张 | 两条线路 |
| FLUX Kontext Max | flux-kontext-max | 文生图、编辑 | 模型默认值 | 最多 4 张 | $0.07 / 张 | 两条线路 |
| FLUX 3 Video | flux-3-video | 文生视频、图生视频,带声音 | draft、hd、fhd;5 到 20 秒 | 一张首帧图片 | $0.06 / s | 一条线路 |
FLUX 2 的尺寸以百万像素表示(1MP 到 4MP),并有一个跟随你的参考图的 auto 宽高比选项。FLUX 3 使用其他图像模型所用的 1K 到 4K 命名。
该用哪个 FLUX
- FLUX 2 Pro 是主力:以照片级细节和可靠的手部与面部著称,最多支持八张参考图,100 万像素下每张 $0.03 起。它有两条线路。
- FLUX 3 是最新的图像模型,最多支持十张参考图。1K 下 $0.05,2K 下 $0.10;它的 4K 档贵得多,为 $0.61,所以只有确实需要时才选 4K。
- FLUX 2 Max 在小尺寸下每张更贵,但在最大尺寸下比 FLUX 3 便宜:400 万像素为 $0.16。
- FLUX Kontext Pro 和 Max 专为按指令编辑而设计,最多支持四张图片,每张价格固定。
我们不发布它们之间的画质排名;请用你的提示词在两三个模型上试一试再比较。
FLUX 图像价格(2026 年 10 月)
| 模型 | 尺寸 | 每张图片 | 100 张图片 |
|---|---|---|---|
| FLUX 3 | 1K | $0.05 | $5.00 |
| FLUX 3 | 1.5K | $0.07 | $7.00 |
| FLUX 3 | 2K | $0.10 | $10.00 |
| FLUX 3 | 4K | $0.61 | $61.00 |
| FLUX 2 Pro | 1 MP | $0.03 | $3.00 |
| FLUX 2 Pro | 2 MP | $0.05 | $5.00 |
| FLUX 2 Pro | 4 MP | $0.08 | $8.00 |
| FLUX 2 Max | 1 MP | $0.07 | $7.00 |
| FLUX 2 Max | 4 MP | $0.16 | $16.00 |
| FLUX Kontext Pro | 单一尺寸 | $0.04 | $4.00 |
| FLUX Kontext Max | 单一尺寸 | $0.07 | $7.00 |
FLUX 3 Video
FLUX 3 Video 可以根据提示词或首帧图片生成 5 到 20 秒的视频,需要时可带声音。按每秒输出计费,分三个质量档:
| 设置 | 每秒 | 10 秒视频 | 20 秒视频 |
|---|---|---|---|
| draft | $0.06 | $0.60 | $1.20 |
| hd | $0.17 | $1.70 | $3.40 |
| fhd | $0.29 | $2.90 | $5.80 |
通过 resolution 传入该设置。在为 fhd 付费之前,草稿档是检查动作和构图的低成本方式。关于它与其他视频模型的对比,请参阅最佳 AI 视频 API 指南。
生成一张 FLUX 2 Pro 图片
发送 POST /v1/generations,带上模型 id 和 input,然后轮询,直到任务出现 succeeded 或 failed。这张 2 MP 的图片费用为 $0.05。
export REVANA_API_KEY="sr_live_..."
# 1. Submit the job (returns 202 with the generation id)
curl https://api.revana.si/v1/generations \
-H "Authorization: Bearer $REVANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-pro",
"input": {
"prompt": "Close-up portrait of a potter at her wheel, clay on her hands, late afternoon light through a dusty workshop window, 85mm lens look.",
"resolution": "2MP",
"aspect_ratio": "3:4"
},
"max_cost_usd": 0.1
}'
# 2. Poll with the id from step 1 until status is "succeeded" or "failed"
curl https://api.revana.si/v1/generations/gen_01JC2V8K5T \
-H "Authorization: Bearer $REVANA_API_KEY"import os
import time
import requests
API = "https://api.revana.si/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['REVANA_API_KEY']}"}
resp = requests.post(f"{API}/generations", headers=HEADERS, json={
"model": "flux-2-pro",
"input": {
"prompt": "Close-up portrait of a potter at her wheel, clay on her hands, late afternoon light through a dusty workshop window, 85mm lens look.",
"resolution": "2MP",
"aspect_ratio": "3:4",
},
"max_cost_usd": 0.1,
})
resp.raise_for_status()
job = resp.json()
while job["status"] in ("queued", "running"):
time.sleep(3)
job = requests.get(f"{API}/generations/{job['id']}", headers=HEADERS).json()
if job["status"] == "succeeded":
print(job["output"]["urls"], job["cost_usd"])
else:
print("Failed:", job["error"])// Node 18 or later. Save as generate.mjs and run: node generate.mjs
const API = "https://api.revana.si/v1";
const headers = {
Authorization: `Bearer ${process.env.REVANA_API_KEY}`,
"Content-Type": "application/json",
};
const res = await fetch(`${API}/generations`, {
method: "POST",
headers,
body: JSON.stringify({
model: "flux-2-pro",
input: {
prompt: "Close-up portrait of a potter at her wheel, clay on her hands, late afternoon light through a dusty workshop window, 85mm lens look.",
resolution: "2MP",
aspect_ratio: "3:4",
},
max_cost_usd: 0.1,
}),
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
let job = await res.json();
while (job.status === "queued" || job.status === "running") {
await new Promise((r) => setTimeout(r, 3000));
job = await (await fetch(`${API}/generations/${job.id}`, { headers })).json();
}
if (job.status === "succeeded") console.log(job.output.urls, job.cost_usd);
else console.error("Failed:", job.error);根据首帧图片生成 FLUX 3 Video 视频
生成视频时,在 image_url 中传入首帧,在 duration 中传入时长,并用 audio: true 开启声音。这段 10 秒的 hd 视频费用为 $1.70:
{
"model": "flux-3-video",
"input": {
"prompt": "The potter slowly lifts the finished bowl from the wheel and turns it toward the light. Soft hum of the wheel winding down.",
"image_url": "https://example.com/potter.png",
"resolution": "hd",
"duration": 10,
"audio": true
},
"max_cost_usd": 2.1
}每个任务的价格在提交时从你的余额中预留,只有成功时才会扣费。如果任务失败,预留会被释放,你不需要付任何费用。
所有 FLUX 模型都在模型页面上。文档列出了所有输入字段,额度包见价格页面。获取 API 密钥即可开始。
常见问题
FLUX 3 API 的价格是多少?
2026 年 10 月,FLUX 3 在 1K 下每张 $0.05,1.5K 下 $0.07,2K 下 $0.10,4K 下 $0.61。
FLUX 2 Pro 的价格是多少?
从 100 万像素的每张 $0.03 起,到 400 万像素的 $0.08。
FLUX 可以编辑图片吗?
可以。FLUX 3 最多支持 10 张参考图,FLUX 2 Pro 和 Max 最多 8 张,FLUX Kontext Pro 和 Max 最多 4 张,都通过 image_urls 传入。
有 FLUX 视频 API 吗?
有。FLUX 3 Video 可以根据文本或首帧图片生成 5 到 20 秒的视频,可选带声音,草稿档每秒 $0.06 起。
FLUX 2 支持哪些尺寸?
尺寸以百万像素表示:1MP、2MP、3MP 或 4MP,宽高比从 21:9 到 9:21,或 auto。