Bỏ qua đến nội dung

FLUX.1 Kontext [pro]

Tích hợp

Id mô hình flux-pro/kontext
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/flux-pro/kontext?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Restore and colorize this image. Remove any scratches or imperfections.",
    "image": "https://content.doitong.com/dev-api/2026/10/21/req_nwh4ychmr6vyovvas0hhcxcx/0-dNCNdO5QkD7jDyRi24Z8s_L3lpa0jm.png"
  }'

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

Yêu cầu này: 0,04 $ 40 tín dụng API Chạy trên trang này

Lấy khóa API
Black Forest Labs Chỉnh sửa hình ảnh #editing#local-edits#consistency

Chỉnh sửa cục bộ chính xác từ một ảnh tham chiếu, như đổi màu, thêm vật thể hoặc viết lại văn bản.

Ví dụ

Đầu vào
Đầu ra · ~11 s
Restore and colorize this image. Remove any scratches or imperfections.

Lời nhắcRestore and colorize this image. Remove any scratches or imperfections.

0,04 $ · 40 tín dụng API

Lời nhắc từ @MrDavids1 trên X

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

Lời nhắc định hướng việc tạo sinh hình ảnh.

•bắt buộc image_url
Thả tệp hoặc

Hình ảnh được sử dụng để tạo lời nhắc cho mô hình omni.

aspect_ratio

Tỷ lệ khung hình của hình ảnh kết quả.

num_images mặc định 1

Số lượng hình ảnh yêu cầu tạo sinh.

Nâng cao output_format · safety_tolerance · guidance_scale · seed · enhance_prompt
output_format mặc định jpeg

Định dạng tệp của hình ảnh kết quả.

safety_tolerance mặc định 2

Thiết lập an toàn cho hình ảnh đã tạo, với mức dung nạp từ thoải mái tối đa ở 5 đến nghiêm ngặt tối đa ở 1.

mặc định 3.5

Mức độ tuân thủ lời nhắc khi chọn hình ảnh, được biểu thị bằng CFG (Classifier Free Guidance).

Seed cho hình ảnh có thể tái tạo: lời nhắc và seed giống hệt nhau sẽ tạo ra hình ảnh giống hệt khi phiên bản mô hình không đổi.

POST /run/flux-pro/kontext?wait=20 báo giá → 0,04 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/flux-pro/kontext?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Restore and colorize this image. Remove any scratches or imperfections.",
    "image": "https://content.doitong.com/dev-api/2026/10/21/req_nwh4ychmr6vyovvas0hhcxcx/0-dNCNdO5QkD7jDyRi24Z8s_L3lpa0jm.png"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/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

Đượ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.1 Kontext. 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...

Giới thiệu về FLUX.1 Kontext [pro]

FLUX.1 Kontext chỉnh sửa một hình ảnh đầu vào duy nhất theo hướng dẫn ngắn trong khi giữ nguyên phần còn lại của hình ảnh không thay đổi, phù hợp cho chỉnh sửa lặp lại, biến thể sản phẩm và thay thế văn bản trên biển hiệu. Có thể tùy chọn ép tỷ lệ khung hình mới, nâng cao lời nhắc hoặc cố định seed. Tối đa bốn kết quả mỗi yêu cầu.

Tham số

Gửi tên chuẩn hoặc tên gốc, không gửi cả hai. Tên chuẩn

TênKiểu Mặc địnhĐược phép Mô tả
promptbắt buộc
Kiểustring
Lời nhắc định hướng việc tạo sinh hình ảnh.
seedtùy chọn
Kiểuinteger | null
Seed cho hình ảnh có thể tái tạo: lời nhắc và seed giống hệt nhau sẽ tạo ra hình ảnh giống hệt khi phiên bản mô hình không đổi.
guidance_scaletùy chọn
Kiểunumber
Mặc định3.5
1 – 20
Mức độ tuân thủ lời nhắc khi chọn hình ảnh, được biểu thị bằng CFG (Classifier Free Guidance).
num_imagestùy chọn num_outputs
Kiểuinteger
Mặc định1
1 – 4
Số lượng hình ảnh yêu cầu tạo sinh.
output_formattùy chọn
Kiểuenum
Mặc địnhjpeg
jpegpng
Định dạng tệp của hình ảnh kết quả.
safety_tolerancetùy chọn
Kiểuenum
Mặc định2
123456
Thiết lập an toàn cho hình ảnh đã tạo, với mức dung nạp từ thoải mái tối đa ở 5 đến nghiêm ngặt tối đa ở 1.
enhance_prompttùy chọn
Kiểuboolean
Mặc địnhfalse
Kiểm soát việc tăng cường lời nhắc để cải thiện kết quả.
aspect_ratiotùy chọn
Kiểuenum
21:916:94:33:21:12:33:49:169:21
Tỷ lệ khung hình của hình ảnh kết quả.
image_urlbắt buộc image
Kiểuurl · image
Hình ảnh được sử dụng để tạo lời nhắc cho mô hình omni.
bắt buộc Tên chuẩn, cũng được chấp nhận

Các tham số tệp nhận URL https:// công khai, URI data: tối đa 10 MB hoặc file_url của một tệp tải lên. Tệp

Đầu ra

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "flux-pro/kontext",
  "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": 40,
    "usd": "0.04",
    "charged": 40,
    "refunded": 0
  },
  "input": {
    "prompt": "Change the sneaker color to bright red, keep everything else the same",
    "image": "https://content.doitong.com/images/showcase/v3/gen_sneaker_ad.jpg"
  },
  "output": {
    "images": [
      {
        "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,
        "width": 1024,
        "height": 768
      }
    ],
    "timings": {},
    "seed": 42,
    "has_nsfw_concepts": [
      false
    ],
    "prompt": "string"
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/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
images
array of object {url, content_type, file_name, file_size, width, height}Thông tin tệp của các hình ảnh được tạo.
timings
object
seed
integerSeed tạo sinh hình ảnh, bao gồm giá trị được chọn ngẫu nhiên nếu đầu vào không cung cấp seed; nếu không, lặp lại giá trị đã cung cấp.
has_nsfw_concepts
array of booleanCho biết các khái niệm NSFW có xuất hiện trong hình ảnh được tạo sinh hay không.
prompt
stringLời nhắc được sử dụng trong quá trình tạo sinh hình ảnh.

Thêm mô hình: Chỉnh sửa hình ảnh

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