随风api 文档

图片处理 API

已接入图片矢量化和九种图片放大接口。所有接口由本站统一鉴权、转发、按次扣费。

POST multipart/form-data / JSON 国内稳定线路 按次扣费 渠道可改价

调用时必须使用已开通图片处理权限的站内 API Key。成功请求会按图片处理渠道里对应工具的按次价格扣费。

接口列表

功能Endpoint计费说明
图片矢量化 POST /image-tools/vectorize 读取中... 位图转 SVG,平均 10-20 秒。
图片放大 POST /image-tools/upscale 读取中... Real-ESRGAN,平均 8-10 秒。
图片放大 V2 POST /image-tools/upscale-v2 读取中... GFPGAN,平均 8-10 秒。
图片放大 V3 POST /image-tools/upscale-v3 读取中... ESRGAN,平均 8-10 秒。
图片放大 V4(快速放大v4) POST /image-tools/upscale-v4 读取中... GigaGAN,平均 8-10 秒。
图片放大 V5 POST /image-tools/upscale-v5 读取中... SeedVR,JSON 请求,平均 8-10 秒。
图片放大 V6 POST /image-tools/upscale-v6 读取中... JSON 请求,平均 15-30 秒。
快速图片放大 POST /image-tools/upscale-fast 读取中... JSON 请求,平均 15-30 秒。
超级图片放大 POST /image-tools/super-upscale 读取中... AI 补充细节,适合低清图片高清化,平均 10-30 秒。
查询超级图片放大任务 GET /image-tools/tasks/{task_id} 不单独扣费 使用提交接口返回的任务 ID 查询任务状态和输出结果;兼容 /image-tools/super-upscale/tasks/{task_id}/fetch
超级图片放大 V2 POST /image-tools/super-upscale-v2 读取中... JSON 请求,AI 补充细节,适合低清图片高清化,平均 10-30 秒。

请求参数

通用 Header

字段位置必填说明
AuthorizationHeaderBearer YOUR_API_KEY,使用已开通图片处理权限的本站 API Key。

图片矢量化

字段位置必填说明
fileForm Data要矢量化的图片文件,建议 PNG/JPG。
response_formatForm Dataurlb64_json,建议传 url

Upscale

字段位置必填说明
imageForm Data要放大的图片文件。
scaleForm Data0-10,默认 4。
face_enhanceForm Data人脸增强,默认开。

Upscale-V2

字段位置必填说明
imgForm Data要放大的图片文件。
scaleForm Data0-10,默认 4。

Upscale-V3

字段位置必填说明
image_urlForm Data上传图片文件或图片 URL 字符串,字段名沿用上游接口。
faceForm Data是否包含人脸。
scaleForm Data放大倍数,例如 4。

Upscale-V4(快速放大v4)

字段位置必填说明
image_urlForm Data上传图片文件或图片 URL 字符串。
checkpointForm Data版本,可传 v1v2,默认建议 v2
upscaling_factorForm Data放大倍数,只能为 4

Upscale-V5

字段位置必填说明
Content-TypeHeaderapplication/json
image_urlJSON Body图片 URL 字符串。
upscale_factorJSON Body放大倍数,1-4。

Upscale-V6

字段位置必填说明
Content-TypeHeaderapplication/json
image_urlJSON Body图片 URL 字符串。
scale_factorJSON Body放大倍数,1-4。

快速图片放大

字段位置必填说明
Content-TypeHeaderapplication/json
image_urlJSON Body图片 URL 字符串。
scaleJSON Body放大倍数,1-4。

超级图片放大

字段位置必填说明
imageForm Data要超级放大的图片文件。
scale_factorForm Data放大倍数,默认 2。
promptForm Data画面提示词,用于引导补充细节。
negative_promptForm Data不希望出现在画面的提示词。
dynamicForm DataHDR 效果,3-9,默认 6。
creativityForm DataAI 想象空间,0.3-0.9,默认 0.35。
resemblanceForm Data与原图相似度,0.3-1.6,默认 0.6。

查询超级图片放大任务

超级图片放大可能先返回 starting。提交响应会包含 status_urlresult_urlfetch_url,前端按 status_url 轮询即可。

字段位置必填说明
task_idPath提交超级图片放大接口返回的任务 ID。

超级图片放大 V2

字段位置必填说明
Content-TypeHeaderapplication/json
model_typeJSON Body模型类型,例如 SDXL
image_urlJSON Body图片 URL 字符串。
scaleJSON Body放大倍数,例如 3。
creativityJSON BodyAI 想象空间,例如 0.2。
detailJSON Body细节强度,例如 2。
shape_preservationJSON Body形状保留强度,例如 0.1。
prompt_suffixJSON Body追加提示词。
negative_promptJSON Body不希望出现在画面的提示词。
guidance_scaleJSON Body提示词引导强度,例如 7.5。
num_inference_stepsJSON Body推理步数,例如 20。
override_size_limitsJSON Body是否覆盖尺寸限制,布尔值。

cURL 示例

# 图片矢量化
curl https://ai.cozesf.cc/image-tools/vectorize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@image.png" \
  -F "response_format=url"

# Upscale
curl https://ai.cozesf.cc/image-tools/upscale \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@image.png" \
  -F "scale=4" \
  -F "face_enhance=true"

# Upscale-V2
curl https://ai.cozesf.cc/image-tools/upscale-v2 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "img=@image.png" \
  -F "scale=4"

# Upscale-V3
curl https://ai.cozesf.cc/image-tools/upscale-v3 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image_url=@image.png" \
  -F "face=true" \
  -F "scale=4"

# Upscale-V4(快速放大v4)
curl https://ai.cozesf.cc/image-tools/upscale-v4 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image_url=@image.png" \
  -F "checkpoint=v2" \
  -F "upscaling_factor=4"

# Upscale-V5
curl https://ai.cozesf.cc/image-tools/upscale-v5 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://example.com/image.png","upscale_factor":4}'

# Upscale-V6
curl https://ai.cozesf.cc/image-tools/upscale-v6 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://example.com/image.png","scale_factor":4}'

# 快速图片放大
curl https://ai.cozesf.cc/image-tools/upscale-fast \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_url":"https://example.com/image.png","scale":4}'

# 超级图片放大
curl https://ai.cozesf.cc/image-tools/super-upscale \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@image.png" \
  -F "scale_factor=2" \
  -F "prompt=restore details, clean texture" \
  -F "negative_prompt=blur, noise" \
  -F "dynamic=6" \
  -F "creativity=0.35" \
  -F "resemblance=0.6"

# 查询超级图片放大任务
curl https://ai.cozesf.cc/image-tools/tasks/17807270155465 \
  -H "Authorization: Bearer YOUR_API_KEY"

# 超级图片放大 V2
curl https://ai.cozesf.cc/image-tools/super-upscale-v2 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_type":"SDXL",
    "image_url":"https://example.com/image.png",
    "scale":3,
    "creativity":0.2,
    "detail":2,
    "shape_preservation":0.1,
    "prompt_suffix":" high quality, highly detailed, high resolution, sharp",
    "negative_prompt":"blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy",
    "guidance_scale":7.5,
    "num_inference_steps":20,
    "override_size_limits":true
  }'

JavaScript 示例

const form = new FormData();
form.append("image", fileInput.files[0]);
form.append("scale", "4");
form.append("face_enhance", "true");

const response = await fetch("https://ai.cozesf.cc/image-tools/upscale", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`
  },
  body: form
});

const result = await response.json();
console.log(result.output);

成功响应

{
  "completed_at": "2026-05-27T00:00:00Z",
  "created_at": "2026-05-27T00:00:00Z",
  "error": "",
  "id": "task-id",
  "model": "upscale",
  "output": "https://...",
  "started_at": "2026-05-27T00:00:00Z",
  "status": "succeeded"
}

// Upscale-V3 可能返回:
{
  "image": {
    "url": "https://...",
    "content_type": "image/png",
    "file_size": 1040977,
    "width": 1024,
    "height": 1024
  }
}

错误码

状态码含义处理方式
401没有传 Authorization补充 Authorization: Bearer YOUR_API_KEY
403API Key 未开通图片处理权限在后台创建或切换到图片处理专用 Key。
402API Key 额度不足给对应 Key 增加额度,或检查分组/渠道价格设置。
400上游参数校验失败确认上传了有效图片,并按对应接口传字段名。
504上游处理或上传超时压缩图片后重试,或稍后再试。
502图片处理服务请求失败稍后重试,或联系管理员检查服务状态。