Skip to content

Vidu

Modern .NET SDK for Vidu generated from the provider's OpenAPI definition with AutoSDK.

Nuget package dotnet License: MIT Discord

Generated from the source spec

Built from Vidu's OpenAPI definition so the SDK stays close to the upstream API surface.

Auto-updated

Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.

Modern .NET

Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.

Docs from examples

Examples stay in sync between the README, MkDocs site, and integration tests through the AutoSDK docs pipeline.

Usage

1
2
3
using Vidu;

using var client = new ViduClient(apiKey);

Text to Video

Shows how to submit a text-to-video generation task with Vidu and poll for the result.

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

// Submit a text-to-video generation task with viduq3-turbo at 720p.
var task = await client.Generation.CreateTextToVideoTaskAsync(
    model: Model.Viduq3Turbo,
    prompt: "A golden retriever running through a sunlit meadow in cinematic slow motion",
    duration: 5,
    aspectRatio: AspectRatio.x16_9,
    resolution: Resolution.x720p);

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

// Poll the task until it reaches a terminal state (success/failed).
var creations = await client.Tasks.GetTaskCreationsAsync(id: task.TaskId!);
Console.WriteLine($"Creations state: {creations.State}");

// When the task succeeds, the result contains one or more creation URLs valid for 24 hours.
if (creations.State == TaskState.Success && creations.Creations is { Count: > 0 })
{
    Console.WriteLine($"Video URL: {creations.Creations[0].Url}");
}

Image to Video

Shows how to animate a single reference image into a short video clip.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using var client = new ViduClient(apiKey);

// Provide a publicly reachable image URL. Base64 data URIs are also accepted.
var task = await client.Generation.CreateImageToVideoTaskAsync(
    model: Model.Viduq3Turbo,
    images: new List<string> { "https://prod-file.vidu.studio/static/images/home/sample.png" },
    prompt: "The subject gently turns its head and smiles",
    duration: 5,
    resolution: Resolution.x720p);

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

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.

 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}");

Start End to Video

Shows how to generate a video that interpolates between a start frame and end frame.

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

// Provide exactly two images - the start frame and the end frame.
// Aspect ratios must be between 0.8 and 1.25 of each other.
var task = await client.Generation.CreateStartEndToVideoTaskAsync(
    model: Model.Viduq3Turbo,
    images: new List<string>
    {
        "https://prod-file.vidu.studio/static/images/home/start.png",
        "https://prod-file.vidu.studio/static/images/home/end.png",
    },
    prompt: "Smooth transition with a subtle camera push-in",
    duration: 5,
    resolution: Resolution.x720p);

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

MEAI Tools

Shows how to expose Vidu operations as Microsoft.Extensions.AI tools so any IChatClient (OpenAI, Anthropic, etc.) can invoke them as function calls.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
// Use a fake API key - we only exercise the tool builders, not the network.
using var client = new ViduClient(apiKey: "test-key");

// Each helper returns an AIFunction that can be passed into ChatOptions.Tools.
var textToVideo = client.AsTextToVideoTool();
var imageToVideo = client.AsImageToVideoTool();
var referenceToVideo = client.AsReferenceToVideoTool();
var startEndToVideo = client.AsStartEndToVideoTool();
var getTask = client.AsGetTaskCreationsTool();
var upscale = client.AsUpscaleTool();

var tools = new AIFunction[]
{
    textToVideo, imageToVideo, referenceToVideo, startEndToVideo, getTask, upscale,
};

Support

Bugs

Open an issue in tryAGI/Vidu.

Ideas and questions

Use GitHub Discussions for design questions and usage help.

Community

Join the tryAGI Discord for broader discussion across SDKs.

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.