Skip to main content
POST
Image-to-video: submit a video generation task from a reference image
오른쪽의 인터랙티브 Playground는 실시간 디버깅을 지원합니다. Authorization 필드에 API Key를 설정하고(형식: Bearer sk-xxx), 참조 이미지를 업로드한 다음 prompt를 입력하고, 모델 / 크기 / 초를 선택한 뒤 전송하십시오.
범위: 이 페이지는 “참조 이미지로 동영상을 생성”하는 기능을 다룹니다. 즉, 하나의 이미지를 시작 프레임 / 시각적 기준점으로 업로드하여 정적인 비주얼에 애니메이션을 적용합니다. 참조 이미지가 필요하지 않으면 Text-to-Video endpoint를 사용하십시오(동일한 경로, JSON 본문).
⚠️ 참조 이미지의 크기는 size와 정확히 일치해야 합니다
  • 업로드한 이미지의 픽셀 크기는 size 필드와 같아야 합니다(예: size=1280x720는 1280×720 이미지를 요구합니다)
  • 불일치 시 400을 반환합니다: Inpaint image must match the requested width and height
  • 업로드 전에 ffmpeg / Pillow로 미리 자르십시오
기타 참고 사항:
  • Content-Type은 multipart/form-data여야 합니다(JSON 아님)
  • 파일은 하나만 지원됩니다. 필드 이름은 input_reference로 고정됩니다
  • 지원 형식: image/jpeg / image/png / image/webp

코드 샘플

Python (OpenAI SDK 드롭인)

Python (원시 requests + multipart)

cURL

Node.js (fetch + FormData)

브라우저 JavaScript

매개변수 빠른 참조

자세한 매개변수 제약, 허용 값, 예시는 오른쪽 플레이그라운드에서 확인할 수 있습니다. input_reference는 multipart로 업로드해야 합니다 — URL과 base64는 지원되지 않습니다.

참고 이미지 준비

1

대상 해상도 선택

사용 사례에 따라 먼저 size를 선택하십시오: 세로형 720x1280, 가로형 1280x720, Pro 1080p 가로형 1920x1080 등입니다.
2

정확한 픽셀로 로컬에서 자르기

Pillow / ffmpeg를 사용해 이미지를 대상 크기로 자르십시오:
또는 한 줄 ffmpeg:
3

적절한 형식 선택

PNG(무손실, 삽화 / 스크린샷에 이상적)를 우선하고, 바이트를 아끼려면 사진에는 JPEG를, 투명도가 필요하면 WebP를 사용하십시오.
4

Focus the prompt on "motion" not "appearance"

참고 이미지는 이미 시각 요소를 정의합니다. prompt는 어떻게 움직일지에 집중해야 합니다: 카메라 푸시/풀, 오브젝트 움직임, 조명 변화, 캐릭터 표정 등입니다. 예: "Camera slowly pushes in, leaves gently swaying, sunlight flickering through branches".

응답 형식

응답 형태는 텍스트-투-비디오동일합니다: submit은 id + status: "queued"를 반환하고, 폴링은 진행 상황을 보고하며, 완료 시 /v1/videos/{id}/content를 통해 MP4로 다운로드합니다.
⚠️ 일반적인 400 오류
  • Inpaint image must match the requested width and height — 참조 이미지의 치수가 size와 일치하지 않습니다. 가장 흔합니다. 업로드 전에 클라이언트 측에서 치수를 검증하십시오
  • Invalid file format — 업로드된 파일이 jpeg / png / webp가 아니거나 손상되었습니다
  • Missing required parameter: input_reference — multipart 필드 이름이 잘못되었습니다(반드시 input_reference여야 하며, imagereference가 아니어야 합니다)
  • seconds must be one of "4", "8", "12" — 문자열 "4" 대신 정수 4를 전달했습니다
Image-to-video와 text-to-video는 동일한 초당 요금을 적용합니다(seconds 기준으로 청구됨); 참조 이미지를 업로드해도 추가 비용은 없습니다. 요금표를 참조하십시오.

인증

Authorization
string
header
필수

API Key from the APIYI console (must use Sora2官转 group + usage-based billing)

본문

multipart/form-data
model
enum<string>
기본값:sora-2
필수

Model ID. sora-2 supports 720p only; sora-2-pro supports 720p / 1024p / 1080p

사용 가능한 옵션:
sora-2,
sora-2-pro
prompt
string
필수

Video generation prompt. Focus on how the image should animate: camera motion, object motion, lighting changes

예시:

"Animate this scene: gentle waves lapping, leaves swaying, cinematic camera push-in"

input_reference
file
필수

Reference image file used as the video's starting frame / visual anchor.

  • Accepted formats: image/jpeg / image/png / image/webp
  • Dimensions must equal size, otherwise you get Inpaint image must match the requested width and height
  • Only one file is supported; field name is fixed as input_reference
seconds
enum<string>
기본값:4

Video duration as string enum: "4" / "8" / "12"

사용 가능한 옵션:
4,
8,
12
size
enum<string>
기본값:720x1280

Output resolution. Must exactly match the input_reference image dimensions:

  • sora-2 (720p only): 720x1280 / 1280x720
  • sora-2-pro additionally: 1024x1792 / 1792x1024 / 1080x1920 / 1920x1080
사용 가능한 옵션:
720x1280,
1280x720,
1024x1792,
1792x1024,
1080x1920,
1920x1080

응답

Task submitted, returns video_id with queued status

id
string

Task ID for subsequent polling and download

예시:

"video_abc123def456"

object
string

Object type, fixed video

예시:

"video"

model
string

Model ID used for this task

예시:

"sora-2"

status
enum<string>

Task status:

  • queued — submitted, waiting in queue
  • in_progress — generating
  • completed — done, ready to download (/v1/videos/{id}/content)
  • failed — failed (not billed), safe to retry
사용 가능한 옵션:
queued,
in_progress,
completed,
failed
예시:

"queued"

progress
integer

Generation progress percentage (0–100), not strictly linear

예시:

0

created_at
integer

Task creation Unix timestamp (seconds)

예시:

1712697600

completed_at
integer

Task completion Unix timestamp (seconds), present only on completed status

예시:

1712697900

size
string

Actual output resolution (matches the requested size)

예시:

"1280x720"

seconds
string

Actual duration generated (matches the requested seconds)

예시:

"8"

quality
string

Quality tier (standard for sora-2, high for sora-2-pro)

예시:

"standard"