Code snippetVideo and audioIntermediate · 5 min

Image-to-video generation with Vercel AI SDK

Use the Vercel AI SDK to send an image and prompt for video generation.

Any modelVerbatim
Code
prompt: {
  image: "[[image_url_or_data]]",
  text: "[[animation_description]]"
}
Language

json

Explanation

The prompt parameter accepts an object with image and text fields for image-to-video generation. The image field can be a URL string, base64-encoded string, Uint8Array, ArrayBuffer, or Buffer.

What it does and when to use it

This snippet shows how to format a prompt for image-to-video generation using the Vercel AI SDK. It specifies that the prompt object should contain an 'image' field for the source image and a 'text' field for the animation instructions.

Why it works

The Vercel AI SDK is designed to abstract away the complexities of different AI model APIs. By providing a structured prompt object with specific fields like 'image' and 'text', it ensures the model receives the necessary inputs in the correct format for image-to-video transformation.

Sources and credit

First seen on Subvolts Jul 30, 2026. Updated Sep 11, 2026. Spotted a problem? Tell us.

Where it shows up
Related in the PlaybookPlaybook →

The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.

Questions people ask

Which AI tools does this work with?
Any current model. It was seen with in the sources.
Where did this come from?
xAI (xAI Docs: Guides). Subvolts collected, normalized and credited it; the link above opens the original.