跳转到内容

Train Flux LoRAs For Portraits

集成

模型 id flux-lora-portrait-trainer
# 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-portrait-trainer?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"

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

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

针对人像优化的 FLUX LoRA 训练器,支持主体裁剪和检查点续训

Black Forest Labs · 文件

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

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

构建请求

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

•必填

提供风格一致图像的 ZIP 存档 URL,可选择附带与图像同名的说明文本文件。说明文本可以包含 `[trigger]`;指定 trigger_word 会将该占位符替换为其值。建议至少提供 10 张图像,通常图像越多越好。

默认 2500

LoRA 的训练步数。

高级 trigger_phrase · data_archive_format · resume_from_checkpoint · learning_rate · multiresolution_training · subject_crop · create_masks

提供触发短语,用于替换现有说明中的 `[trigger]`,或在没有说明时充当说明(trigger_work)。None 会禁用触发词。

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

默认

用于恢复训练的检查点 URL。

默认 9.0e-05

训练期间应用的学习率。

POST /run/flux-lora-portrait-trainer?wait=20 报价 → $6.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-portrait-trainer?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 LoRAs For Portraits

从 `images_data_url` 中的图像压缩包训练面向人像的 LoRA;建议至少提供 10 张图像。选项包括 `trigger_phrase`、`learning_rate`(1e-6 到 0.001)、`steps`(默认 2500,最大 10000)、`subject_crop`、多分辨率训练和 `resume_from_checkpoint`。返回权重和配置。

参数

名称类型 默认值允许值 描述
images_data_url必填
类型string
提供风格一致图像的 ZIP 存档 URL,可选择附带与图像同名的说明文本文件。说明文本可以包含 `[trigger]`;指定 trigger_word 会将该占位符替换为其值。建议至少提供 10 张图像,通常图像越多越好。
trigger_phrase可选
类型string | null
提供触发短语,用于替换现有说明中的 `[trigger]`,或在没有说明时充当说明(trigger_work)。None 会禁用触发词。
learning_rate可选
类型number
默认值9.0e-05
0.000001 – 0.001
训练期间应用的学习率。
steps可选
类型integer
默认值2500
1 – 10,000
LoRA 的训练步数。
multiresolution_training可选
类型boolean
默认值true
为 True 时启用多分辨率训练。
subject_crop可选
类型boolean
默认值true
为 True 时启用从图像中裁剪主体。
data_archive_format可选
类型string | null
存档格式;省略时根据其 URL 推断。
resume_from_checkpoint可选
类型string
默认值
用于恢复训练的检查点 URL。
create_masks可选
类型boolean
默认值false
为 True 时启用主体遮罩创建。
必填

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "flux-lora-portrait-trainer",
  "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": 6000,
    "usd": "6.00",
    "charged": 6000,
    "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
    }
  },
  "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。

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