Models
Kling v2.1
Kuaishou's high-quality image-to-video generation model
Kling v2.1
High-quality image-to-video generation from Kuaishou AI Team, supporting 720p and 1080p resolution at 24fps.
| Property | Value |
|---|---|
| Model ID | kwaivgi/kling-v2.1 |
| Provider | Replicate |
| Type | Video generation (image-to-video) |
Basic Usage
Kling v2.1 is an image-to-video model that requires a starting image:
import { compose, generateVideo, videoModel } from "@synthome/sdk";
const execution = await compose(
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "The woman turns and smiles at the camera",
startImage: "https://example.com/portrait.jpg",
}),
).execute();Options
| Option | Type | Default | Description |
|---|---|---|---|
prompt | string | required | Text description of the video motion |
startImage | string | required | First frame image URL |
resolution | "720p" | "1080p" | - | Output resolution (maps to standard/pro mode) |
duration | 5 | 10 | - | Video duration in seconds |
endImage | string | - | Target end frame image URL (1080p/pro only) |
Resolution Modes
Kling v2.1 supports two quality modes that map to resolution:
| Resolution | Mode | Frame Rate | Use Case |
|---|---|---|---|
720p | Standard | 24fps | Fast generation |
1080p | Pro | 24fps | High-quality output |
// Standard mode (720p)
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "A gentle breeze moves the leaves",
startImage: "https://example.com/tree.jpg",
resolution: "720p",
});
// Pro mode (1080p)
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "A gentle breeze moves the leaves",
startImage: "https://example.com/tree.jpg",
resolution: "1080p",
});Duration
Generate 5 or 10 second videos:
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "The dancer spins gracefully",
startImage: "https://example.com/dancer.jpg",
duration: 10, // 10 second video
});End Frame Control
In pro mode (1080p), you can specify a target end frame:
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "The scene transitions smoothly",
startImage: "https://example.com/scene-start.jpg",
endImage: "https://example.com/scene-end.jpg",
resolution: "1080p", // Required for end frame
});Examples
Portrait Animation
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "The person looks up and smiles warmly",
startImage: "https://example.com/portrait.jpg",
resolution: "1080p",
duration: 5,
});Product Video
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "The product rotates slowly, highlighting its features",
startImage: "https://example.com/product.png",
resolution: "720p",
duration: 5,
});Scene Transition
generateVideo({
model: videoModel("kwaivgi/kling-v2.1", "replicate"),
prompt: "Day transitions to night with city lights appearing",
startImage: "https://example.com/city-day.jpg",
endImage: "https://example.com/city-night.jpg",
resolution: "1080p",
duration: 10,
});Best Practices
- Start Image Quality: Use high-resolution, clear images for best results
- Descriptive Prompts: Include motion descriptions like "slowly", "gracefully", "turns"
- Duration Choice: Use 5s for simple motions, 10s for complex transformations
- End Frame: Only available in pro mode (1080p) - great for controlled transitions
How is this guide?