API 문서
이미지 편집
업로드한 이미지를 자연어 지시로 편집하기
POST /api/v1/images/edits는 multipart/form-data를 받습니다. 필요한 범위:
images:edit.
폼 필드
| 필드 | 타입 | 필수 | 기본값 | 규칙 |
|---|---|---|---|---|
image | file | 예 | — | PNG, JPEG, WebP. 최대 10 MiB, 디코딩 후 4,000만 픽셀까지 |
prompt | string | 예 | — | 편집 지시, 5~2,000자 |
aspect_ratio | string | 아니요 | 원본에 따름 | 생성과 동일한 공개 비율 |
resolution | string | 아니요 | 2K | 2K 또는 4K |
count | integer | 아니요 | 1 | 1~4 |
파일 시그니처는 선언된 MIME 타입과 별개로 검사합니다. 잘못됐거나 용량을 넘거나
안전하지 않은 이미지는 400 INVALID_REQUEST, 또는 같은 공개 코드와 함께 HTTP
413을 반환합니다.
크레딧
| 해상도 | 출력 장당 크레딧 |
|---|---|
2K | 10 |
4K | 20 |
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
업로드한 원본은 작업의 비공개 입력이며, 작업이나 로그 응답에 절대 반환되지 않습니다. 멱등하게 중복 업로드된 파일은 폐기되고, 접수된 원본은 종료 상태의 결과가 나온 뒤 삭제됩니다.

API 문서