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 CaseDescriptionModels
TranslationTranslate videos from one language to another.TrueFusion Family
UpscalingUpscale videos to a higher resolution.TrueFusion Family
Video GenerationGenerate videos from text.TrueFusion Family
Video to VideoGenerate videos from videos.TrueFusion Family
Text to VideoGenerate videos from text.TrueFusion Family
Image to VideoGenerate videos from images.TrueFusion Family

Video Generation Models

Skytells offers two powerful models for video generation:

ModelAPI NameResolutionInference TimeCost
TrueFusion Videotruefusion-video720p~1-6 minutes$0.112 per second
TrueFusion Video Protruefusion-video-pro1080p~1-5 minutes$0.196 per second

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

POST/v1/predict

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 or truefusion-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 name
  • input The input parameters for video generation
  • webhook 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

POST
/v1/predict
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"]
    }
  }'

HOOK/your-webhook-url

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.

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.


GET/v1/predictions/{id}

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 generated
  • succeeded: Generation completed successfully
  • failed: Generation failed (check error messages)
  • canceled: Generation was manually canceled

Request

GET
/v1/predictions/{id}
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"
  }
}

POST/v1/predictions/{id}/cancel

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

POST
/v1/predictions/{id}/cancel
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"
}

Was this page helpful?