Updated and supported automatically if there are no breaking changes
All modern .NET features - nullability, trimming, NativeAOT, etc.
Support .Net Framework/.Net Standard 2.0
Usage
1 2 3 4 5 6 7 8 91011121314
usingLeonardo;usingvarapi=newLeonardoClient(apiKey);varcreateResponse=awaitapi.Image.CreateGenerationAsync(prompt:"Generate cat");createResponse.SdGenerationJob.Should().NotBeNull();awaitTask.Delay(TimeSpan.FromSeconds(15));varresponse=awaitapi.Image.GetGenerationByIdAsync(createResponse.SdGenerationJob?.GenerationId??thrownewInvalidOperationException("GenerationId is null"));varurl=response.GenerationsByPk?.GeneratedImages?.ElementAtOrDefault(0)?.Url;
Generate Image
1 2 3 4 5 6 7 8 910
usingvarapi=GetAuthorizedClient();varcreateResponse=awaitapi.Image.CreateGenerationAsync(prompt:"Generate cat");awaitTask.Delay(TimeSpan.FromSeconds(15));varresponse=awaitapi.Image.GetGenerationByIdAsync(createResponse.SdGenerationJob?.GenerationId??thrownewInvalidOperationException("GenerationId is null"));varurl=response.GenerationsByPk?.GeneratedImages?.ElementAtOrDefault(0)?.Url;