Skip to main content

Video 생성 AI API

kvidAI의 Video 생성 AI API는 텍스트나 이미지를 입력으로 받아 5-6초 길이의 고품질 비디오를 생성하는 서비스입니다.

🎯 서비스 개요

지원 기능

  • Text-to-Video: 텍스트 프롬프트로 비디오 생성
  • Image-to-Video: 이미지를 기반으로 한 비디오 생성
  • v1 모델: 480p, 580p, 720p 지원 (5-6초)
  • v2 모델: 480p, 720p, 1080p 지원 (5초 또는 10초)

특화 기능

  • 카메라 앵글 조작 프롬프트 지원 (완벽하지 않을 수 있음)
  • 다양한 생성 옵션 및 제어 가능

📡 API 엔드포인트

기본 정보

Base URL: https://api.kvid.ai
api-key: api_key Header
Content-Type: application/json

API 엔드포인트

Text-to-Video

  • 생성: POST https://api.kvid.ai/ai/video/text-to-video/generate
  • 상태 확인: GET https://api.kvid.ai/ai/video/text-to-video/status?request_id={request_id}
  • 결과 가져오기: GET https://api.kvid.ai/ai/video/text-to-video/result?request_id={request_id}

Image-to-Video

  • 생성: POST https://api.kvid.ai/ai/video/image-to-video/generate
  • 상태 확인: GET https://api.kvid.ai/ai/video/image-to-video/status?request_id={request_id}
  • 결과 가져오기: GET https://api.kvid.ai/ai/video/image-to-video/result?request_id={request_id}

1. Text-to-Video 생성

v1 모델 요청 예제

import requests
import json

url = "https://api.kvid.ai/ai/video/text-to-video/generate"
api_key = "YOUR_API_KEY"

# v1 모델 (wan-t2v)
payload = json.dumps({
"prompt": "A waterfall flowing down a mountain, nature documentary style",
"negative_prompt": "low quality, bad anatomy",
"num_frames": 81,
"frames_per_second": 16,
"seed": None,
"resolution": "720p",
"aspect_ratio": "16:9",
"num_inference_steps": 30,
"enable_safety_checker": True,
"enable_prompt_expansion": True
})

headers = {
'api-key': api_key,
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)
result = response.json()
request_id = result['data']['request_id']
print(f"Request ID: {request_id}")

v2 모델 요청 예제

# v2 모델 (bytedance/seedance)
payload = json.dumps({
"prompt": "A beautiful sunset over the ocean",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": "5",
"camera_fixed": False,
"seed": None,
"model": "bytedance/seedance/v1/lite/text-to-video"
})

response = requests.request("POST", url, headers=headers, data=payload)

2. Image-to-Video 생성

v1 모델 요청 예제

import requests
import json

url = "https://api.kvid.ai/ai/video/image-to-video/generate"
api_key = "YOUR_API_KEY"

# v1 모델 (wan-i2v)
payload = json.dumps({
"prompt": "Make the subject move naturally",
"negative_prompt": "low quality, bad anatomy",
"num_frames": 81,
"frames_per_second": 16,
"seed": None,
"resolution": "720p",
"aspect_ratio": "auto",
"num_inference_steps": 30,
"enable_safety_checker": True,
"enable_prompt_expansion": True,
"image_url": "https://your-image-url.jpg"
})

headers = {
'api-key': api_key,
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)
result = response.json()
request_id = result['data']['request_id']
print(f"Request ID: {request_id}")

v2 모델 요청 예제

# v2 모델 (bytedance/seedance)
payload = json.dumps({
"prompt": "Camera panning across the scene",
"resolution": "1080p",
"duration": "5",
"camera_fixed": False,
"seed": None,
"model": "bytedance/seedance/v1/lite/image-to-video",
"image_url": "https://your-image-url.jpg"
})

response = requests.request("POST", url, headers=headers, data=payload)

3. 생성 상태 조회

상태 확인 예제

import requests
import time

api_key = "YOUR_API_KEY"
request_id = "req_12345abcdef" # 생성 요청에서 받은 request_id

# Text-to-Video 상태 확인
url = f"https://api.kvid.ai/ai/video/text-to-video/status?request_id={request_id}"

headers = {
'api-key': api_key
}

# 상태 폴링
while True:
response = requests.get(url, headers=headers)
result = response.json()

status = result['data']['status']
progress = result['data']['progress']

print(f"Status: {status}, Progress: {progress}%")

if status == 'COMPLETED':
print("비디오 생성 완료!")
break
elif status == 'FAILED':
print("비디오 생성 실패")
break

time.sleep(5) # 5초 대기

4. 비디오 결과 가져오기

결과 조회 예제

import requests

api_key = "YOUR_API_KEY"
request_id = "req_12345abcdef"

# Text-to-Video 결과 조회
url = f"https://api.kvid.ai/ai/video/text-to-video/result?request_id={request_id}"

headers = {
'api-key': api_key
}

response = requests.get(url, headers=headers)
result = response.json()

if result['success']:
video_url = result['data']['url']
video_name = result['data']['name']
video_size = result['data']['size']

print(f"비디오 URL: {video_url}")
print(f"파일명: {video_name}")
print(f"파일 크기: {video_size} KB")
else:
print(f"오류: {result['message']}")

📋 매개변수 상세

Text-to-Video 매개변수

v1 모델 (wan-t2v)

매개변수타입기본값설명
promptstring필수비디오 생성을 위한 텍스트 프롬프트
negative_promptstring""제외할 요소 설명
num_framesinteger81프레임 수 (81-100)
frames_per_secondinteger16초당 프레임 수 (5-24)
seedinteger/nullnull재현성을 위한 시드값
resolutionstring"720p"해상도 ("480p", "580p", "720p")
aspect_ratiostring"16:9"화면 비율 ("16:9", "9:16")
num_inference_stepsinteger30추론 단계 수
enable_safety_checkerbooleantrue안전 필터 활성화
enable_prompt_expansionbooleantrue프롬프트 확장 활성화

v2 모델 (bytedance/seedance)

매개변수타입기본값설명
promptstring필수비디오 생성을 위한 텍스트 프롬프트
aspect_ratiostring"16:9"화면 비율 ("16:9", "4:3", "1:1", "9:21")
resolutionstring"720p"해상도 ("480p", "720p", "1080p")
durationstring"5"비디오 길이 ("5", "10")
camera_fixedbooleanfalse카메라 고정 여부
seedinteger/nullnull재현성을 위한 시드값
modelstring필수"bytedance/seedance/v1/lite/text-to-video"

Image-to-Video 매개변수

v1 모델 (wan-i2v)

Text-to-Video v1과 동일한 매개변수에 추가로:

매개변수타입기본값설명
image_urlstring필수입력 이미지 URL
image_filestring-Base64 인코딩된 이미지 데이터
aspect_ratiostring"auto"화면 비율 ("auto", "16:9", "9:16", "1:1")

v2 모델 (bytedance/seedance)

Text-to-Video v2와 동일한 매개변수에 추가로:

매개변수타입기본값설명
image_urlstring필수입력 이미지 URL
image_filestring-Base64 인코딩된 이미지 데이터
end_image_urlstring/nullnull종료 이미지 URL (선택)

API 응답 형식

Generate 응답

{
"success": true,
"data": {
"request_id": "req_12345abcdef"
},
"message": "Video generation request submitted successfully"
}

Status 응답

{
"success": true,
"data": {
"status": "PROCESSING",
"progress": 45,
"logs": [
"2024-01-15 10:30:00 - Video generation started",
"2024-01-15 10:30:15 - Processing frame 1-20"
]
},
"message": "Video generation in progress"
}

Result 응답

{
"success": true,
"data": {
"url": "https://storage.kvid.ai/videos/req_12345abcdef.mp4",
"name": "generated_video.mp4",
"size": 15420
},
"message": "Video result retrieved successfully"
}

🎬 사용 예제

1. 등산객과 배낭 비디오

등산객 배낭

프롬프트: A video of a man hiking with a backpack. The bag must be the main subject. Walking slowly

2. 청소기 사용 비디오

진공청소기

프롬프트: Video of cleaning with a vacuum cleaner. slow movement. low angle

3. 음식 홍보 비디오

연어 요리

프롬프트: Remove the cooking effect and only add camera movement. highlight the food in Zoom format. promotional video for this food

4. 한국 전통 정자 비디오

전주 공원

프롬프트: A traditional Korean pavilion by a lotus pond, with two small dogs (a white poodle and a brown shiba inu) joyfully running along the wooden walkway. The pond is filled with green lotus leaves, and the background is full of lush green trees. Bright sunny day, peaceful and vivid atmosphere.

Text-to-Video 버전:

추가 프롬프트: The two small dogs (white poodle and brown shiba inu) approach the pavilion, wagging their tails, playfully interacting. They stop at the end of the deck, looking around curiously. [Over-the-shoulder shot] Captures the view of the park and lotus pond from behind the dogs.

5. 호랑이 이미지-비디오 변환

호랑이

프롬프트: The tiger briefly pulls back its tongue, blinks, and tilts its head slightly. Then immediately sticks out its tongue for a second time, a bit longer than the first, while lowering its head slightly. [Low-angle close-up shot] Capture from below to show both majesty and cuteness.

⚠️ 제한사항 및 주의사항

기술적 제한

  • v1 모델: 5-6초 고정, 최대 720p
  • v2 모델: 5초 또는 10초, 최대 1080p
  • 카메라 앵글: 카메라 앵글 조작 프롬프트가 항상 정확하게 작동하지 않을 수 있음
  • 처리 시간: 해상도와 길이에 따라 1-5분 소요

최적화 팁

  • 구체적인 프롬프트: 세부적이고 명확한 설명 제공
  • 카메라 앵글: 필요시 [Low-angle], [Over-the-shoulder shot] 등의 지시어 사용
  • 적절한 해상도: 용도에 맞는 해상도 선택

🔗 관련 링크

💰 요금 정보

Video Generation API의 자세한 요금 정보는 요금제 페이지를 참고해 주세요.

📞 지원 및 문의

문의사항이 있으시면 다음 경로로 연락해 주세요: