跳转到内容

Train Flux LoRA

集成

模型 id flux-lora-fast-training
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/flux-lora-fast-training?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "images_data_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

与示例类似的文件: $2.00 2,000 API 积分 运行前会测量你的文件 在此页面运行

获取 API 密钥
Black Forest Labs 训练 快速 #lora#personalization

从图像压缩包训练 Flux LoRA,以学习人物、主体或样式

Black Forest Labs · 文件

你的第一个结果将在此显示

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存或免费保存 7 天。

构建请求

控件根据模型架构生成。更改控件时,代码和价格会同步更新。

•必填

通过 ZIP 存档 URL 提供图像,可选择为每张图像配对同名的说明文本文件。建议至少提供 4 张图像;通常图像集越大越好。

LoRA 的训练步数。

高级 trigger_word · data_archive_format · create_masks · is_style · is_input_format_already_preprocessed

当缺少说明时提供触发词作为说明替代;已有说明时不会使用 trigger_word。设为 None 可不使用触发词。

存档格式;省略时根据其 URL 推断。

POST /run/flux-lora-fast-training?wait=20 报价 → $2.00
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/flux-lora-fast-training?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "images_data_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Train Flux LoRA

根据图像压缩包(`images_data_url`)微调 LoRA,压缩包可包含匹配的标题文本文件。使用 `trigger_word` 命名概念;使用 `is_style` 进行样式训练,此时会关闭分割和标题生成。`create_masks` 会使损失更偏向主体,`steps` 接受 1 到 10000。返回 diffusers LoRA 权重和配置文件。

参数

名称类型 默认值允许值 描述
images_data_url必填
类型string
通过 ZIP 存档 URL 提供图像,可选择为每张图像配对同名的说明文本文件。建议至少提供 4 张图像;通常图像集越大越好。
trigger_word可选
类型string | null
当缺少说明时提供触发词作为说明替代;已有说明时不会使用 trigger_word。设为 None 可不使用触发词。
create_masks可选
类型boolean
默认值true
设为 True 可启用基于遮罩的训练损失加权;对于人物图像,此设置会尽可能使用人脸遮罩。
steps可选
类型integer | null
1 – 10,000
LoRA 的训练步数。
is_style可选
类型boolean
默认值false
设为 True 可启用风格训练,并通过触发词指定风格。在此模式下,触发词替代说明,分割功能被禁用。
is_input_format_already_preprocessed可选
类型boolean
默认值false
所提供数据的预处理状态:True 表示数据集已完成预处理。默认值 False 则要求原始图像/说明对具有匹配的基本名称,例如 'photo.jpg' 和 'photo.txt'。
data_archive_format可选
类型string | null
存档格式;省略时根据其 URL 推断。
必填

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "flux-lora-fast-training",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 2000,
    "usd": "2.00",
    "charged": 2000,
    "refunded": 0
  },
  "input": {
    "images_data_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "diffusers_lora_file": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "config_file": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "debug_preprocessed_output": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
diffusers_lora_file
object {url, content_type, file_name, file_size}指向 diffusers 格式训练后 LoRA 权重的 URL。
config_file
object {url, content_type, file_name, file_size}训练配置文件 URL。
debug_preprocessed_output
object {url, content_type, file_name, file_size} | null预处理后图像所在位置的 URL。

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/flux-lora-fast-training.md. 所有模型和指南: https://doitong.com/developers/llms.txt