Skip to content

Latest commit

 

History

History
219 lines (147 loc) · 21.4 KB

README.md

File metadata and controls

219 lines (147 loc) · 21.4 KB

Variation

(variation)

Available Operations

createUniversalUpscalerJob

This endpoint will create a high resolution image using Universal Upscaler

Example Usage

import { Leonardo } from "@leonardo-ai/sdk";

const leonardo = new Leonardo({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await leonardo.variation.createUniversalUpscalerJob({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.CreateUniversalUpscalerJobRequestBody ✔️ 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.

Response

Promise<operations.CreateUniversalUpscalerJobResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

createVariationNoBG

This endpoint will create a no background variation of the provided image ID

Example Usage

import { Leonardo } from "@leonardo-ai/sdk";

const leonardo = new Leonardo({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await leonardo.variation.createVariationNoBG({
    id: "<id>",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.CreateVariationNoBGRequestBody ✔️ 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.

Response

Promise<operations.CreateVariationNoBGResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

createVariationUnzoom

This endpoint will create an unzoom variation for the provided image ID

Example Usage

import { Leonardo } from "@leonardo-ai/sdk";

const leonardo = new Leonardo({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await leonardo.variation.createVariationUnzoom({});

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.CreateVariationUnzoomRequestBody ✔️ 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.

Response

Promise<operations.CreateVariationUnzoomResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

createVariationUpscale

This endpoint will create an upscale for the provided image ID

Example Usage

import { Leonardo } from "@leonardo-ai/sdk";

const leonardo = new Leonardo({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await leonardo.variation.createVariationUpscale({
    id: "<id>",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.CreateVariationUpscaleRequestBody ✔️ 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.

Response

Promise<operations.CreateVariationUpscaleResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getVariationById

This endpoint will get the variation by ID

Example Usage

import { Leonardo } from "@leonardo-ai/sdk";

const leonardo = new Leonardo({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await leonardo.variation.getVariationById("<value>");

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
id string ✔️ "id" is required
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.

Response

Promise<operations.GetVariationByIdResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /