LogoLogoAPI 文档
LogoLogoAPI 文档
首页
概览鉴权与幂等图片生成图片编辑图片转换任务与有限等待积分错误速率与并发限制API 更新日志
API 文档

图片编辑

使用自然语言指令编辑上传图片

POST /api/v1/images/edits 使用 multipart/form-data。所需权限:images:edit。

表单字段

字段类型必填默认值规则
imagefile是—PNG、JPEG 或 WebP;最大 10 MiB,解码后不超过 4,000 万像素
promptstring是—编辑指令,5–2,000 字符
aspect_ratiostring否根据源图与生成接口相同的公开比例
resolutionstring否2K2K 或 4K
countinteger否11–4

系统会独立校验文件签名,不信任声明的 MIME。无效、超大或不安全图片返回 400 INVALID_REQUEST;超过传输大小限制时 HTTP 状态为 413,公开错误码仍相同。

积分

分辨率每个结果积分
2K10
4K20

cURL

curl https://sci-draw.com/api/v1/images/edits \
  -H 'Authorization: Bearer sd_YOUR_KEY' \
  -H 'Idempotency-Key: revise-figure-7-v2' \
  -F 'image=@figure.png;type=image/png' \
  -F 'prompt=Move the legend below the diagram and increase label contrast' \
  -F 'resolution=2K' \
  -F 'count=1'

JavaScript

const form = new FormData();
form.set('image', file);
form.set('prompt', 'Move the legend below the diagram');
const response = await fetch('https://sci-draw.com/api/v1/images/edits', {
  method: 'POST',


Python

with open("figure.png", "rb") as image:
    response = requests.post(
        "https://sci-draw.com/api/v1/images/edits",
        headers={"Authorization": f"Bearer 


上传图片只作为私有任务输入,不会出现在任务或日志响应中。重复幂等上传会被丢弃, 已接受的源图在任务进入终态后清理。

图片生成

创建文生图任务

图片转换

将图片转换为 SVG、PPTX、PNG、PDF 或 TIFF

目录

表单字段
积分
cURL
JavaScript
Python
headers: { Authorization: `Bearer ${apiKey}`, 'Idempotency-Key': crypto.randomUUID() },
body: form,
});
{
api_key
}
"
,
"Idempotency-Key"
:
str
(uuid.uuid4())},
files={"image": ("figure.png", image, "image/png")},
data={"prompt": "Move the legend below the diagram"},
)