SANA-Video
SANA-Video
네이티브 SANA-Video 2B 480p 텍스트-투-비디오 모델을 SGLang Diffusion으로 서빙합니다. 2B 파라미터로 단일 GPU에서 480p 비디오를 병렬화 플래그 없이 sglang serve 한 번으로 제공하는 것이 장점입니다.
출처: 문서
본문
네이티브 SANA-Video 2B 480p 텍스트-투-비디오 모델을 SGLang Diffusion으로 서빙.
<DiffusionModelTags tags={["video", "text-to-video", "480p", "2B lightweight"]} />
1. 모델 소개 (Model Introduction)
SANA-Video 2B 480p는 네이티브 SGLang Diffusion 파이프라인으로 서빙되는 경량 텍스트-투-비디오 모델입니다. 주요 장점은 배포 비용입니다. 2B 파라미터로 병렬화 플래그 없이 단일 GPU sglang serve 호출로 480p 비디오를 제공합니다.
출시된 생성 프로파일은 50 추론 스텝에서 832×480 출력을 81 프레임·16 FPS로 생성합니다. 서버 CI가 빠른 검증용으로 다루는 17프레임·8스텝의 컴팩트 프로파일도 있습니다. 모션 강도는 선택적 motion score: N. 접미사로 프롬프트에서 직접 조정할 수 있습니다.
| Model ID | Task | Default output |
|---|---|---|
Efficient-Large-Model/SANA-Video_2B_480p_diffusers |
Text to video | 832x480, 81 frames at 16 FPS |
2. 설치 (Installation)
디퓨전 의존성으로 SGLang을 설치합니다:
uv pip install "sglang[diffusion]" --prerelease=allow
플랫폼별 설정은 SGLang Diffusion installation guide를 참고하세요.
3. SANA-Video 서빙 (Serve SANA-Video)
sglang serve \
--model-path Efficient-Large-Model/SANA-Video_2B_480p_diffusers \
--port 30010
4. 비디오 생성 (Generate a video)
다음 요청은 서버 CI가 다루는 컴팩트 17프레임·8스텝 프로파일을 사용합니다. 출시된 생성 프로파일에는 모델 기본값 81프레임·50스텝을 사용하세요.
import time
from pathlib import Path
import requests
base_url = "http://127.0.0.1:30010"
response = requests.post(
f"{base_url}/v1/videos",
json={
"model": "Efficient-Large-Model/SANA-Video_2B_480p_diffusers",
"prompt": (
"A red tram moves slowly through a sunlit city square while "
"pedestrians cross behind it. motion score: 30."
),
"size": "832x480",
"num_frames": 17,
"fps": 16,
"num_inference_steps": 8,
"guidance_scale": 6.0,
"seed": 42,
},
timeout=60,
)
response.raise_for_status()
video_id = response.json()["id"]
while True:
job = requests.get(f"{base_url}/v1/videos/{video_id}", timeout=30).json()
if job["status"] == "completed":
break
if job["status"] == "failed":
raise RuntimeError(job.get("error") or "Video generation failed")
time.sleep(1)
video = requests.get(
f"{base_url}/v1/videos/{video_id}/content",
timeout=300,
)
video.raise_for_status()
Path("sana_video.mp4").write_bytes(video.content)
5. 요청 제약 (Request constraints)
- 기본 프로파일은
832x480, 81프레임, 50 추론 스텝, 16 FPS를 사용합니다. - 프레임 수는
4n+1로 정렬됩니다. 예를 들어 80프레임 요청은 77로 조정됩니다. - 16으로 나누어 떨어지는 너비·높이 값을 사용하세요.
- 프롬프트는 원하는 움직임 양을 표현하기 위해 선택적
motion score: N.접미사를 지원합니다.