Skip to content

Leonardo

Nuget package dotnet License: MIT Discord

Generated C# SDK based on Leonardo OpenAPI specification using NSwag.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
using Leonardo;

using var api = new LeonardoApi();
api.AuthorizeUsingBearer(apiKey);

var createResponse = await api.Image.CreateGenerationAsync(
    prompt: "Generate cat");

createResponse.SdGenerationJob.Should().NotBeNull();

await Task.Delay(TimeSpan.FromSeconds(15));

var response = await api.Image.GetGenerationByIdAsync(createResponse.SdGenerationJob?.GenerationId ?? throw new InvalidOperationException("GenerationId is null"));

var url = response.GenerationsByPk?.GeneratedImages?.ElementAtOrDefault(0)?.Url;

Support

Priority place for bugs: https://github.com/tryAGI/Leonardo/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Leonardo/discussions
Discord: https://discord.gg/Ca2xhfBf3v