Interpolate Frames Two Images
This example assumes using Google.Gemini; is in scope and apiKey contains your Google.Gemini API key.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 | using var client = new GeminiClient(apiKey);
try
{
var startFrame = await client.GenerateImageAsync(
prompt: "A red circle on a white background",
imageSize: "1K");
var endFrame = await client.GenerateImageAsync(
prompt: "A blue square on a white background",
imageSize: "1K");
var result = await client.InterpolateFramesAsync(
startFrame: startFrame.ImageData!,
endFrame: endFrame.ImageData!,
prompt: "Smoothly transition between the two shapes");
}
catch (ApiException ex) when (ex.StatusCode is System.Net.HttpStatusCode.TooManyRequests)
{
}
catch (ApiException ex) when (ex.StatusCode is System.Net.HttpStatusCode.BadRequest)
{
}
|