跳至內容

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

從你的影像 zip 訓練 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

從影像的 zip 封存檔(`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-TW/developers/models/flux-lora-fast-training.md. 所有模型與指南: https://doitong.com/developers/llms.txt