imagestringbắt buộc
The URL of the image to edit. Provide one http(s) or data: URL.
Mặc định: ""
microsoft/mai-image-2.5-pro/editMai Image 2.5 Pro Edit by Microsoft - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.
Thử model
PNG, JPEG, WebP hoặc GIF · tối đa 20 MiB
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Sở thích con người
Điểm Elo từ các lượt bình chọn ẩn, so sánh với các mô hình hình ảnh và video khác.
Xếp hạng lấy từ Artificial Analysis Arena
Arena chỉnh sửa hình ảnh: người dùng chọn bản tốt hơn trong hai lần chỉnh sửa cùng một hình và cùng một hướng dẫn, không thấy tên model.
MAI Image 2.5 Pro edit: Microsoft's top image model for photoreal edits from an instruction.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 5,000 characters. |
image | image URL, required | — | Image to edit. JPEG, PNG, or WebP URL. |
output_format | jpeg / png | png | Output file format. |
aspect_ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 | — | Output shape. |
$0.29 per output image.
| Request | Price |
|---|---|
| One image | $0.29 |
Failed runs are not charged.
Related: microsoft/mai-image-2.5/edit.
Bắt đầu xây dựng
Gửi model này qua SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "microsoft/mai-image-2.5-pro/edit",
"image": "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png",
"prompt": "Turn this into a clean, futuristic product shot with soft studio lighting.",
"output_format": "png"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
imagestringbắt buộcThe URL of the image to edit. Provide one http(s) or data: URL.
Mặc định: ""
promptstringbắt buộcThe instruction describing how to edit the input image(s).
aspect_ratiostringThe aspect ratio of the generated image.
Giá trị có thể dùng: "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16"
output_formatstringThe format of the generated image.
Mặc định: "png"
Giá trị có thể dùng: "jpeg", "png"
{
"model": "microsoft/mai-image-2.5-pro/edit",
"image": "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png",
"prompt": "Turn this into a clean, futuristic product shot with soft studio lighting.",
"output_format": "png"
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
Chưa có đầu ra ví dụ nào được công bố. Dùng Playground → Result → JSON sau khi run hoàn tất để xem phản hồi của bạn.