What You’ll Build
An image-to-video workflow that:- Loads an input image from a file or URL
- Submits an image-to-video generation job
- Polls for completion
- Saves the generated video
Prerequisites
- Node.js 18 or higher
- A Decart API key
- An input image (PNG, JPG, or WebP)
Quick Start
From Local File
Load an image from the local filesystem:From URL
You can also use an image URL:From Browser (File Upload)
In a browser environment, use file input:Manual Job Control
For webhooks or background processing:Prompt Tips
Effective prompts for image-to-video:Natural Motion
Camera Movement
Bringing Scenes to Life
Express API Example
Supported Image Formats
- PNG
- JPEG/JPG
- WebP
- GIF (first frame used)
Output Specifications
- Format: MP4 (H.264)
- Duration: 5 seconds
- Frame Rate: 30 FPS
- Resolution: Based on input image (maintains aspect ratio)
Best Practices
- Use high-quality input images - Better input yields better output
- Be specific with prompts - Describe the type of motion you want
- Consider image composition - Images with clear subjects work best
- Test different prompts - Experiment to find what works for your use case
- Cache results - Store generated videos to avoid regenerating