Generate with Motion 2.0 Using Text Prompts

Example for generating a video from text

Follow this recipe to generate video using text:


The guide will recreate the following functionality in the Web UI via API.'

Sample Request

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-text-to-video \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "height": 480,
  "width": 832,
  "prompt": "A dog walking on the beach",
  "frameInterpolation": true,
  "isPublic": false,
  "promptEnhance": true
}
'

πŸ“˜

Smooth Video

Applying frameInterpolation:trueis the same as applying Smooth Video from the Advanced Settings tab

Video Dimensions

Use the following width and height combinations to achieve the supported video dimensions.

Video DimensionWidthHeight
9:16480832
16:9832480
2:3512768
4:5576720

Style

Choose a combination of Vibe, Lighting, Shot Type, and Color Theme. Make sure to choose only one or none of each of the four style types similar to the web app.

Vibe

Vibe OptionStyle ID
Clay964d8a8f-865b-48c5-b79e-e75ae8727648
Color Sketch9cdfea2a-b4ab-4e97-a558-ec9fcb78f30a
Logo12b0d8c9-5cf8-4094-a3e5-6809bc269e21
Papercraftc4ac9781-8624-4b7d-bbed-dedaaf7b9da6
Pro Photo28a53b2e-eb80-41d7-8360-208068fecf49
Sci-Fid28c8f2b-22bb-4c0c-893d-d3835e28f2f7
Sketch6078b232-d1be-4a01-9c10-95c05132a8e4
Stock Footaged760b628-4a1d-41cb-bccb-053a13973b94
Streetshot5658d8ce-d486-4501-a701-7832395a8962

Lighting

Lighting OptionStyle ID
Backlightc39fe4f8-76d6-4aad-899b-e7ca5a4148f3
Candle Lit7d36972e-b9d5-46c7-813d-2c9934f9321b
Chiaroscuroff9bfd01-a7ac-4556-889a-25dd5fc0956f
Film Hazebe32c760-2bb3-49ae-83dc-6f9b2d62a97f
Foggy1d6e92d2-6e83-4ea2-bd4c-34ddfedfa163
Golden Hour3f705252-1197-4f59-b6ed-21625dce6a65
Hardlight64b84d56-8b76-4367-95a6-df345a909af0
Lens Flare4b60b356-a4ab-4983-9e9a-30e0d5b27bc6
Light Art771bc1bd-0f88-4ff9-af63-f646847ed075
Low Key1974bd47-75bb-499a-9c7a-354913904fcf
Luminous994e33e6-4862-495d-9efb-d9a09ecdd769
Mysticalacb9deb3-31e3-495e-ab31-b138fde26bd6
Rainyfa347beb-6d70-482d-94a8-a70736e9e7f1
Soft Light746e70e5-ab4d-4f39-9057-75698cb64bc2
Volumetric92c2d8d4-9757-4cbf-88f3-d7ea54c425af

Shot Type

Shot Type OptionStyle ID
Bokeh2e2669d5-4473-4ab9-b476-9f0a314bf661
Cinematica0f4907f-8cd0-41de-b67c-460ec3a2bda0
Close Upba6baeab-1a8f-4cb8-b0f5-efc13a805371
Overhead8eb75811-5148-40ac-8abc-531e64f6e269
Spiritual8b5f5d7f-fd3f-4235-92a4-baa9f8507fbb
Spooky49dfd828-5473-4594-9187-c6129aeaa4bf

Color Theme

Color Theme OptionStyle ID
Autumn21b0a3e9-304a-4ff2-9603-15ddbc5a6b82
Complimentarydcfb60ca-f165-407f-b01c-2b34d22432c2
Cool913efd9b-1da8-4876-91d3-b6de0aa5582c
Dark9581d460-7023-4d85-b440-9fea8bbfe194
Earthy9517dd8e-9588-4fe5-aede-6711438dd420
Electricd26aded5-e191-45d5-9662-db36b7085a76
Iridescent2380bd07-caf1-4ae6-a348-3bcf4b12f90a
Pastel6c27f994-2e03-4d07-95b8-4a5db5bd3a27
Split1bffb3f3-4110-4185-85f9-f7254ae6f81d
Terracotta Teal46af026e-d21a-4cf4-a0c0-b482e6800331
Ultraviolet9243b709-ed08-49d9-9198-440f2127d3b5
Vibrantf84bbf31-1d72-415d-ae4c-deb4b18fccba
Warmd838fb14-9719-44f3-877e-da70d072b79c

Sample Request with Style

curl --request POST \
     --url https://cloud.leonardo.ai/api/rest/v1/generations-text-to-video \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <YOUR_API_KEY>' \
     --header 'content-type: application/json' \
     --data '
{
  "height": 480,
  "width": 832,
  "prompt": "A dog walking on the beach",
  "frameInterpolation": true,
  "isPublic": false,
  "promptEnhance": true,
  "styleIds": [
    "28a53b2e-eb80-41d7-8360-208068fecf49",
    "3f705252-1197-4f59-b6ed-21625dce6a65",
    "d838fb14-9719-44f3-877e-da70d072b79c"
  ]
}
'

Cost

The Text-to-Video endpoint costs 250 API Credits per video.

Width x Height (Size)LengthAPI Credit Cost
480 x 832 (9:16)5 seconds250
832 x 480 (16:9)5 seconds250
512 x 768 (2:3)5 seconds250
576 x 720 (4:5)5 seconds250