Simple Generation Usage

The Switchboard SDK contains high-level extension methods that bundle the entire capture lifecycle (uploading a file, polling for model execution, and downloading the finished file) into a single, straightforward method call: GenerateAsync.


Single Image Generation Flow

This method returns the processed output image directly as a binary stream/buffer.

Use GenerateAsync to process a local file stream and write the resulting output:

using var fileStream = File.OpenRead("photo.jpg");

// 1. Process the image (blocks asynchronously until generation is complete)
using var processedStream = await client.GenerateAsync(
    filter: "claymation-001",
    stream: fileStream,
    width: 1800,
    height: 1200
);

// 2. Save the output
if (processedStream != null)
{
    using var outputStream = File.Create("output.jpg");
    await processedStream.CopyToAsync(outputStream);
}