{
"input": "http(s)://{public_url}/image.png" |
"storage://{storage_name}/{image_folder}/image.png",
"operations": {
"restorations": {
"decompress": null |
"moderate" | "strong" | "auto",
"upscale": null |
"smart_enhance" | "smart_resize" | "faces" |
"digital_art" | "photo",
"polish": false | true
},
"resizing": null | {
"width": null | "auto" | 500 | "150%",
"height": null | "auto" | 500 | "150%",
"fit": "bounds" | "cover" | "canvas" | "outpaint" | "crop" |
{"crop": "center" | "smart"}
},
"adjustments": null | {
"hdr": 0 | {"intensity": 0, "stitching": true | false},
"exposure": 0,
"saturation": 0,
"contrast": 0,
"sharpness": 0
},
"background": null | {
"remove": false | true | {
"category": "general" | "cars" | "products",
"clipping": false | true
},
"blur": false | true | {
"category": "general" | "cars" | "products",
"type": "regular" | "lens",
"level": "low" | "medium" | " high"
}
"color": "#ffffff" | "<color-hex>" | "transparent"
},
"padding": null | "10%" | "5% 25%",
"privacy": {
"blur_car_plate": false | true
}
},
"output": null | "storage://{storage_name}/{image_folder}/image.jpeg" | {
"destination": null | "storage://{storage_name}/{image_folder}/image.jpeg",
"metadata": null | {"dpi": null | 300},
"format": "jpeg" | "png" | "webp" | "avif" | {
"type": "jpeg",
"quality": 85, // format-specific options
"progressive": true | false
} | {
"type": "png",
"compression": "fast" | "best" | "optimal"
} | {
"type": "webp" | "avif",
"compression": {
"type": "lossy" | "lossless",
"quality": 90
}
}
}
}https://api.claid.ai/v1-beta1/image/edit您将收到有关输入和输出图像的信息的响应。| 范围 | 类型 | 描述 |
|---|---|---|
| 扩展 | 细绳 | 文件扩展名。可以有以下值:jpg,,,png``webp``av1 |
| 议员 | 整数 | 百万像素数 |
| 哑剧 | 细绳 | MIME 类型(也称为“媒体类型”) |
| 宽度 | 整数 | 图像宽度(以像素为单位) |
| 高度 | 整数 | 图像高度(以像素为单位) |
| 格式 | 细绳 | 文件格式。可以有以下值:jpeg,,,png``webp``avif |
| 临时网址 | 细绳 | 已处理图像的临时 URL。* |
curl --location --request POST 'http://dev-cn.your-api-server.com/v1-beta1/image/edit' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": "https://claid.ai/assets/cms/shoe_example_05fb154a3a/shoe_example_05fb154a3a.png",
"operations": {
"resizing": {
"width": 1000
},
"background": {
"remove": false
}
}
}'{
"data": {
"input": {
"ext": "png",
"mps": 0.125,
"mime": "image/png",
"width": 500,
"format": "PNG",
"height": 250
},
"output": {
"ext": "png",
"mps": 0.431,
"mime": "image/jpeg",
"width": 1000,
"format": "JPEG",
"height": 431,
"tmp_url": "https://storage.googleapis.com/production-leapi-tmp-public/733a7c8f-1fea-4097-8fd4-17f54c94d998/shoe_example_05fb154a3a.png"
}
}
}