Bỏ qua đến nội dung

FLUX 2 Pro Outpaint

Tích hợp

Id mô hình flux-2-pro/outpaint
# 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-2-pro/outpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

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

Lấy 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 2. 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 image_url
Thả tệp hoặc

URL của hình ảnh nguồn để mở rộng outpainting.

Nâng cao mode · output_format · expand_top · expand_bottom · expand_left · expand_right · auto_crop · enable_safety_checker
mode mặc định high

Lựa chọn chất lượng và tốc độ outpainting: `fast` mở rộng tốt hầu hết các cảnh và chạy nhanh hơn đáng kể, nhưng độ trung thực có thể giảm. Để có độ trung thực cao nhất, dùng `high`, là giá trị mặc định.

output_format mặc định jpeg

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

mặc định 0

Số pixel được thêm phía trên hình ảnh.

mặc định 0

Số pixel được thêm phía dưới hình ảnh.

mặc định 0

Số pixel được thêm dọc theo cạnh trái hình ảnh.

mặc định 0

Số pixel được thêm dọc theo cạnh phải hình ảnh.

POST /run/flux-2-pro/outpaint?wait=20 báo giá → 0,40 $
# 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-2-pro/outpaint?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "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.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

Giới thiệu về FLUX 2 Pro Outpaint

Mở rộng ảnh nguồn (`image_url`) bằng cách tạo nội dung mới bên ngoài các cạnh. Sử dụng `expand_top`, `expand_bottom`, `expand_left` và `expand_right`, mỗi tham số từ 0 đến 2048 pixel. `mode` là `high` để đạt độ trung thực cao nhất hoặc `fast` để có kết quả nhanh hơn, còn `auto_crop` xử lý các ảnh tham chiếu không vừa với canvas mới. Đầu ra là jpeg hoặc png.

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ả
image_urlbắt buộc image
Kiểuurl · image
URL của hình ảnh nguồn để mở rộng outpainting.
expand_toptùy chọn
Kiểuinteger
Mặc định0
0 – 2.048
Số pixel được thêm phía trên hình ảnh.
expand_bottomtùy chọn
Kiểuinteger
Mặc định0
0 – 2.048
Số pixel được thêm phía dưới hình ảnh.
expand_lefttùy chọn
Kiểuinteger
Mặc định0
0 – 2.048
Số pixel được thêm dọc theo cạnh trái hình ảnh.
expand_righttùy chọn
Kiểuinteger
Mặc định0
0 – 2.048
Số pixel được thêm dọc theo cạnh phải hình ảnh.
auto_croptùy chọn
Kiểuboolean
Mặc địnhfalse
Tùy chọn tự động cắt các phần của hình ảnh tham chiếu nằm ngoài canvas đã mở rộng.
modetùy chọn
Kiểuenum
Mặc địnhhigh
highfast
Lựa chọn chất lượng và tốc độ outpainting: `fast` mở rộng tốt hầu hết các cảnh và chạy nhanh hơn đáng kể, nhưng độ trung thực có thể giảm. Để có độ trung thực cao nhất, dùng `high`, là giá trị mặc định.
enable_safety_checkertùy chọn
Kiểuboolean
Mặc địnhtrue
Công tắc kiểm tra an toàn; cài đặt tắt chỉ được chấp nhận đối với tài khoản được cấp quyền. Mọi yêu cầu không có quyền đó đều phải trải qua kiểm tra an toàn.
output_formattùy chọn
Kiểuenum
Mặc địnhjpeg
jpegpng
Định dạng tệp của hình ảnh kết quả.
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-2-pro/outpaint",
  "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": 400,
    "usd": "0.40",
    "charged": 400,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.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
      }
    ]
  },
  "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}Các hình ảnh được tạo qua outpainting.

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-2-pro/outpaint.md. Tất cả mô hình và hướng dẫn: https://doitong.com/developers/llms.txt