Vercel News
FLUX 3 Image now available on AI Gateway
6.7内容质量
TL;DR · AI 摘要
FLUX 3 Image now available on AI Gateway - Vercel FLUX 3 Image from Black Forest Labs is now available on AI Gateway. Ge...
核心要点
- 主题聚焦:FLUX 3 Image now available on AI Gateway
- 来源:Vercel News,建议结合原文判断细节。
- AI 分析暂不可用,本条为保底评分与摘要。
#AI#后端
打开原文FLUX 3 Image 现已上线 AI Gateway - Vercel
Black Forest Labs 推出的 FLUX 3 Image 现已通过 AI Gateway 提供服务。您可以通过单个 API 密钥(无需 Black Forest Labs 账户)使用该模型,既可通过文本生成图像,也可编辑现有图像。
FLUX 3 Image 支持最多 10 张参考图像进行编辑、主体组合或构图调整。它支持从 768 × 768 到 4K 的五种分辨率,包含正方形、竖版和横版三种画幅比例。
设置 AI_GATEWAY_API_KEY 后,使用 AI SDK 7 或更高版本时,将模型 ID 设为 bfl/flux-3-image。要生成图像,调用 generateImage 并传入文本提示:
code
1
import
{
generateImage
}
from
'ai'
;
2
3
const
{
image
}
=
await
generateImage
(
{
4
model
:
'bfl/flux-3-image'
,
5
prompt
:
'A blue ceramic vase with wildflowers on a sunlit wooden table.'
,
6
aspectRatio
:
'1:1'
,
7
providerOptions
:
{
8
blackForestLabs
:
{
resolution
:
'1k'
}
,
9
}
,
10
}
)
;使用 FLUX 3 Image 和 AI SDK 生成正方形 1K 分辨率图像。
要编辑图像,通过 prompt.images 传入图像并附上指令。以下示例编辑上方生成的图像:
code
1
const
{
image
:
editedImage
}
=
await
generateImage
(
{
2
model
:
'bfl/flux-3-image'
,
3
prompt
:
{
4
text
:
'Change the vase to terracotta and keep the flowers and setting.'
,
5
images
:
[
image
.
uint8Array
]
,
6
}
,
7
aspectRatio
:
'1:1'
,
8
providerOptions
:
{
9
blackForestLabs
:
{
resolution
:
'1k'
}
,
10
}
,
11
}
)
;在保留花卉和场景的前提下编辑生成的图像。
您也可以通过终端使用相同的 AI Gateway API 密钥和模型 ID 调用 FLUX 3 Image。
AI CLI
- 1 安装 AI CLI:npm install -g ai-cli
- 2 生成并保存图像:ai image 'A blue ceramic vase with wildflowers on a sunlit wooden table.' \ --model bfl/flux-3-image \ --output ./renders/
复制给代理
查看模型详情
↗
在模型游乐场尝试 FLUX 3 Image,或查阅图像生成指南。