(generation)
- createGeneration - Create a Generation of Images
- createLCMGeneration - Create LCM Generation
- createSVDMotionGeneration - Create SVD Motion Generation
- createTextureGeneration - Create Texture Generation
- deleteGenerationById - Delete a Single Generation
- deleteTextureGenerationById - Delete Texture Generation by ID
- getGenerationById - Get a Single Generation
- getGenerationsByUserId - Get generations by user ID
- performAlchemyUpscaleLCM - Perform Alchemy Upscale on a LCM image
- performInpaintingLCM - Perform inpainting on a LCM image
- performInstantRefine - Perform instant refine on a LCM image
This endpoint will generate images
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.createGeneration({});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateGenerationRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.CreateGenerationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will generate a LCM image generation.
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.createLCMGeneration({
imageDataUrl: "<value>",
prompt: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateLCMGenerationRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.CreateLCMGenerationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will generate a SVD motion generation.
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.createSVDMotionGeneration({
imageId: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateSVDMotionGenerationRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.CreateSVDMotionGenerationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will generate a texture generation.
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.createTextureGeneration({});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateTextureGenerationRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.CreateTextureGenerationResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint deletes a specific generation
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.deleteGenerationById("<value>");
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The ID of the generation to delete. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.DeleteGenerationByIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint deletes the specific texture generation.
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.deleteTextureGenerationById("<value>", {});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | "id" is required (enter it either in parameters or request body) |
requestBody |
operations.DeleteTextureGenerationByIdRequestBody | ➖ | Query parameters can also be provided in the request body as a JSON object |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.DeleteTextureGenerationByIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will provide information about a specific generation
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.getGenerationById("<value>");
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The ID of the generation to return. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetGenerationByIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint returns all generations by a specific user
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.getGenerationsByUserId("<value>", 10, 0);
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
userId |
string | ✔️ | N/A |
limit |
number | ➖ | N/A |
offset |
number | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.GetGenerationsByUserIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will perform Alchemy Upscale on a LCM image
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.performAlchemyUpscaleLCM({
imageDataUrl: "<value>",
prompt: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PerformAlchemyUpscaleLCMRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.PerformAlchemyUpscaleLCMResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will perform a inpainting on a LCM image
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.performInpaintingLCM({
imageDataUrl: "<value>",
maskDataUrl: "<value>",
prompt: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PerformInpaintingLCMRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.PerformInpaintingLCMResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
This endpoint will perform instant refine on a LCM image
import { Leonardo } from "@leonardo-ai/sdk";
const leonardo = new Leonardo({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await leonardo.generation.performInstantRefine({
imageDataUrl: "<value>",
prompt: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.PerformInstantRefineRequestBody | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
Promise<operations.PerformInstantRefineResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |