1.0.5 • Published 12 months ago

leonardoai-api v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

LeonardoAI-API

A JavaScript library to use the Leonardo AI API.

Installation

$ npm install leonardoai-api

Get started

The library provides a set of classes and methods for accessing the various features of the API. The main classes are Leonardo, Generation, Image, and User.

const { Leonardo, Generation, Image, User } = require('leonardoai-api');

// Create the client
const leonardo = new Leonardo({ token: "..." });

// Get the generations (groups of images)
const generations = await leonardo.getGenerationFeed();

// Create a new generation (group of images)
const generation = await leonardo.createGeneration({
  prompt: 'a beautiful sunset over the ocean',
  quantity: 1,
  imageWidth: 512,
  imageHeight: 512,
});

// Get the generated images from the generation
const images = await generation.generated_images;

// Delete an image
await images[0].delete();

// Delete a generation
await generation.delete();
1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago