> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX.2 与 FLUX.1 Kontext 已下线，改用 FLUX 3：模型对照、价格与迁移示例

> 老张API已下线 flux-2-pro、flux-2-flex、flux-2-max 和旧版 flux-kontext-pro、flux-kontext-max，继续调用返回 404 并提示替代模型。换成 FLUX 3 仍用同一个接口，1K 每张 0.048 美元，只需改模型名并把 width、height 换成 aspect_ratio。

2026 年 12 月 3 日起，FLUX.2 的三个模型已在老张API下线，请改用当天上线的 FLUX 3。同日稍晚，FLUX.1 Kontext 的 `flux-kontext-pro`、`flux-kontext-max` 也已下线，同样换成 FLUX 3。接口地址、密钥和 JSON 请求格式都不变，按下表改模型名，再把像素宽高换成画幅比例即可。

* **发布日期**：2026 年 12 月 3 日
* **最后核对**：2026 年 12 月 3 日
* **更新**：12 月 3 日晚些时候补充 FLUX.1 Kontext 两个模型下线
* **当前状态**：已下线，由 FLUX 3 替代。老张API不再提供任何 FLUX.1 或 FLUX.2 模型，只保留 8 个 `flux-3-image*` 模型

## 换成哪个模型

| 原模型 | 换成 | 每张价格 |
| - | - | - |
| `flux-2-pro` | `flux-3-image`（1K） | \$0.048 |
| `flux-2-flex` | `flux-3-image`（1K）或 `flux-3-image-2k` | \$0.048 或 \$0.10 |
| `flux-2-max` | `flux-3-image-2k` 或 `flux-3-image-4k` | \$0.10 或 \$0.607 |
| `flux-kontext-pro` | `flux-3-image`（1K） | \$0.048 |
| `flux-kontext-max` | `flux-3-image`（1K），要更高分辨率用 `flux-3-image-2k` | \$0.048 或 \$0.10 |

* 原来输出约 100 万像素（如 1024×1024）的选 1K，约 400 万像素（如 2048×2048）的选 2K。
* 批量出图、预览草图，以及追求速度和低价的编辑，可以用 `flux-3-image-klein`，1K 每张 \$0.009，约 10 秒一张。
* Kontext 本来就用 `aspect_ratio`，改模型名即可；编辑时原图放进 `input_image`（多张用 `images`），编辑指令写在 `prompt`。
* 编辑和生成同价，参考图不另收费。8 个 FLUX 3 模型 ID 的完整价目见 [FLUX 3 API](https://docs.laozhang.ai/api-capabilities/flux-3-image.md#模型与价格)。

## 关键信息

| 项目 | 内容 |
| - | - |
| 下线模型 | `flux-2-pro`、`flux-2-flex`、`flux-2-max`；`flux-kontext-pro`、`flux-kontext-max`（同日稍晚） |
| 下线时间 | 2026 年 12 月 3 日 |
| 调用现象 | HTTP 404，报错写明替代模型和价格，不扣费 |
| 替代模型 | FLUX 3：`flux-3-image`、`flux-3-image-klein` 及其 `-1.5k`、`-2k`、`-4k` 版本 |
| 接口 | 不变：`POST /v1/images/generations`，JSON 请求体 |
| 不受影响 | FLUX 3 和其他图像模型 |

## 谁受影响

| 范围 | 内容 |
| - | - |
| 受影响 | `model` 为上述 3 个 FLUX.2 模型 ID，或 FLUX.1 Kontext（`flux-kontext-pro`、`flux-kontext-max`）的文生图和编辑请求 |
| 不受影响 | FLUX 3 和其他图像模型 |

## 怎么迁移

**1. 改模型名**

按上表把 `model` 换成 FLUX 3 的模型 ID。分辨率由模型名决定，不用传 `resolution`。

**2. 把尺寸换成画幅**

* 去掉 `width`、`height`，改传 `aspect_ratio`，例如 1792×1024 写成 `"aspect_ratio": "16:9"`
* `size` 只接受 `1024x1024`、`1536x1024`、`1024x1536`，其他尺寸会返回 400

**3. 参考图照旧传**

`prompt` 和 `input_image` 的写法不变；多张参考图写进 `images` 数组，最多 10 张。

**4. 核对结果和扣费**

结果链接约 1 小时后失效，拿到后立即下载。切换后在[调用日志](https://api2.laozhang.ai/log)核对模型名和扣费。

迁移前（已下线，返回 404）：

```bash theme={null}
curl --fail-with-body "https://api.laozhang.ai/v1/images/generations" \
  -H "Authorization: Bearer $LAOZHANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2-pro",
    "prompt": "A ruby red retro robot riding a yellow skateboard in front of a turquoise glass greenhouse, clean product illustration style",
    "width": 1792,
    "height": 1024
  }'
```

迁移后：

```bash theme={null}
export LAOZHANG_API_KEY="替换为你的老张API密钥"

curl --fail-with-body --max-time 300 "https://api.laozhang.ai/v1/images/generations" \
  -H "Authorization: Bearer $LAOZHANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-3-image",
    "prompt": "A ruby red retro robot riding a yellow skateboard in front of a turquoise glass greenhouse, clean product illustration style",
    "aspect_ratio": "16:9"
  }' \
  -o flux3-generation.json
```

成功时 `data[0].url` 是一张 1360×768 的图片地址。FLUX 3 Image 1K 生成约 25–32 秒，客户端超时建议留到 300 秒。保存脚本、编辑与多图合成的写法见 [FLUX 3 API](https://docs.laozhang.ai/api-capabilities/flux-3-image.md)。

## 常见问题

### 现在调用 flux-2-pro 会返回什么？

返回 HTTP 404，不扣费，也不会被转到其他模型。以 `flux-2-pro` 为例，报错原文是：

```text theme={null}
The model flux-2-pro has been retired and is no longer available. Switch to flux-3-image ($0.048, 1K) on the same endpoint. FLUX 3 takes the resolution from the model name and aspect_ratio instead of width/height; prompt and input_image work as before.
```

`flux-2-flex`、`flux-2-max` 的报错格式相同，替代模型按上表写出。

### flux-kontext-pro 和 flux-kontext-max 还能用吗？

不能。本页最初发布时这两个模型还可以调用；12 月 3 日稍晚，FLUX.1 Kontext 的 `flux-kontext-pro` 和 `flux-kontext-max` 也已下线，调用返回 HTTP 404，不扣费。报错原文（`flux-kontext-max` 只是模型名不同）：

```text theme={null}
The model flux-kontext-pro has been retired and is no longer available. Switch to flux-3-image ($0.048, 1K) on the same endpoint: send the source image as input_image (or images, up to 10) with your edit instruction as prompt; set aspect_ratio instead of width/height.
```

改法：

* `model` 换成 `flux-3-image`（1K，\$0.048）；要更高分辨率用 `flux-3-image-2k`（\$0.10），快速低价的编辑用 `flux-3-image-klein`（\$0.009）
* 原图放进 `input_image`（多张用 `images`，最多 10 张），编辑指令写在 `prompt`
* `aspect_ratio` 照旧传

原来的 Kontext 写法保留在 [FLUX.2 API 中的旧版 Kontext 兼容](https://docs.laozhang.ai/api-capabilities/flux-image-generation.md#旧版-kontext-兼容)，供迁移时对照。

### 迁移到 FLUX 3 要改哪些代码？

通常只改三处：

* `model` 换成带档位的 FLUX 3 模型名
* `width`、`height` 换成 `aspect_ratio`
* 多张参考图写进 `images` 数组

接口地址、密钥、`prompt` 和 `input_image` 都不用改。读取结果仍从 `data[0].url` 下载，链接有效期从约 10 分钟延长到约 1 小时。

### 传 width、height 会怎样？

FLUX 3 不接受 `width`、`height`，请求返回 400，报错提示改用 `aspect_ratio`，不扣费。

`size` 只能传 `1024x1024`、`1536x1024` 或 `1024x1536`。

### 为什么下线 FLUX.2？

FLUX.2 和更早的 FLUX.1 Kontext 都已由新一代的 FLUX 3 替代。FLUX 3 用同一个接口，支持最高 4K 输出和最多 10 张参考图。

### FLUX.2 还会恢复吗？

FLUX.2 和 FLUX.1 Kontext 目前都没有恢复计划。如有变化，会更新本页并在[公告索引](https://docs.laozhang.ai/changelog.md)发布通知。

## 信息来源与相关链接

* **老张API**：下线状态与报错原文依据 2026 年 12 月 3 日的实际调用结果；当前模型和单价以[模型与价格总表](https://docs.laozhang.ai/models.md)为准
* **相关文档**：[FLUX 3 API](https://docs.laozhang.ai/api-capabilities/flux-3-image.md)、[FLUX 3 上线公告](https://docs.laozhang.ai/announcements/flux-3-image-2026-12.md)、[FLUX.2 API：图像生成](https://docs.laozhang.ai/api-capabilities/flux-image-generation.md)、[已下线模型与替代模型](https://docs.laozhang.ai/models/retired.md)
* **BFL 官方**：[FLUX 官方价格](https://bfl.ai/pricing)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.