Bỏ qua đến nội dung

Flux Kontext Trainer

Tích hợp

Id mô hình flux-kontext-trainer
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/flux-kontext-trainer?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_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://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Các tệp như ví dụ: 2,50 $ 2.500 tín dụng API · ≈ 263,66 ₽ tệp của bạn được đo trước khi chạy Chạy trên trang này

Lấy khóa API
Black Forest Labs Huấn luyện

Huấn luyện LoRA Kontext [dev] từ tệp zip chứa các cặp ảnh đầu và cuối

Được tạo trên Doitong

Các tác phẩm công khai được cộng đồng Doitong tạo bằng Flux Kontext Trainer. Tái sử dụng một lời nhắc chỉ với một lần nhấp.

Tác phẩm công khai được hiển thị: 9
Close-up portrait seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lemb...

Close-up portrait seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lembut kebiruan, dikelilingi bunga teratai berkelopak penuh yang bermekaran indah di permukaan air. Rambutnya pirang pucat tersanggul longgar dengan beberapa helaian tipis jatuh alami membingkai sisi...

Close-up portrait seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lemb...

Close-up portrait seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lembut kebiruan, dikelilingi bunga teratai berkelopak penuh yang bermekaran indah di permukaan air. Rambutnya pirang pucat tersanggul longgar dengan beberapa helaian tipis jatuh alami membingkai sisi...

Prompt Details Seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lembut ...

Prompt Details Seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lembut kebiruan, dikelilingi bunga teratai berkelopak penuh yang bermekaran indah di permukaan air. Rambutnya pirang pucat tersanggul longgar dengan beberapa helaian tipis jatuh alami membingkai sisi...

Seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lembut kebiruan, dikel...

Seorang wanita berkulit pucat berdiri setengah tubuh di dalam air berwarna lembut kebiruan, dikelilingi bunga teratai berkelopak penuh yang bermekaran indah di permukaan air. Rambutnya pirang pucat tersanggul longgar dengan beberapa helaian tipis jatuh alami membingkai sisi wajahnya. Ia memeluk...

​"Potret sinematik ultra-realistis close-up seorang anak laki-laki kecil (balita) yang sangat men...

​"Potret sinematik ultra-realistis close-up seorang anak laki-laki kecil (balita) yang sangat menggemaskan dengan mata cokelat besar yang ekspresif, rambut hitam berantakan yang tebal, mengenakan kaus putih kerah henley. Dia berpose dengan kedua tangan terkatup di depan dada, menunjukkan senyum...

​"Potret sinematik ultra-realistis close-up seorang anak laki-laki kecil (balita) yang sangat men...

​"Potret sinematik ultra-realistis close-up seorang anak laki-laki kecil (balita) yang sangat menggemaskan dengan mata cokelat besar yang ekspresif, rambut hitam berantakan yang tebal, mengenakan kaus putih kerah henley. Dia berpose dengan kedua tangan terkatup di depan dada, menunjukkan senyum...

​"Potret sinematik ultra-realistis close-up seorang anak laki-laki kecil (balita) yang sangat men...

​"Potret sinematik ultra-realistis close-up seorang anak laki-laki kecil (balita) yang sangat menggemaskan dengan mata cokelat besar yang ekspresif, rambut hitam berantakan yang tebal, mengenakan kaus putih kerah henley. Dia berpose dengan kedua tangan terkatup di depan dada, menunjukkan senyum...

Foto sinematik hiper-realistis resolusi tinggi menampilkan seorang pria muda Indonesia dengan tub...

Foto sinematik hiper-realistis resolusi tinggi menampilkan seorang pria muda Indonesia dengan tubuh ramping dan proporsional, rambut hitam pendek agak acak, mengenakan jaket kulit hitam, celana riding fit, dan sepatu motor. Ia sedang melakukan aksi freestyle ekstrem dengan motor sport 500cc...

Tạo một yêu cầu

Các điều khiển được tạo từ lược đồ mô hình. Mã và giá sẽ cập nhật khi bạn thay đổi chúng.

•bắt buộc

URL kho lưu trữ ZIP đầu vào; kho lưu trữ phải chứa các cặp hình ảnh có tên ROOT_start.EXT và ROOT_end.EXT, chẳng hạn photo_start.jpg và photo_end.jpg. Mỗi cặp cũng có thể có tệp ROOT.txt, chẳng hạn photo.txt, chứa hướng dẫn chỉnh sửa. Khi thiếu tệp văn bản đó, default_caption sẽ cung cấp hướng dẫn; quá trình huấn luyện thất bại nếu default_caption cũng bị thiếu.

mặc định 1000

Tổng số bước huấn luyện.

Nâng cao default_caption · learning_rate

Chú thích dùng thay cho tệp chú thích bị thiếu; None sẽ khiến việc thiếu tệp trở thành lỗi.

mặc định 0.0001
POST /run/flux-kontext-trainer?wait=20 báo giá → 2,50 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/flux-kontext-trainer?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_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://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Chạy yêu cầu này

Key của bạn vẫn nằm trong trình duyệt này: key chỉ được gửi đến Doitong API và chỉ được lưu trong localStorage nếu bạn chọn Ghi nhớ. Nhận khóa API

Giới thiệu về Flux Kontext Trainer

Tinh chỉnh LoRA cho Kontext trên các ví dụ trước/sau theo cặp. `image_data_url` trỏ tới tệp zip chứa các tệp có tên ROOT_start.EXT và ROOT_end.EXT. Có thể đặt `steps` từ 1 đến 10000 (mặc định 1000), `learning_rate` và `default_caption` cho các cặp không có tệp chú thích. Trả về trọng số LoRA và tệp cấu hình.

Tham số

TênKiểu Mặc địnhĐược phép Mô tả
image_data_urlbắt buộc
Kiểustring
URL kho lưu trữ ZIP đầu vào; kho lưu trữ phải chứa các cặp hình ảnh có tên ROOT_start.EXT và ROOT_end.EXT, chẳng hạn photo_start.jpg và photo_end.jpg. Mỗi cặp cũng có thể có tệp ROOT.txt, chẳng hạn photo.txt, chứa hướng dẫn chỉnh sửa. Khi thiếu tệp văn bản đó, default_caption sẽ cung cấp hướng dẫn; quá trình huấn luyện thất bại nếu default_caption cũng bị thiếu.
stepstùy chọn
Kiểuinteger
Mặc định1000
1 – 10.000
Tổng số bước huấn luyện.
learning_ratetùy chọn
Kiểunumber
Mặc định0.0001
default_captiontùy chọn
Kiểustring | null
Chú thích dùng thay cho tệp chú thích bị thiếu; None sẽ khiến việc thiếu tệp trở thành lỗi.
bắt buộc

Đầu ra

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "flux-kontext-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": 2500,
    "usd": "2.50",
    "charged": 2500,
    "refunded": 0
  },
  "input": {
    "image_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://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Tệp của bạn, lựa chọn của bạnMỗi outputs[].url là một bản sao trên bộ lưu trữ của chúng tôi: được giữ vĩnh viễn (tính phí theo GB-tháng) hoặc 7 ngày miễn phí, theo cài đặt tài khoản hoặc ?storage=.
Cùng một cấu trúc trên mọi mô hìnhtype, url, content_type, width, height và duration cho hình ảnh, video và âm thanh. output là đối tượng kết quả riêng của mô hình.
Các trường đầu ra
diffusers_lora_file
object {url, content_type, file_name, file_size}URL trỏ đến trọng số LoRA đã huấn luyện ở định dạng diffusers.
config_file
object {url, content_type, file_name, file_size}URL trỏ đến tệp cấu hình của mô hình đã huấn luyện.

Dành cho tác nhân AI: trang này ở dạng Markdown tại https://doitong.com/vi/developers/models/flux-kontext-trainer.md. Tất cả mô hình và hướng dẫn: https://doitong.com/developers/llms.txt