(realtimeCanvas)
- createLCMGeneration - Create LCM Generation
- 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 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.realtimeCanvas.createLCMGeneration();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LeonardoCore } from "@leonardo-ai/sdk/core.js";
import { realtimeCanvasCreateLCMGeneration } from "@leonardo-ai/sdk/funcs/realtimeCanvasCreateLCMGeneration.js";
// Use `LeonardoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const leonardo = new LeonardoCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await realtimeCanvasCreateLCMGeneration(leonardo);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CreateLCMGenerationResponse>
Error Type | 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.realtimeCanvas.performAlchemyUpscaleLCM();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LeonardoCore } from "@leonardo-ai/sdk/core.js";
import { realtimeCanvasPerformAlchemyUpscaleLCM } from "@leonardo-ai/sdk/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js";
// Use `LeonardoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const leonardo = new LeonardoCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await realtimeCanvasPerformAlchemyUpscaleLCM(leonardo);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.PerformAlchemyUpscaleLCMResponse>
Error Type | 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.realtimeCanvas.performInpaintingLCM();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LeonardoCore } from "@leonardo-ai/sdk/core.js";
import { realtimeCanvasPerformInpaintingLCM } from "@leonardo-ai/sdk/funcs/realtimeCanvasPerformInpaintingLCM.js";
// Use `LeonardoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const leonardo = new LeonardoCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await realtimeCanvasPerformInpaintingLCM(leonardo);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.PerformInpaintingLCMResponse>
Error Type | 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.realtimeCanvas.performInstantRefine();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LeonardoCore } from "@leonardo-ai/sdk/core.js";
import { realtimeCanvasPerformInstantRefine } from "@leonardo-ai/sdk/funcs/realtimeCanvasPerformInstantRefine.js";
// Use `LeonardoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const leonardo = new LeonardoCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await realtimeCanvasPerformInstantRefine(leonardo);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.PerformInstantRefineResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |