Kontext Dev 定价
仅对成功生成收费
Flux Kontext API
$0.02/img /image
Developer-ready API access
示例用例
看看 Flux Kontext 在不同模型与场景中的能力
背景替换
在保持主体位置与光照一致性的同时自然替换背景
文字替换
精准编辑产品与品牌素材中的文字,同时保留字体风格与设计元素
产品品牌更新
在保留原始排版、布局与设计完整性的同时更新品牌名称
发型变化
在保持面部特征与整体构图的前提下完成发型转换
水彩风格
将照片变成充满真实笔触与纸张质感的水彩作品
90 年代卡通风格
将真实照片转换为拥有粗线条和平涂色彩的复古卡通画面
如何使用
Create your API key
Sign up and grab an API key from the PiAPI workspace — free credits are included on sign-up.
Top up credits
Add credits on the billing page when you are ready to scale beyond the free tier.
Call the API
POST your first task following the API docs, then poll the task until the result is ready.
Iterate in the playground
Prototype prompts and settings in the the playground above before wiring them into your product.
curl -X POST 'https://api.piapi.ai/api/v1/task' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "Qubico/flux1-dev-advanced",
"task_type": "kontext",
"input": {
"prompt": "Transform this product photo into a refined watercolor editorial.",
"width": 1024,
"height": 1024
}
}'
# → { "task_id": "9d5a…", "status": "pending" }curl 'https://api.piapi.ai/api/v1/task/{task_id}' \
-H 'X-API-Key: YOUR_API_KEY'
# poll until status = completed
{
"data": {
"status": "completed",
"output": {
"image_url": "https://img.theapi.app/ephemeral/…"
}
}
}$ npm install -g piapi-cli $ piapi run flux-kontext \ prompt="Transform this product photo into a refined watercolor editorial." \ width=1024 \ height=1024 ✓ Task completed! https://img.theapi.app/ephemeral/…
常见问题
什么是 Flux Kontext API?
Flux Kontext API 是一个强大的图像到图像编辑服务,你可以通过自然语言提示来转换图像。它提供 Pro、Max 和 Dev 等多种模型版本,在速度与质量之间提供不同取舍。API 支持风格迁移、对象修改、背景替换、文字编辑等多种任务。它由 Black Forest Labs 打造,通过简单的 REST API 调用即可提供可用于生产环境的 AI 图像编辑能力。
Flux Kontext 可以用于商业项目吗?
可以。所有 Kontext 模型都附带完整的商业使用权,你可以将它们集成到自己的产品、服务和客户项目中,无需额外授权费用或限制。
支持退款吗?
不,我们不提供退款。但当您首次在 PiAPI 的 Workspace 注册账户时,将获得免费积分,可以在付款前试用我们的 API!
支持哪些图像格式?
Kontext 支持常见图像格式,包括 JPEG、PNG 和 WebP。为了获得最佳性能,输入图像建议小于 10MB。默认情况下输出格式与输入格式一致,也可以在 API 请求中指定。
有速率限制吗?
速率限制取决于你的套餐和使用模式。免费用户的限制较低,付费用户可获得更高吞吐量。如果你有高并发需求,可以联系我们了解企业计划、自定义速率限制和专属基础设施。
More questions? See the API docs.
Our blog
Flux Kontext API



