Skip to content
Dashboard

Seedance 2.5

Seedance 2.5 is a next-generation audio-video joint generation model, built for 30-second storytelling with precise reference control and powerful editing capabilities. Your use is subject to ByteDance's Terms & Privacy Policies.

Video Gen
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({
model: 'bytedance/seedance-2.5',
prompt: 'A serene mountain lake at sunrise.'
});
Read docs

Getting started

Generate videos with Seedance 2.5 using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.

Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.

index.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'bytedance/seedance-2.5',
prompt: 'A chicken flying into the sunset in the style of 90s anime',
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Top-level parameters

Exercise the supported top-level params: prompt, aspectRatio, resolution, and duration.

seedance-text-to-video.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'bytedance/seedance-2.5',
prompt: 'A chicken flying into the sunset in the style of 90s anime',
aspectRatio: '16:9',
resolution: '1280x720',
duration: 5,
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);
ParameterTypeRequiredDescription
promptstringNoText description of the video to generate.
durationnumberNoVideo length in seconds. 4-30 seconds.
resolutionstringNoResolution ('854x480', '1280x720').
aspectRatiostringNoAspect ratio ('16:9', '4:3', '1:1', '3:4', '9:16', '21:9').
generateAudiobooleanNoGenerate synchronized audio with the video.
frameImagesArray<{ image: string; frameType: 'first_frame' | 'last_frame' }>NoFirst and last frames of the clip. A first_frame entry replaces prompt.image and wins when both are set, and adding a last_frame transitions between the two. Seedance accepts image URLs only, so host local files on Vercel Blob first.
inputReferencesArray<{ data: string; mediaType: string }>NoReference images and videos, referenced in the prompt as [Image 1], [Video 1], and so on, numbered separately in the order you pass them. Tag every URL with an explicit mediaType — an untyped URL is treated as an image and emits a warning. See the Input limits table for supported counts.

Input limits

InputFormatsSourcesMax countMax sizeLimits
Imagejpeg, png, webp, bmp, tiff, gif, heic, heifurl3030 MB≥300px · ≤6000px · aspect 2:5–5:2
Videomp4, movurl10200 MB2-30s · ≥300px · ≤6000px
Audiomp3, wavurl15 MB2-30s
Up to 50 reference inputs total across images and videos.

Provider options (bytedance)

Load the compatible Seedance options under providerOptions.bytedance. Frames and references are passed at the top level through frameImages and inputReferences, which change the call shape and are shown in their own examples below.

seedance-provider-options.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'bytedance/seedance-2.5',
prompt: 'A chicken flying into the sunset in the style of 90s anime',
resolution: '1280x720',
duration: 5,
providerOptions: {
bytedance: {
seed: 42,
pollIntervalMs: 5000,
pollTimeoutMs: 600000,
},
},
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);

Pass these Seedance-specific options under providerOptions.bytedance in your generateVideo call.

ParameterTypeRequiredDescription
lastFrameImagestringNoURL of the last frame image, enabling first+last frame mode. Legacy alternative to the top-level frameImages, used only when frameImages is omitted.
referenceImagesstring[]NoReference image URLs for reference-to-video, referenced in the prompt as [Image 1], [Image 2], and so on — see the Input limits table for the supported count. Legacy alternative to the top-level inputReferences, used only when inputReferences is omitted.
referenceVideosstring[]NoReference video URLs for reference-to-video, numbered separately from the images and referenced in the prompt as [Video 1], [Video 2], and so on. Legacy alternative to the top-level inputReferences, used only when inputReferences is omitted.
referenceAudiostring[]NoReference audio URLs, sent alongside the reference images and videos to drive the generated audio.
seednumberNoFix the random seed for reproducible output.
pollIntervalMsnumberNoHow often to check task status. Defaults to 3000.
pollTimeoutMsnumberNoMaximum wait time. Defaults to 300000 (5 minutes).

Frames take priority over references

Frames and references are mutually exclusive. When frameImages is set, inputReferences and the legacy providerOptions.bytedance.referenceImages / referenceVideos are dropped with a warning.

The top-level parameters win over their provider-option equivalents: frameImages overrides prompt.image and lastFrameImage, and inputReferences overrides referenceImages and referenceVideos. Set one or the other, not both.

providerOptions.bytedance.referenceAudio has no top-level equivalent, so it stays a provider option and is sent alongside whichever reference path you use.

Reference-to-video

Pass reference media through the top-level inputReferences so the model keeps subjects, style, and composition consistent — see the Input limits table for the supported counts. Reference each one in the prompt with [Image 1], [Video 1], and so on; images and videos are numbered separately in the order you pass them. Tag every URL with an explicit mediaType, since Seedance cannot infer image or video from a bare URL.

seedance-reference-to-video.ts
import { experimental_generateVideo as generateVideo } from 'ai';
import fs from 'node:fs';
import 'dotenv/config';
async function main() {
const result = await generateVideo({
model: 'bytedance/seedance-2.5',
prompt:
'The lion from [Image 1] walks into the clearing from [Video 1], settles in the long grass, and watches the sun go down.',
aspectRatio: '16:9',
resolution: '1280x720',
duration: 30,
generateAudio: true,
inputReferences: [
{ data: 'https://example.com/lion.jpg', mediaType: 'image/jpeg' },
{ data: 'https://example.com/clearing.mp4', mediaType: 'video/mp4' },
],
providerOptions: {
bytedance: {
pollTimeoutMs: 600000,
},
},
});
// Save the generated video
fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');
}
main().catch(console.error);