Chỉnh sửa hình ảnh
Sử dụng POST /v1/images/edits trong CometAPI để chỉnh sửa hình ảnh bằng multipart uploads, masks, mô hình ảnh GPT và các tùy chọn điều khiển đầu ra hình ảnh được mã hóa.
Sử dụng route này để chỉnh sửa các hình ảnh hiện có bằng multipart uploads tương thích OpenAI trên CometAPI.Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Sử dụng route này khi
- Bạn đã có một hình ảnh nguồn và muốn chỉnh sửa dựa trên Prompt
- Bạn có thể cần một mask để thực hiện các thay đổi có mục tiêu
- Bạn có thể xử lý tải tệp multipart thay vì một yêu cầu JSON thuần
Yêu cầu đầu tiên an toàn
- Bắt đầu với một tệp PNG hoặc JPG
- Bỏ qua mask cho đến khi luồng chỉnh sửa cơ bản hoạt động
- Sử dụng
model: "gpt-image-2"cho các yêu cầu chỉnh sửa ảnh GPT trên route này - Sử dụng một hướng dẫn ngắn yêu cầu một thay đổi hiển thị duy nhất
- Đọc kết quả đã chỉnh sửa từ
data[0].b64_json - Đặt
output_format: "jpeg"khi bạn muốn payload JPEG - Dự kiến độ trễ dài hơn so với tạo hình ảnh thông thường
Hành vi của model
- Các model chỉnh sửa ảnh GPT trên route này trả về dữ liệu hình ảnh base64 nội tuyến
output_formatđiều khiển loại hình ảnh được mã hóa bên trongb64_jsonresponse_formatchỉ quan trọng khi một model hỗ trợ đầu ra URLqwen-image-edittuân theo hành vi chỉnh sửa dành riêng cho provider phía sau cùng một route CometAPI
Ủy quyền
Bearer token authentication. Use your CometAPI key.
Nội dung
Source image file. Start with one PNG or JPG input for the simplest flow.
Edit instruction describing the change you want.
"Add a small red ribbon to the paper boat."
The image editing model to use. Choose a supported model from the Models page.
Optional PNG mask. Transparent areas indicate regions that should be edited.
Number of edited images to return.
Quality setting for models that support it.
high, medium, low Requested response container when supported by the selected model. GPT image edit models return data[].b64_json; use output_format to choose the encoded image type.
url, b64_json Encoded image type for GPT image edit results returned in data[].b64_json. For example, use jpeg for a JPEG payload.
"jpeg"
Requested output size when supported by the selected model.