Skip to content

Reference to Video

Shows Vidu's differentiated Reference-to-Video feature - generating a video that preserves the identity of multiple subjects supplied as reference images.

This example assumes using Vidu; is in scope and apiKey contains your Vidu API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
using var client = new ViduClient(apiKey);

// Up to 7 reference images can be supplied; each is used as a subject reference
// that Vidu preserves across the generated frames.
var task = await client.Generation.CreateReferenceToVideoTaskAsync(
    model: Model.Viduq3Turbo,
    prompt: "The two characters walk together through a neon-lit Tokyo street at night",
    images: new List<string>
    {
        "https://prod-file.vidu.studio/static/images/home/ref1.png",
        "https://prod-file.vidu.studio/static/images/home/ref2.png",
    },
    duration: 5,
    aspectRatio: AspectRatio.x16_9,
    resolution: Resolution.x720p);

Console.WriteLine($"Task ID: {task.TaskId}");
Console.WriteLine($"State: {task.State}");