Skip to main content
The lucy-pro-t2v model generates videos directly from text descriptions without requiring an input image. This is ideal for creating videos from scratch based on natural language prompts.

Basic Usage

1

Import Dependencies

Import the Decart provider and the experimental video generation function:
2

Generate Video

Call generateVideo with the lucy-pro-t2v model and your text prompt:
Source Reference: examples/tasks/video-generation-t2v.ts:7-10
3

Save the Video

Write the generated video to a file:

Complete Example

Customizing Output

Aspect Ratio

Control video orientation with the aspectRatio parameter:
The aspectRatio parameter is converted to an orientation value (landscape or portrait) in the API request.Source Reference: src/decart-video-model.ts:110-122

Resolution

Set video resolution using the resolution parameter:
Only 1280x720 (720p) and 854x480 (480p) resolutions are supported. Other values will generate a warning.Source Reference: src/decart-video-model.ts:125-135

Reproducible Results

Use the seed parameter to generate reproducible videos:
Using the same prompt, seed, and settings will produce the same video output.Source Reference: src/decart-video-model.ts:152-154

Advanced Configuration

Custom Polling Behavior

Video generation is asynchronous. Customize the polling behavior:
number
default:"1500"
Time in milliseconds between status checks during video generation.Source Reference: src/decart-video-model.ts:196
number
default:"300000"
Maximum time in milliseconds to wait for video generation (default: 5 minutes).Source Reference: src/decart-video-model.ts:197

Abort Signal

Cancel long-running video generation requests:
Source Reference: src/decart-video-model.ts:204-209

Writing Effective Prompts

  • Be specific about the subject, action, and environment
  • Include motion or camera movement descriptions
  • Specify lighting, weather, or atmosphere when relevant
  • Keep prompts concise but descriptive (1-2 sentences)
Good Examples:
  • “A golden retriever running through a sunny meadow with wildflowers”
  • “Aerial view of a city at sunset, camera slowly panning across skyscrapers”
  • “Close-up of raindrops falling on a window with a blurred cityscape behind”
Less Effective:
  • “A dog” (too vague)
  • “A detailed scene with a dog running in a field with flowers and trees and mountains in the background on a sunny day…” (too long)

Response Structure

The generateVideo function returns a result object:
Source Reference: src/decart-video-model.ts:247-261

Error Handling

Common errors include timeout (exceeding 5 minutes), job failure, or network issues.Source References:
  • Timeout error: src/decart-video-model.ts:211-216
  • Job failure: src/decart-video-model.ts:230-235

Next Steps

Image-to-Video

Animate existing images into videos

Motion Control

Control camera and subject movement

Settings Reference

View all configuration options

Examples

Browse complete working examples