This example assumes using StabilityAI; is in scope and apiKey contains your StabilityAI API key.
1 2 3 4 5 6 7 8 9101112131415
usingvarclient=newStabilityAIClient(apiKey);varresponse=awaitclient.Generate.CreateStableImageGenerateSd3Async(contentType:"multipart/form-data",accept:CreateStableImageGenerateSd3Accept.ApplicationJson,request:newCreateStableImageGenerateSd3Request{Prompt="A crisp studio product photo of a ceramic espresso cup on a slate table",Model=CreateStableImageGenerateSd3RequestModel.Sd35Large,AspectRatio=CreateStableImageGenerateSd3RequestAspectRatio.x1_1,OutputFormat=CreateStableImageGenerateSd3RequestOutputFormat.Png,});Console.WriteLine($"Seed: {response.Seed}");Console.WriteLine($"Base64 bytes: {response.Image.Length}");