API 指南 / Trellis 质检(图片)

API 指南 · Trellis 质检(图片)

对图片做提示词贴合度(中文 CLIP)与人脸身份相似度质检,按张计费。

调用方式
同步:直接 POST 返回结果(建议超时 600s);超时后请勿自动重试。
异步(推荐):POST 加请求头 X-Trellis-Async: 1 → 返回 202 {id, poll};轮询 GET /v1/jobs/{id}(间隔 5–10s)。

以 multipart/form-data 上传 file(待质检图片)。可选 prompt(提供则返回贴合度 clip_score)、可选 reference_image(参考人脸图,提供则返回身份相似度 face_sim)。

返回 width / height / faces / clip_score / face_sim;按张计费(usage.image_count)。

调用示例:

cURL
curl https://api.trellis.hk/v1/evaluations/image \
  -H "Authorization: Bearer sk-xxxxxxxx" \
  -F model=trellis-qc-image -F file=@img.png \
  -F "prompt=一只猫在草地上" -F reference_image=@face.png
所有模型共用同一 API Key 与同一端点:https://api.trellis.hk/v1