flux-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Flux Image Generation

Flux 图片生成

Generate and edit images through AceDataCloud's Flux API.
Setup: See authentication for token setup.
通过AceDataCloud的Flux API生成和编辑图片。
设置: 请查看身份验证了解令牌设置方法。

Quick Start

快速开始

bash
curl -X POST https://api.acedata.cloud/flux/images \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a cat wearing a space helmet, photorealistic", "model": "flux-dev", "callback_url": "https://api.acedata.cloud/health"}'
Async: See async task polling. Poll via
POST /flux/tasks
with
{"id": "..."}
.
bash
curl -X POST https://api.acedata.cloud/flux/images \
  -H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a cat wearing a space helmet, photorealistic", "model": "flux-dev", "callback_url": "https://api.acedata.cloud/health"}'
异步处理: 请查看异步任务轮询。通过
POST /flux/tasks
接口并传入
{"id": "..."}
进行轮询。

Models

模型

ModelQualitySpeedSizesBest For
flux-dev
GoodFast256–1440pxQuick generation (default)
flux-pro
HighMedium256–1440pxProduction work
flux-2-klein
GoodFastest256–1440pxCompact / lowest-latency Flux 2 generation
flux-2-flex
HighFast256–1440pxFaster high-quality generation
flux-2-pro
HigherMedium256–1440pxBetter prompt following
flux-2-max
HighestSlow256–1440pxMaximum quality generation
flux-kontext-pro
HighMediumAspect ratiosImage editing
flux-kontext-max
HighestSlowAspect ratiosComplex editing
模型画质速度尺寸适用场景
flux-dev
良好快速256–1440px快速生成(默认)
flux-pro
中等256–1440px生产环境使用
flux-2-klein
良好最快256–1440px轻量/最低延迟的Flux 2生成
flux-2-flex
快速256–1440px更快的高质量生成
flux-2-pro
更高中等256–1440px更好的提示词遵循度
flux-2-max
最高缓慢256–1440px最高画质生成
flux-kontext-pro
中等宽高比图片编辑
flux-kontext-max
最高缓慢宽高比复杂编辑

Generate Images

生成图片

json
POST /flux/images
{
  "prompt": "a minimalist logo of a mountain",
  "action": "generate",
  "model": "flux-2-pro",
  "size": "1024x1024",
  "count": 1
}
json
POST /flux/images
{
  "prompt": "a minimalist logo of a mountain",
  "action": "generate",
  "model": "flux-2-pro",
  "size": "1024x1024",
  "count": 1
}

Size Options

尺寸选项

For dev/pro/flux-2 (pixel dimensions):
  • "1024x1024"
    ,
    "1344x768"
    ,
    "768x1344"
    ,
    "1024x576"
    ,
    "576x1024"
For kontext (aspect ratios):
  • "1:1"
    ,
    "16:9"
    ,
    "9:16"
    ,
    "4:3"
    ,
    "3:4"
    ,
    "3:2"
    ,
    "2:3"
    ,
    "21:9"
    ,
    "9:21"
适用于dev/pro/flux-2模型(像素尺寸):
  • "1024x1024"
    ,
    "1344x768"
    ,
    "768x1344"
    ,
    "1024x576"
    ,
    "576x1024"
适用于kontext模型(宽高比):
  • "1:1"
    ,
    "16:9"
    ,
    "9:16"
    ,
    "4:3"
    ,
    "3:4"
    ,
    "3:2"
    ,
    "2:3"
    ,
    "21:9"
    ,
    "9:21"

Edit Images

编辑图片

Use kontext models for text-guided image editing:
json
POST /flux/images
{
  "prompt": "change the background to a beach sunset",
  "action": "edit",
  "image_url": "https://example.com/photo.jpg",
  "model": "flux-kontext-pro"
}
使用kontext模型进行文本引导的图片编辑:
json
POST /flux/images
{
  "prompt": "change the background to a beach sunset",
  "action": "edit",
  "image_url": "https://example.com/photo.jpg",
  "model": "flux-kontext-pro"
}

Gotchas

注意事项

  • Use pixel dimensions (e.g.,
    "1024x1024"
    ) with dev/pro/flux-2 models, aspect ratios (e.g.,
    "16:9"
    ) with kontext models
  • Editing requires kontext models (
    flux-kontext-pro
    or
    flux-kontext-max
    ) — other models only support generation
  • count
    parameter generates multiple images in one request (increases cost proportionally)
  • flux-2-klein
    is the lightest Flux 2 model — useful when latency matters more than peak quality
  • flux-2-max
    produces highest quality but is slowest — use dev/klein/flex for iteration and max for final output
  • All generation is async — always set
    "callback_url"
    to get a task id immediately, then poll
    /flux/tasks
    using
    {"id":"<task_id>"}
    or
    {"ids":[...],"action":"retrieve_batch"}
MCP:
pip install mcp-flux-pro
| Hosted:
https://flux.mcp.acedata.cloud/mcp
| See all MCP servers
  • dev/pro/flux-2模型需使用像素尺寸(如
    "1024x1024"
    ),kontext模型需使用宽高比(如
    "16:9"
  • 图片编辑仅支持kontext模型(
    flux-kontext-pro
    flux-kontext-max
    )——其他模型仅支持生成功能
  • count
    参数可在单次请求中生成多张图片(成本会按比例增加)
  • flux-2-klein
    是最轻量的Flux 2模型——当延迟优先级高于峰值画质时适用
  • flux-2-max
    生成的画质最高但速度最慢——迭代阶段使用dev/klein/flex模型,最终输出使用max模型
  • 所有生成操作均为异步——请务必设置
    "callback_url"
    以立即获取任务ID,随后通过传入
    {"id":"<task_id>"}
    {"ids":[...],"action":"retrieve_batch"}
    调用
    /flux/tasks
    接口进行轮询
MCP:
pip install mcp-flux-pro
| 托管地址:
https://flux.mcp.acedata.cloud/mcp
| 查看所有MCP服务器