Generate Video with Replicate
replicate_generate_videoGenerate a video clip from a text prompt, optionally using a starting image for image-to-video generation.
Instructions
Generate a video clip from a text prompt (and optionally a starting image). Video generation is slow — typically 1-5 minutes per clip.
DISPLAY REQUIREMENT — after this tool returns successfully, include the URL(s) printed in the tool's text content so the user can open the video. URLs expire in ~24h.
Args:
prompt (string): Text description of the video.
model (string, default "kling-pro"): Curated key (kling-pro, minimax-video, hunyuan-video, luma-ray, wan-2.2, grok-video, seedance) or "owner/name[:version]".
image_url (string, optional): Starting frame for image-to-video. Not all models support this.
duration_seconds (1-60, optional): Desired duration. Model-dependent.
aspect_ratio ("16:9" | "9:16" | "1:1", optional): Aspect ratio.
extra_input (object, optional): Additional model-specific inputs.
download (boolean, default true): Download the MP4 locally.
timeout_ms: Max wait. Default 300000 (5min). For very long videos, increase or rely on the pending+poll flow.
Returns: PredictionResult (see replicate_generate_image for shape). The local_paths will contain .mp4 files when downloaded.
Tip: If timeout_ms is exceeded, the result will have pending=true and a prediction_id. Wait a minute, then call replicate_get_prediction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Either a curated key (kling-pro, minimax-video, hunyuan-video, luma-ray, wan-2.2, grok-video, seedance) or a Replicate identifier. | kling-pro |
| prompt | Yes | Text prompt describing the video. | |
| download | No | Whether to download the generated files locally. Default true. When false, only Replicate URLs are returned (URLs expire after ~24h). | |
| image_url | No | Optional starting image URL for image-to-video. Not all models support this — check model schema. | |
| timeout_ms | No | Max ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min). | |
| extra_input | No | Additional model-specific inputs. | |
| aspect_ratio | No | Aspect ratio. | |
| duration_seconds | No | Desired duration in seconds. Model-dependent. |