增强放大
POST /v1/enhance — AI 超分辨率放大
用 AI 超分辨率放大图片,输出始终为 PNG。
POST https://patentfig.ai/api/v1/enhance每次调用消耗 20 积分。
参数
图片输入遵循共用约定(JSON imageUrl 或 multipart file)。
| 字段 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
imageUrl / file | string / file | 是 | — | 待放大的图片。 |
scale | 2 | 4 | 否 | 2 | 输出像素尺寸 = 输入 × scale。 |
dpi | 300 | 600 | 否 | 300 | 写入输出文件的 density 元数据。仅元数据,不影响像素尺寸。 |
scale 管像素,dpi 管部分递交系统会检查的密度元数据,二者相互独立。
请求
curl -X POST https://patentfig.ai/api/v1/enhance \
-H "Authorization: Bearer pfig_xxx" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/figure.png",
"scale": 4,
"dpi": 600
}'响应
{
"success": true,
"data": {
"url": "https://cdn.patentfig.ai/api/…/….png",
"scale": 4,
"dpi": 600,
"width": 4096,
"height": 3072,
"creditsConsumed": 20
}
}错误
常见:INVALID_INPUT(400)、FETCH_FAILED(422)、INSUFFICIENT_CREDITS(402)、GENERATION_FAILED(500)。详见错误参考。
PatentFig AI 文档