Generate Video
Generating a video is a bit different from generating an image. Video generation uses specialized AI models to create fluid motion based on your text prompts.
Use Cases
Create stunning videos with our GenAI Video generation models. At Skytells, we offer a wide range of video models for different use cases, each with its own unique features and capabilities.
Use Case | Description | Models |
---|---|---|
Translation | Translate videos from one language to another. | TrueFusion Family |
Upscaling | Upscale videos to a higher resolution. | TrueFusion Family |
Video Generation | Generate videos from text. | TrueFusion Family |
Video to Video | Generate videos from videos. | TrueFusion Family |
Text to Video | Generate videos from text. | TrueFusion Family |
Image to Video | Generate videos from images. | TrueFusion Family |
Video Generation Models
Skytells offers two powerful models for video generation:
Model | API Name | Resolution | Inference Time | Cost |
---|---|---|---|---|
TrueFusion Video | truefusion-video | 720p | ~1-6 minutes | $0.112 per second |
TrueFusion Video Pro | truefusion-video-pro | 1080p | ~1-5 minutes | $0.196 per second |
Videos are billed by second with a minimum duration of 5 seconds. Actual processing time depends on prompt complexity, video length, and other parameters.
Choosing Video Model
When deciding between truefusion-video
and truefusion-video-pro
, consider the following:
- TrueFusion Video offers a good balance of quality and cost at 720p resolution
- TrueFusion Video Pro provides higher quality 1080p video at a premium price
- Both models support the same input parameters and capabilities
- Processing time is slightly faster on TrueFusion Video Pro for the same duration
- For budget-conscious projects, TrueFusion Video is recommended
- For professional-quality outputs, TrueFusion Video Pro is recommended
How Video Generation Works
Unlike image generation, video predictions:
- Are processed asynchronously (the
await
parameter is disabled by default) - Are queued for processing with webhook notifications upon completion
- Require longer processing times than images
Create a Video Prediction
To generate a video, send a POST request to the prediction endpoint with your video generation parameters.
The request requires:
- Your API key in the headers
- The model name either
truefusion-video
ortruefusion-video-pro
- Input parameters including prompt and duration
- Optional webhook configuration for notifications
Video generation happens asynchronously, meaning your request will return immediately with a prediction ID while the actual video processing continues in the background.
Required Parameters
model
The model nameinput
The input parameters for video generationwebhook
The webhook configuration for notifications
Input Parameters
- Name
prompt
- Type
- string
- Description
Text description of what you want in your video.
- Name
duration
- Type
- enum
- Description
Length of the video in seconds [5, 10]. Default is
5
seconds.
- Name
cfg_scale
- Type
- float
- Description
Controls how closely the model follows your prompt (typically 0.5-1.5).
- Name
start_image
- Type
- string
- Description
Optional URL to an image that influences the starting frame, By providing a start_image, the aspect_ratio will be ignored and the model will treat the prediction as image-to-video prediction.
- Name
aspect_ratio
- Type
- string
- Description
Aspect ratio of the video. However, aspect ratio will be ignored if start_image is provided.
- Name
negative_prompt
- Type
- string
- Description
Description of what to avoid in the video.
Request
curl -X POST "https://api.skytells.ai/v1/predict" \
-H "x-api-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "truefusion-video",
"gpu": "H100",
"safety_check": true,
"input": {
"prompt": "a portrait photo of a man with flowing hair, looking confident",
"duration": 5,
"cfg_scale": 0.5,
"start_image": "IMAGE_URL",
"aspect_ratio": "16:9",
"negative_prompt": ""
},
"webhook": {
"url": "YOUR_WEBHOOK_URL",
"events": ["completed"]
}
}'
Prediction Notifications
The webhook is required
for video generation.
After successful video generation, your server will receive the complete Prediction via the webhook URL you provided. The webhook payload will contain the same structure as the prediction response, including output URLs to the generated video.
Please note that the webhook is triggered for each prediction status change.
Learn more about the webhook in the Webhooks section.
Configure your webhook endpoint to properly handle and process these notifications, Store your videos in a secure location as soon as you receive the webhook notification. Skytells does not retain data more than 5 minutes after a prediction is completed. Implementing proper error handling and retry logic is recommended.
If you need to check the status of your video generation at any time, you can query the prediction endpoint with the prediction ID, Meanwhile, we recommend using the webhook to get notified when the video generation is completed.
Video Generation Status
You can check the status of your video generation at any time by querying the prediction endpoint with the prediction ID. This is particularly useful if you're not using webhooks or need to manually check the progress.
The prediction status will transition through the following stages:
processing
: The video is being generatedsucceeded
: Generation completed successfullyfailed
: Generation failed (check error messages)canceled
: Generation was manually canceled
Request
curl -X GET "https://api.skytells.ai/v1/predictions/{id}" \
-H "x-api-key: your-api-key-here"
Response
{
"id": "PREDICTION_ID",
"status": "succeeded",
"stream": false,
"input": {
"prompt": "A man is coding for Skytells",
"duration": 5,
"cfg_scale": 0.5,
"start_image": "YOUR_START_IMAGE_URL",
"aspect_ratio": "16:9",
"negative_prompt": ""
},
"output": [
"VIDE_URL"
],
"created_at": "2023-11-20T14:15:24.000000Z",
"started_at": "2023-11-20T14:15:25.123456Z",
"completed_at": "2023-11-20T14:19:52.987654Z",
"updated_at": "2023-11-20T14:19:53.000000Z",
"model": {
"name": "truefusion-video"
},
"webhook": {
"url": "YOUR_WEBHOOK_URL",
"events": ["completed"]
},
"metrics": {
"predict_time": 267.864198
},
"metadata": {
"billing": {
"credits_used": 0.56
},
"storage": {
"files": [
{
"name": "vid_predictionid123456.mp4",
"type": "video/mp4",
"size": 28741832,
"url": "VIDEO_URL"
}
]
}
},
"urls": {
"get": "GET_URL",
"cancel": "CANCEL_URL"
}
}
Cancel a Video Generation
If you need to cancel a video generation that's in progress, you can send a request to the cancel endpoint with the prediction ID. This can be useful to save credits when you no longer need the result or recognize an error in your request parameters.
Note that cancellation is only possible while the prediction is in the processing
state. Once completed, a prediction cannot be canceled.
Request
curl -X POST "https://api.skytells.ai/v1/predictions/{id}/cancel" \
-H "x-api-key: your-api-key-here"
Response
{
"status": "canceled",
"message": "Prediction canceled successfully"
}