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

이미지 생성

텍스트로 이미지를 만드는 작업 생성

이미지 변환

이미지를 SVG, PPTX, PNG, PDF, TIFF로 변환하기

목차

폼 필드
크레딧
cURL
JavaScript
Python
출력 크기
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',
  headers: { Authorization: `Bearer ${apiKey}`, 'Idempotency-Key': crypto.randomUUID() },
  body: form,
});

Python

with open("figure.png", "rb") as image:
    response = requests.post(
        "https://sci-draw.com/api/v1/images/edits",
        headers={"Authorization": f"Bearer {api_key}", "Idempotency-Key": str(uuid.uuid4())},
        files={"image": ("figure.png", image, "image/png")},
        data={"prompt": "Move the legend below the diagram"},
    )

업로드한 원본은 작업의 비공개 입력이며, 작업이나 로그 응답에 절대 반환되지 않습니다. 멱등하게 중복 업로드된 파일은 폐기되고, 접수된 원본은 종료 상태의 결과가 나온 뒤 삭제됩니다.

출력 크기

2K와 4K는 크기 등급이며 고정된 변 길이가 아닙니다. 표는 실제 출력 픽셀 크기입니다. 지원하지 않는 비율은 작업 생성이나 크레딧 예약 전에 HTTP 400 (INVALID_REQUEST)을 반환합니다. 편집 시 aspect_ratio를 생략하면 원본 비율이 1:3~3:1 범위이고 요청한 크기 등급(4K는 최소 600만 픽셀)을 충족해야 합니다. 그렇지 않으면 지원하는 출력 비율을 지정하세요.

aspect_ratio2K4K
1:12048×20482880×2880
16:92560×14403840×2160
9:161440×25602160×3840
4:32304×17283264×2448
3:41728×23042448×3264
3:22496×16643504×2336
2:31664×24962336×3504
5:42240×17923200×2560
4:51792×22402560×3200
21:93136×13443808×1632