You can call the Video Generation API
— pricing
“unit price * 사용량” 만큼 보유 credit이 차감 됩니다
•
“Text To Video” unit price: $0.86 / 5~6초 video
•
“Image To Video” unit price: $0.86 / 5~6초 video
— pricing example
•
환율 1,446원 기준
•
“Text To Video” unit price: 124.356 credit / 5~6초 video
•
Image To Video” unit price: 124.356 credit / 5~6초 video
— API reference
base_url for SDK: https://api.hometip.net/ai-model/{model_id="videogen-1"}/v1
{MODEL_ID}: ["videogen-1"]
— base_url example
•
https://api.hometip.net/ai-model/videogen-1/v1/video_generation
Available models: [ text-to-video, image-to-video ]
— Create Video Generation Task
import requests
import json
url = "https://api.hometip.net/ai-model/videogen-1/v1/video_generation"
api_key = "Fill in your api_key"
payload = json.dumps({
"model": "text-to-video",
"prompt": "[Truck left,Pan right]A woman is drinking coffee.",
})
headers = {
'API-KEY': f'Bearer $SUBSCRIPTION_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Python
복사
— Query of Generation Status
import requests
import json
api_key="fill in the api_key"
task_id="fill in the task_id"
url = f"https://api.hometip.net/ai-model/videogen-1/v1/query/video_generation?task_id={task_id}"
payload = {}
headers = {
'API-KEY': f'Bearer {$SUBSCRIPTION_KEY}',
'content-type': 'application/json',
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Python
복사
— Retrieve the download URL of the video file
import requests
group_id = "fill in the groupid - optional"
api_key = "fill in the api key"
file_id = "fill in the file id"
url = f'https://api.hometip.net/ai-model/videogen-1/v1/files/retrieve?GroupId={group_id}&file_id={file_id}'
headers = {
'content-type': 'application/json',
'API-KEY': f'Bearer {$SUBSCRIPTION_KEY}'
}
response = requests.get(url, headers=headers)
print(response.text)
Python
복사
— Schema
Input
prompt string* required
The text prompt to guide video generation.
image_url string
URL of the input image.
seed integer
Random seed for reproducibility. If None, a random seed is chosen.
resolution ResolutionEnum
Resolution of the generated video (480p or 720p). Default value: "720p"
Possible enum values: 480p, 720p
num_inference_steps integer
Number of inference steps for sampling. Higher values give better quality but take longer. Default value: 30
inference_steps integer
Number of inference steps for sampling. Higher values give better quality but take longer.
enable_safety_checker boolean
If set to true, the safety checker will be enabled.
enable_prompt_expansion boolean
Whether to enable prompt expansion.
{
"prompt": "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage.",
"image_url": "https://fal.media/files/elephant/8kkhB12hEZI2kkbU8pZPA_test.jpeg",
"resolution": "720p",
"num_inference_steps": 30,
"enable_safety_checker": true,
"enable_prompt_expansion": true
}
JavaScript
복사
Output
The generated video file.
seed integer* required
The seed used for generation.
{
"video": {
"url": "https://v3.fal.media/files/elephant/Nj4jZupkZvR7g0QkNueJZ_video-1740522225.mp4"
}
}
JavaScript
복사
Example
A video of a man hiking with a backpack. The bag must be the main subject. Walking slowly
Click to watch the video
Video of cleaning with a vacuum cleaner. slow movement. low angle
Click to watch the video
Prompt : Remove the cooking effect and only add camera movement. highlight the food in Zoom format.promotional video for this food
Click to watch the video