Wan 2.6 이미지·참조 영상(R2V) API로 정밀한 영상 파이프라인 구축하기
대상 모델:
wan2.6(선택 Flash ID:wan2.6-flash)
추론 엔드포인트:https://toapis.com/v1/videos/generations
관련: OpenAI Sora 2 API 가이드 · Alibaba Wan 3.0 영상 API 빠른 시작 · Wan 3.0 Prime 대 Wan 2.6 Flash · MiniMax H3 자동 R2V 파이프라인 · Wan 2.6 레퍼런스 · Wan 2.6 Flash 레퍼런스 · wan2.6 모델 가이드 · wan2.6-flash 모델 가이드
1. TL;DR 및 기능 개요
- 먼저 카탈로그를 확인하세요: 기획 초안은 “Wan 2.6 R2V”를 공개 모델
wan-2-6-r2v로 취급하거나, 파이프라인 전체를wan-2-6-flash로 향하게 하는 경우가 있습니다. 2026-11-23에 공식 Wan 2.6 생성 레퍼런스(HTTP 200)를 확인하면 공개 ID는 **wan2.6**입니다. 공식 Flash 생성 레퍼런스(HTTP 200)는 **wan2.6-flash**를 적습니다. 경로/videos/wan2.6-r2v/generation은 HTTP 404였습니다./model-guide/wan2-6-r2v는 HTTP 200이지만 제목이 “Model Guide Not Found”이며 실제 가이드가 아닙니다. 그날toapis.com/sitemap.xml에는 이 계열로wan2-6과wan2-6-flash만 있었습니다. - 여기서 “R2V”의 의미:
wan2.6에서metadata.reference_urls(공개 영상 URL)를 보내면 참조 영상(r2v) 모드가 됩니다. 공식 페이지는 이때 서버가 업스트림 모델wan2.6-r2v로 라우팅한다고 합니다. 그래도model: "wan2.6"을 보냅니다. 이미지-투-비디오는image_urls(이미지 1장)입니다. prompt만 있으면 텍스트-투-비디오입니다.image_urls와metadata.reference_urls를 함께 쓸 수 없으므로 세 모드는 사실상 배타적입니다. - 계약:
POST /v1/videos/generations에 비동기로 제출한 뒤completed또는failed까지GET /v1/videos/generations/{id}를 폴링합니다. 일반 작업은GET /v1/tasks/{id}로도 조회할 수 있습니다. 공식 예시는https://toapis.com(중국 본토는https://toapis.cn)입니다. 이 시리즈의 이전 글은https://api.toapis.com을 쓰기도 합니다. 오리진을 하나 정해 일관되게 사용하세요. 이 글은 공식 예시를 따릅니다. - Flash는 같은 ID가 아닙니다:
wan2.6-flash는 이미지-투-비디오와 참조 영상만 지원합니다. 텍스트 전용 생성은 지원되지 않으며 prompt만 보낸 요청은 오류를 반환합니다. Flash는 무음 영상(audio: false)을 문서화된 다른 단가로 만들 수 있습니다. 비 Flashwan2.6은 기본으로 항상 오디오를 포함합니다. - 버려야 할 미확인 주장:
motion_amplitude, 초당$0.018또는$0.030, 지연이나 SLA 수치는 현재 ToAPIs 문서가 아닙니다. 요금은 계정 카탈로그에서 확인하세요.
2. 공식 Wan 2.6 ID, 라우팅, 매개변수 규칙
model 필드에는 공개 모델 이름을 쓰세요. 초안 별칭으로 바꾸지 말고, 이후 공식 페이지가 공개 카탈로그 문자열로 적지 않는 한 업스트림 이름 wan2.6-r2v도 보내지 마세요. 2026-11-23 생성 레퍼런스에는 없습니다.
| 카탈로그 ID | 이 가이드에서의 역할 | 문서화된 작업 |
|---|---|---|
wan2.6 | 기본 공개 ID | 텍스트-투-비디오(prompt만), 이미지-투-비디오(image_urls), 참조 영상 / R2V(metadata.reference_urls) |
wan2.6-flash | 별도의 Flash 공개 ID | 이미지-투-비디오와 참조 영상만. prompt만 보내면 실패 |
wan3.0-video | 이후 관련 Wan ID. Wan 3.0 빠른 시작 참고 | 다른 All-in-One 매개변수(첫/마지막 프레임 포함). Wan 3.0 필드를 Wan 2.6 페이로드에 섞지 말 것 |
wan2.6(및 해당 Flash)은 보낸 미디어로 라우팅합니다.
| 제공한 매개변수 | 업스트림 모드 |
|---|---|
metadata.reference_urls(영상 URL) | 참조 영상(r2v). Flash는 wan2.6-r2v-flash로 |
image_urls(이미지 1장) | 이미지-투-비디오(i2v) |
prompt만 | wan2.6에서는 텍스트-투-비디오(t2v). wan2.6-flash에서는 오류 |
wan2.6의 문서화된 요청 필드에는 prompt(텍스트-투-비디오에서 필수, i2v와 r2v에서는 선택이며 기대 움직임이나 스타일을 기술), image_urls(공개 http:// 또는 https:// 이미지 URL 최대 1개. base64는 더 이상 지원되지 않음. 먼저 Upload Image API 사용), aspect_ratio(16:9, 9:16, 1:1, 4:3, 3:4. 이미지-투-비디오에서는 미지원), resolution(720p 또는 1080p, 기본 1080p. 480p 미지원), duration(5, 10, 15, 기본 5), negative_prompt, seed, prompt_extend(기본 true), audio(비 Flash는 기본으로 항상 오디오 포함. 명시적으로 켜려면 true), shot_type(single 또는 multi, 텍스트-투-비디오와 참조 영상만), watermark, metadata.reference_urls(공개 영상 URL. “여러 개”의 참조 영상 지원. image_urls와 함께 사용 불가)가 있습니다.
Flash 레퍼런스는 더 좁습니다. model은 wan2.6-flash로 고정되고, image_urls 또는 metadata.reference_urls 중 하나가 필수이며, prompt는 선택입니다. 또한 resolution, duration, audio(기본 true. false는 무음이며 요금이 다름), watermark, metadata.reference_urls가 문서화되어 있습니다. 해당 페이지에는 aspect_ratio, shot_type, negative_prompt, seed, prompt_extend가 없습니다.

그림 1: 문서화된 wan2.6 또는 wan2.6-flash 페이로드를 POST /v1/videos/generations에 제출하고, 같은 작업 id를 폴링한 뒤 status가 completed일 때만 result.data[0].url을 읽습니다. image_urls와 metadata.reference_urls는 함께 쓸 수 없습니다.
공식 wan2.6 해상도·화면비 크기 표는 다음과 같습니다.
| 화면비 | 설명 | 720p 크기 | 1080p 크기 |
|---|---|---|---|
| 16:9 | 가로(기본) | 1280×720 | 1920×1080 |
| 9:16 | 세로 | 720×1280 | 1080×1920 |
| 1:1 | 정사각형 | 960×960 | 1440×1440 |
| 4:3 | 가로 | 1088×832 | 1632×1248 |
| 3:4 | 세로 | 832×1088 | 1248×1632 |
3. 프로덕션 구현: cURL과 Python
스니펫은 공식 예시의 https://toapis.com을 따릅니다. 중국 본토에서 호출하면 오리진을 https://toapis.cn으로 바꾸세요. 배포 전에 계정용 API 레퍼런스에서 id, result.data[0].url, 응답 엔벨로프를 확인하세요.
1단계: 이미지-투-비디오와 참조 영상의 cURL
wan2.6 이미지-투-비디오(이 모드에서는 aspect_ratio를 보내지 않음):
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "wan2.6",
"prompt": "The product rotates slowly under studio lighting, camera locked off",
"image_urls": ["https://example.com/product.jpg"],
"resolution": "1080p",
"duration": 5
}'
같은 공개 ID의 참조 영상(R2V). 반환된 id를 저장하세요.
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "wan2.6",
"prompt": "The character waves and smiles at the camera",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"shot_type": "single",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}'
Flash 이미지-투-비디오 미리보기(무음, 문서상 단가가 더 낮음)는 다른 공개 ID를 사용합니다.
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer $TOAPIS_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "wan2.6-flash",
"prompt": "The person comes alive and smiles at the camera",
"image_urls": ["https://example.com/portrait.jpg"],
"resolution": "720p",
"duration": 5,
"audio": false
}'
2단계: Python 헬퍼와 폴러
import os
import time
import requests
API_KEY = os.environ["TOAPIS_API_KEY"]
BASE = "https://toapis.com"
ENDPOINT = f"{BASE}/v1/videos/generations"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
DOCUMENTED_IDS = {"wan2.6", "wan2.6-flash"}
RESOLUTIONS = {"720p", "1080p"}
DURATIONS = {5, 10, 15}
ASPECTS = {"16:9", "9:16", "1:1", "4:3", "3:4"}
SHOT_TYPES = {"single", "multi"}
def dispatch_wan26(
prompt: str | None = None,
*,
model: str = "wan2.6",
image_urls: list[str] | None = None,
reference_urls: list[str] | None = None,
aspect_ratio: str | None = None,
resolution: str = "1080p",
duration: int = 5,
negative_prompt: str | None = None,
seed: int | None = None,
prompt_extend: bool | None = None,
audio: bool | None = None,
shot_type: str | None = None,
watermark: bool | None = None,
) -> str:
if model not in DOCUMENTED_IDS:
raise ValueError("Send wan2.6 or wan2.6-flash; wan-2-6-r2v is not a documented public ID")
if duration not in DURATIONS:
raise ValueError("duration must be 5, 10, or 15")
if resolution not in RESOLUTIONS:
raise ValueError("resolution must be 720p or 1080p")
if image_urls and reference_urls:
raise ValueError("image_urls cannot be combined with metadata.reference_urls")
if image_urls and len(image_urls) != 1:
raise ValueError("image_urls is documented as supporting only 1 image")
if model == "wan2.6-flash" and not image_urls and not reference_urls:
raise ValueError("wan2.6-flash requires image_urls or metadata.reference_urls")
if model == "wan2.6" and not prompt and not image_urls and not reference_urls:
raise ValueError("wan2.6 needs a prompt, an image, or reference video URLs")
if image_urls and aspect_ratio:
raise ValueError("aspect_ratio is not supported in image-to-video mode on wan2.6")
if aspect_ratio and aspect_ratio not in ASPECTS:
raise ValueError("unsupported aspect_ratio")
if shot_type and shot_type not in SHOT_TYPES:
raise ValueError("shot_type must be single or multi")
if image_urls and shot_type:
raise ValueError("shot_type applies to text-to-video and reference-video modes only")
payload: dict = {
"model": model,
"resolution": resolution,
"duration": duration,
}
if prompt:
payload["prompt"] = prompt
if image_urls:
payload["image_urls"] = image_urls
if reference_urls:
payload["metadata"] = {"reference_urls": reference_urls}
if aspect_ratio:
payload["aspect_ratio"] = aspect_ratio
if negative_prompt:
payload["negative_prompt"] = negative_prompt
if seed is not None:
payload["seed"] = seed
if prompt_extend is not None:
payload["prompt_extend"] = prompt_extend
if audio is not None:
payload["audio"] = audio
if shot_type:
payload["shot_type"] = shot_type
if watermark is not None:
payload["watermark"] = watermark
res = requests.post(ENDPOINT, headers=HEADERS, json=payload, timeout=30)
res.raise_for_status()
data = res.json()
task_id = data.get("id") or data.get("task_id")
if not task_id:
raise RuntimeError(f"Unexpected submission envelope: {data}")
return task_id
def poll_task(task_id: str, deadline_s: int = 900) -> str:
poll_url = f"{BASE}/v1/videos/generations/{task_id}"
interval = 10.0
start = time.time()
time.sleep(5)
while time.time() - start < deadline_s:
poll = requests.get(poll_url, headers=HEADERS, timeout=15)
if poll.status_code == 429:
retry_after = poll.headers.get("Retry-After")
time.sleep(float(retry_after) if retry_after else min(interval * 2, 120))
continue
poll.raise_for_status()
data = poll.json()
status = data.get("status")
if status == "completed":
return data["result"]["data"][0]["url"]
if status == "failed":
raise RuntimeError(f"Generation failed: {data.get('error')}")
time.sleep(interval)
interval = min(interval * 1.5, 30.0)
raise TimeoutError(f"Task {task_id} exceeded {deadline_s}s; check status before retrying")
if __name__ == "__main__":
task_id = dispatch_wan26(
"The character waves and smiles at the camera",
reference_urls=["https://cdn.example.com/ref-character.mp4"],
shot_type="single",
aspect_ratio="16:9",
resolution="1080p",
duration=5,
)
print("Task:", task_id)
print("Video:", poll_task(task_id))
expires_at 전에 파일을 다운로드하세요. 영상 작업 상태 레퍼런스는 30일 보관을 문서화합니다. wan2.6에서 기본 prompt_extend를 켜 두면, 공식 페이지는 시스템이 프롬프트를 자동으로 최적화·보강한다고 하지만 측정된 지연은 공개하지 않습니다.
4. 오류 처리와 상태 매트릭스
아래 분류는 진단 출발점일 뿐 ToAPIs 오류 코드를 보장하지 않습니다. HTTP 조회가 성공해도 작업 status를 읽어야 합니다. 요청 오류와 status: failed 이유는 오류 레퍼런스를 보세요.
| HTTP 또는 작업 상태 | 흔한 분류 | 권장 조치 |
|---|---|---|
400 | 알 수 없는 모델 별칭, image_urls와 metadata.reference_urls 혼용, Flash의 prompt 전용 요청, 또는 i2v에서 aspect_ratio | wan2.6 또는 wan2.6-flash를 보내고, 배타적 미디어 중 하나만 남기며, 공개 URL만 사용 |
401 | API 키 누락 또는 무효 | ToAPIs 대시보드에서 키를 교체하고 Authorization: Bearer 헤더를 확인 |
429 | 속도 또는 동시성 제한 | Retry-After가 있으면 지키고, 지터와 함께 백오프하며, 안전할 때만 재시도 |
5xx 또는 클라이언트 타임아웃 | 일시적 게이트웨이 또는 업스트림 문제 | 다시 제출하기 전에 기존 작업 id를 조회 |
status: queued 또는 in_progress | 오류가 아님 | 기다렸다가 다시 폴링 |
status: failed | 생성이 성공하지 않음 | error.code와 error.message(있으면 error.reason)를 읽음. 정책 거부 페이로드를 그대로 재전송하지 말 것 |
5. 가격과 FinOps
공식 Wan 2.6 생성 레퍼런스에는 단가표가 없습니다. 초 단위 과금, 해상도별 가격 차이, 모델 마켓플레이스 참조가 적혀 있습니다. 공식 Flash 생성 레퍼런스에는 “Audio vs Silent Pricing” 표가 있으며, 2026-11-23에 다시 확인한 내용은 다음과 같습니다.
| 모드 | 720p 단가 | 1080p 단가 |
|---|---|---|
오디오 있음(audio: true) | ¥0.3 / 초 | ¥0.5 / 초 |
무음(audio: false) | ¥0.15 / 초 | ¥0.25 / 초 |
2026-11-23에 가져온 모델 가이드는 wan2.6의 가격 참고가 12 credits / 초, wan2.6-flash가 6 credits / 초이며, 최종 청구는 현재 계정 견적과 현재 duration·resolution 규칙을 따른다고 합니다. credits와 Flash 위안 표는 스냅샷이지 모든 모드의 계약이 아닙니다. credits를 직접 통화로 환산하지 말고, 기획 초안의 달러 단가도 재사용하지 마세요.
- Flash로 프로토타입을 만들 때는 작업이 이미지-투-비디오 또는 참조 영상일 때만. 텍스트 전용 요청은
wan2.6-flash에 맞지 않습니다. - Flash에서 오디오를 끄는 것은 무음 출력이 목적일 때만. 공식 표는 무음 단가를 더 낮게 적습니다. 비 Flash
wan2.6은 기본으로 항상 오디오를 포함하며, 생성 페이지에 대응하는 위안 표가 없습니다. - 표시 가격은 채널 보장이 아닙니다. 배치를 예측하기 전에 계정 카탈로그에서 ID와 실시간 견적을 확인하세요.
6. 자주 묻는 질문
frontmatter의 FAQ를 보세요. 요약: wan2.6 또는 wan2.6-flash를 보내고 wan-2-6-r2v는 쓰지 않습니다. image_urls와 metadata.reference_urls를 섞지 마세요. motion_amplitude는 문서화되어 있지 않습니다. duration은 5, 10, 15초입니다. 생성 상태 경로를 폴링하고 작업 id를 저장하세요.
7. 실행 체크리스트
-
wan2.6또는wan2.6-flash를 보냅니다.wan-2-6-r2v나wan-2-6-flash같은 초안 별칭은 쓰지 마세요. - 모드는 하나만 고릅니다. prompt만(
wan2.6), 공개 이미지 URL 1개, 또는 공개 참조 영상 URL. 같은 요청에 이미지와 참조 영상을 함께 넣지 마세요. - 로컬 미디어는 먼저 업로드하고
http(s)URL만 전달하세요. base64는 보내지 마세요. - 이미지-투-비디오 요청에서는
aspect_ratio와shot_type을 생략하세요. - 작업
id를 저장하고GET /v1/videos/generations/{id}를 폴링하며,completed이후에만result.data[0].url을 읽으세요. - 요금은 실시간 계정 견적을 따르세요. 2026-11-23 Flash 위안 표와 credits 스냅샷은 날짜가 있는 참고로만 쓰세요.
-
expires_at전에 영상을 다운로드하세요(문서상 보관 30일).