Synthome Docs
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.

PropertyValue
Model IDkwaivgi/kling-v2.1
ProviderReplicate
TypeVideo 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

OptionTypeDefaultDescription
promptstringrequiredText description of the video motion
startImagestringrequiredFirst frame image URL
resolution"720p" | "1080p"-Output resolution (maps to standard/pro mode)
duration5 | 10-Video duration in seconds
endImagestring-Target end frame image URL (1080p/pro only)

Resolution Modes

Kling v2.1 supports two quality modes that map to resolution:

ResolutionModeFrame RateUse Case
720pStandard24fpsFast generation
1080pPro24fpsHigh-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

  1. Start Image Quality: Use high-resolution, clear images for best results
  2. Descriptive Prompts: Include motion descriptions like "slowly", "gracefully", "turns"
  3. Duration Choice: Use 5s for simple motions, 10s for complex transformations
  4. End Frame: Only available in pro mode (1080p) - great for controlled transitions

How is this guide?

On this page