npm add @leonardo-ai/sdk
yarn add @leonardo-ai/sdk
To get access to the API and fetch an API key, please sign up for access.
import { Leonardo } from "@leonardo-ai/sdk";
import { CreateDatasetResponse } from "@leonardo-ai/sdk/dist/sdk/models/operations";
const sdk = new Leonardo({
security: {
bearerAuth: "",
},
});
sdk.dataset.createDataset({
description: "corrupti",
name: "Kelvin Sporer",
}).then((res: CreateDatasetResponse) => {
if (res.statusCode == 200) {
// handle response
}
});
- createDataset - Create a Dataset
- deleteDatasetById - Delete a Single Dataset by ID
- getDatasetById - Get a Single Dataset by ID
- uploadDatasetImage - Upload dataset image
- uploadDatasetImageFromGen - Upload a Single Generated Image to a Dataset
- createGeneration - Create a Generation of Images
- deleteGenerationById - Delete a Single Generation
- getGenerationById - Get a Single Generation
- getGenerationsByUserId - Get generations by user ID
- deleteInitImageById - Delete init image
- getInitImageById - Get single init image
- uploadInitImage - Upload init image
- createModel - Train a Custom Model
- deleteModelById - Delete a Single Custom Model by ID
- getModelById - Get a Single Custom Model by ID
- getUserSelf - Get user information
- createVariationUpscale - Create upscale
- getVariationById - Get variation by ID