@leonardo-ai/sdk 1.61.0 → 1.64.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -12
- package/dist/internal/utils/queryparams.js +4 -2
- package/dist/internal/utils/security.js +1 -1
- package/dist/sdk/element.d.ts +14 -0
- package/dist/sdk/element.js +145 -0
- package/dist/sdk/models/operations/creategeneration.d.ts +19 -12
- package/dist/sdk/models/operations/creategeneration.js +21 -0
- package/dist/sdk/models/operations/createmodel.d.ts +4 -0
- package/dist/sdk/models/operations/createmodel.js +5 -0
- package/dist/sdk/models/operations/createvariationnobg.d.ts +40 -0
- package/dist/sdk/models/operations/createvariationnobg.js +112 -0
- package/dist/sdk/models/operations/createvariationupscale.d.ts +4 -0
- package/dist/sdk/models/operations/createvariationupscale.js +5 -0
- package/dist/sdk/models/operations/getelements.d.ts +68 -0
- package/dist/sdk/models/operations/getelements.js +153 -0
- package/dist/sdk/models/operations/getgenerationbyid.d.ts +70 -1
- package/dist/sdk/models/operations/getgenerationbyid.js +112 -1
- package/dist/sdk/models/operations/getgenerationsbyuserid.d.ts +70 -1
- package/dist/sdk/models/operations/getgenerationsbyuserid.js +112 -1
- package/dist/sdk/models/operations/getuserself.d.ts +5 -1
- package/dist/sdk/models/operations/getuserself.js +23 -3
- package/dist/sdk/models/operations/index.d.ts +2 -0
- package/dist/sdk/models/operations/index.js +2 -0
- package/dist/sdk/models/operations/postgenerationstexture.d.ts +4 -0
- package/dist/sdk/models/operations/postgenerationstexture.js +5 -0
- package/dist/sdk/models/operations/postvariationsunzoom.d.ts +4 -0
- package/dist/sdk/models/operations/postvariationsunzoom.js +5 -0
- package/dist/sdk/models/shared/elementinput.d.ts +11 -0
- package/dist/sdk/models/shared/elementinput.js +50 -0
- package/dist/sdk/models/shared/index.d.ts +1 -0
- package/dist/sdk/models/shared/index.js +1 -0
- package/dist/sdk/models/shared/sdgenerationschedulers.d.ts +2 -1
- package/dist/sdk/models/shared/sdgenerationschedulers.js +1 -0
- package/dist/sdk/models/shared/sdgenerationstyle.d.ts +15 -2
- package/dist/sdk/models/shared/sdgenerationstyle.js +14 -1
- package/dist/sdk/sdk.d.ts +2 -0
- package/dist/sdk/sdk.js +5 -3
- package/dist/sdk/user.d.ts +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/variation.d.ts +7 -0
- package/dist/sdk/variation.js +73 -0
- package/docs/models/operations/creategeneration200applicationjsonsdgenerationoutput.md +4 -3
- package/docs/models/operations/creategenerationrequestbody.md +39 -36
- package/docs/models/operations/createmodel200applicationjsonsdtrainingoutput.md +4 -3
- package/docs/models/operations/createvariationnobg200applicationjson.md +10 -0
- package/docs/models/operations/createvariationnobg200applicationjsonsdupscalejoboutput.md +9 -0
- package/docs/models/operations/createvariationnobgrequestbody.md +11 -0
- package/docs/models/operations/createvariationnobgresponse.md +11 -0
- package/docs/models/operations/createvariationupscale200applicationjsonsdupscalejoboutput.md +4 -3
- package/docs/models/operations/getelements200applicationjson.md +10 -0
- package/docs/models/operations/getelements200applicationjsonloras.md +18 -0
- package/docs/models/operations/getelementsresponse.md +11 -0
- package/docs/models/operations/getgenerationbyid200applicationjsongenerations.md +25 -19
- package/docs/models/operations/getgenerationbyid200applicationjsongenerationsgenerationelements.md +12 -0
- package/docs/models/operations/getgenerationbyid200applicationjsongenerationsgenerationelementsloras.md +17 -0
- package/docs/models/operations/getgenerationsbyuserid200applicationjsongenerations.md +25 -19
- package/docs/models/operations/getgenerationsbyuserid200applicationjsongenerationsgenerationelements.md +12 -0
- package/docs/models/operations/getgenerationsbyuserid200applicationjsongenerationsgenerationelementselements.md +17 -0
- package/docs/models/operations/getuserself200applicationjsonuserdetails.md +5 -1
- package/docs/models/operations/postgenerationstexture200applicationjsontexturegenerationjoboutput.md +4 -3
- package/docs/models/operations/postvariationsunzoom200applicationjsonsdunzoomoutput.md +4 -3
- package/docs/models/shared/elementinput.md +9 -0
- package/docs/models/shared/sdgenerationschedulers.md +2 -1
- package/docs/models/shared/sdgenerationstyle.md +18 -5
- package/docs/sdks/dataset/README.md +11 -21
- package/docs/sdks/element/README.md +40 -0
- package/docs/sdks/generation/README.md +16 -25
- package/docs/sdks/initimage/README.md +5 -11
- package/docs/sdks/model/README.md +12 -24
- package/docs/sdks/user/README.md +2 -4
- package/docs/sdks/variation/README.md +42 -10
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -33,19 +33,20 @@ To get access to the API and fetch an API key, please sign up for [access](https
|
|
|
33
33
|
```typescript
|
|
34
34
|
import { Leonardo } from "@leonardo-ai/sdk";
|
|
35
35
|
|
|
36
|
-
(async() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
(async () => {
|
|
37
|
+
const sdk = new Leonardo({
|
|
38
|
+
bearerAuth: "",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const res = await sdk.dataset.createDataset({
|
|
42
|
+
name: "string",
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (res.statusCode == 200) {
|
|
46
|
+
// handle response
|
|
47
|
+
}
|
|
48
48
|
})();
|
|
49
|
+
|
|
49
50
|
```
|
|
50
51
|
<!-- End SDK Example Usage -->
|
|
51
52
|
|
|
@@ -61,6 +62,10 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
61
62
|
* [uploadDatasetImage](docs/sdks/dataset/README.md#uploaddatasetimage) - Upload dataset image
|
|
62
63
|
* [uploadDatasetImageFromGen](docs/sdks/dataset/README.md#uploaddatasetimagefromgen) - Upload a Single Generated Image to a Dataset
|
|
63
64
|
|
|
65
|
+
### [element](docs/sdks/element/README.md)
|
|
66
|
+
|
|
67
|
+
* [getElements](docs/sdks/element/README.md#getelements) - List Elements
|
|
68
|
+
|
|
64
69
|
### [generation](docs/sdks/generation/README.md)
|
|
65
70
|
|
|
66
71
|
* [createGeneration](docs/sdks/generation/README.md#creategeneration) - Create a Generation of Images
|
|
@@ -91,6 +96,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
91
96
|
|
|
92
97
|
### [variation](docs/sdks/variation/README.md)
|
|
93
98
|
|
|
99
|
+
* [createVariationNoBG](docs/sdks/variation/README.md#createvariationnobg) - Create no background
|
|
94
100
|
* [createVariationUpscale](docs/sdks/variation/README.md#createvariationupscale) - Create upscale
|
|
95
101
|
* [getVariationById](docs/sdks/variation/README.md#getvariationbyid) - Get variation by ID
|
|
96
102
|
* [postVariationsUnzoom](docs/sdks/variation/README.md#postvariationsunzoom) - Create unzoom
|
|
@@ -122,6 +128,41 @@ return value of `next` is `null`, then there are no more pages to be fetched.
|
|
|
122
128
|
Here's an example of one such pagination call:
|
|
123
129
|
<!-- End Pagination -->
|
|
124
130
|
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
<!-- Start Error Handling -->
|
|
134
|
+
# Error Handling
|
|
135
|
+
|
|
136
|
+
Handling errors in your SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
<!-- End Error Handling -->
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<!-- Start Custom HTTP Client -->
|
|
144
|
+
# Custom HTTP Client
|
|
145
|
+
|
|
146
|
+
The Typescript SDK makes API calls using the (axios)[https://axios-http.com/docs/intro] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
For example, you could specify a header for every request that your sdk makes as follows:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
from @leonardo-ai/sdk import Leonardo;
|
|
153
|
+
import axios;
|
|
154
|
+
|
|
155
|
+
const httpClient = axios.create({
|
|
156
|
+
headers: {'x-custom-header': 'someValue'}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
const sdk = new Leonardo({defaultClient: httpClient});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<!-- End Custom HTTP Client -->
|
|
165
|
+
|
|
125
166
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
126
167
|
|
|
127
168
|
|
|
@@ -104,7 +104,8 @@ function noExplodeSerializer(params, delimiter) {
|
|
|
104
104
|
var qpDecorator = (0, utils_1.parseParamDecorator)(qpAnn, paramKey, "form", true);
|
|
105
105
|
if (qpDecorator == null)
|
|
106
106
|
return;
|
|
107
|
-
|
|
107
|
+
var key = qpDecorator.ParamName || paramKey;
|
|
108
|
+
return "".concat(key).concat(delimiter).concat((0, utils_1.valToString)(value[paramKey]));
|
|
108
109
|
})
|
|
109
110
|
.join(delimiter);
|
|
110
111
|
query.push("".concat(key, "=").concat(encodeURIComponent(values)));
|
|
@@ -133,7 +134,8 @@ function formSerializerExplode(params) {
|
|
|
133
134
|
var qpDecorator = (0, utils_1.parseParamDecorator)(qpAnn, paramKey, "form", true);
|
|
134
135
|
if (qpDecorator == null)
|
|
135
136
|
return;
|
|
136
|
-
|
|
137
|
+
var key = qpDecorator.ParamName || paramKey;
|
|
138
|
+
return "".concat(key, "=").concat(encodeURIComponent((0, utils_1.valToString)(value[paramKey])));
|
|
137
139
|
})
|
|
138
140
|
.join("&"));
|
|
139
141
|
});
|
|
@@ -138,7 +138,7 @@ function parseSecuritySchemeValue(properties, schemeDecorator, securityDecorator
|
|
|
138
138
|
properties.headers[securityDecorator.Name] = value;
|
|
139
139
|
break;
|
|
140
140
|
case "oauth2":
|
|
141
|
-
properties.headers[securityDecorator.Name] = value;
|
|
141
|
+
properties.headers[securityDecorator.Name] = value.toLowerCase().startsWith("bearer ") ? value : "Bearer ".concat(value);
|
|
142
142
|
break;
|
|
143
143
|
case "http":
|
|
144
144
|
switch (schemeDecorator.SubType) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as operations from "./models/operations";
|
|
2
|
+
import { SDKConfiguration } from "./sdk";
|
|
3
|
+
import { AxiosRequestConfig } from "axios";
|
|
4
|
+
export declare class Element {
|
|
5
|
+
private sdkConfiguration;
|
|
6
|
+
constructor(sdkConfig: SDKConfiguration);
|
|
7
|
+
/**
|
|
8
|
+
* List Elements
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Get a list of public Elements available for use with generations.
|
|
12
|
+
*/
|
|
13
|
+
getElements(config?: AxiosRequestConfig): Promise<operations.GetElementsResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(o, k2, desc);
|
|
23
|
+
}) : (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
o[k2] = m[k];
|
|
26
|
+
}));
|
|
27
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
+
}) : function(o, v) {
|
|
30
|
+
o["default"] = v;
|
|
31
|
+
});
|
|
32
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
40
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
41
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
42
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
43
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
44
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
45
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
49
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
50
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
51
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
52
|
+
function step(op) {
|
|
53
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
54
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
55
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
56
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
57
|
+
switch (op[0]) {
|
|
58
|
+
case 0: case 1: t = op; break;
|
|
59
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
60
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
61
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
62
|
+
default:
|
|
63
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
64
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
65
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
66
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
67
|
+
if (t[2]) _.ops.pop();
|
|
68
|
+
_.trys.pop(); continue;
|
|
69
|
+
}
|
|
70
|
+
op = body.call(thisArg, _);
|
|
71
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
72
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
+
exports.Element = void 0;
|
|
77
|
+
var utils = __importStar(require("../internal/utils"));
|
|
78
|
+
var errors = __importStar(require("./models/errors"));
|
|
79
|
+
var operations = __importStar(require("./models/operations"));
|
|
80
|
+
var shared = __importStar(require("./models/shared"));
|
|
81
|
+
var Element = /** @class */ (function () {
|
|
82
|
+
function Element(sdkConfig) {
|
|
83
|
+
this.sdkConfiguration = sdkConfig;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* List Elements
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* Get a list of public Elements available for use with generations.
|
|
90
|
+
*/
|
|
91
|
+
Element.prototype.getElements = function (config) {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
+
var baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
95
|
+
return __generator(this, function (_c) {
|
|
96
|
+
switch (_c.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
99
|
+
url = baseURL.replace(/\/$/, "") + "/elements";
|
|
100
|
+
client = this.sdkConfiguration.defaultClient;
|
|
101
|
+
globalSecurity = this.sdkConfiguration.security;
|
|
102
|
+
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
103
|
+
return [4 /*yield*/, globalSecurity()];
|
|
104
|
+
case 1:
|
|
105
|
+
globalSecurity = _c.sent();
|
|
106
|
+
_c.label = 2;
|
|
107
|
+
case 2:
|
|
108
|
+
if (!(globalSecurity instanceof utils.SpeakeasyBase)) {
|
|
109
|
+
globalSecurity = new shared.Security(globalSecurity);
|
|
110
|
+
}
|
|
111
|
+
properties = utils.parseSecurityProperties(globalSecurity);
|
|
112
|
+
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
113
|
+
headers["Accept"] = "application/json";
|
|
114
|
+
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
115
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
116
|
+
case 3:
|
|
117
|
+
httpRes = _c.sent();
|
|
118
|
+
contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
119
|
+
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
120
|
+
throw new Error("status code not found in response: ".concat(httpRes));
|
|
121
|
+
}
|
|
122
|
+
res = new operations.GetElementsResponse({
|
|
123
|
+
statusCode: httpRes.status,
|
|
124
|
+
contentType: contentType,
|
|
125
|
+
rawResponse: httpRes,
|
|
126
|
+
});
|
|
127
|
+
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
128
|
+
switch (true) {
|
|
129
|
+
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
130
|
+
if (utils.matchContentType(contentType, "application/json")) {
|
|
131
|
+
res.getElements200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetElements200ApplicationJSON);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
return [2 /*return*/, res];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
return Element;
|
|
144
|
+
}());
|
|
145
|
+
exports.Element = Element;
|
|
@@ -21,6 +21,7 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
21
21
|
* The type of ControlNet to use.
|
|
22
22
|
*/
|
|
23
23
|
controlNetType?: shared.ControlnetType;
|
|
24
|
+
elements?: shared.ElementInput[];
|
|
24
25
|
/**
|
|
25
26
|
* Enable to use the Expanded Domain feature of Alchemy.
|
|
26
27
|
*/
|
|
@@ -34,7 +35,7 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
34
35
|
*/
|
|
35
36
|
height?: number;
|
|
36
37
|
/**
|
|
37
|
-
* Enable to use the High Contrast feature of Prompt Magic.
|
|
38
|
+
* Enable to use the High Contrast feature of Prompt Magic. Note: Controls RAW mode. Set to false to enable RAW mode.
|
|
38
39
|
*/
|
|
39
40
|
highContrast?: boolean;
|
|
40
41
|
/**
|
|
@@ -56,13 +57,7 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
56
57
|
*/
|
|
57
58
|
initStrength?: number;
|
|
58
59
|
/**
|
|
59
|
-
* The model ID used for
|
|
60
|
-
*
|
|
61
|
-
* @remarks
|
|
62
|
-
*
|
|
63
|
-
* _Leonardo Creative_: 6bef9f1b-29cb-40c7-b9df-32b51c1f67d3
|
|
64
|
-
* _Leonardo Select_: cd2b2a15-9760-4174-a5ff-4d2925057376
|
|
65
|
-
* _Leonardo Signature_: 291be633-cb24-434f-898f-e662799936ad
|
|
60
|
+
* The model ID used for image generation. If not provided, uses sd_version to determine the version of Stable Diffusion to use. In-app, model IDs are under the Finetune Models menu. Click on the platform model or your custom model, then click View More. For platform models, you can also use the List Platform Models API.
|
|
66
61
|
*/
|
|
67
62
|
modelId?: string;
|
|
68
63
|
/**
|
|
@@ -82,11 +77,15 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
82
77
|
*/
|
|
83
78
|
numInferenceSteps?: number;
|
|
84
79
|
/**
|
|
85
|
-
* Enable the photoReal feature
|
|
80
|
+
* Enable the photoReal feature. Requires enabling alchemy and unspecifying modelId.
|
|
86
81
|
*/
|
|
87
82
|
photoReal?: boolean;
|
|
88
83
|
/**
|
|
89
|
-
*
|
|
84
|
+
* Depth of field of photoReal. Must be 0.55 for low, 0.5 for medium, or 0.45 for high.
|
|
85
|
+
*/
|
|
86
|
+
photoRealStrength?: number;
|
|
87
|
+
/**
|
|
88
|
+
* The style to generate images with. When photoReal is enabled, use CINEMATIC, CREATIVE, VIBRANT, or NONE. When alchemy is disabled, use LEONARDO or NONE. When alchemy is enabled, use ANIME, CREATIVE, DYNAMIC, ENVIRONMENT, GENERAL, ILLUSTRATION, PHOTOGRAPHY, RAYTRACED, RENDER_3D, SKETCH_BW, SKETCH_COLOR, or NONE.
|
|
90
89
|
*/
|
|
91
90
|
presetStyle?: shared.SdGenerationStyle;
|
|
92
91
|
/**
|
|
@@ -97,6 +96,10 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
97
96
|
* Enable to use Prompt Magic.
|
|
98
97
|
*/
|
|
99
98
|
promptMagic?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Strength of prompt magic. Must be a float between 0.1 and 1.0
|
|
101
|
+
*/
|
|
102
|
+
promptMagicStrength?: number;
|
|
100
103
|
/**
|
|
101
104
|
* Prompt magic version v2 or v3, for use when promptMagic: true
|
|
102
105
|
*/
|
|
@@ -119,11 +122,11 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
119
122
|
*/
|
|
120
123
|
tiling?: boolean;
|
|
121
124
|
/**
|
|
122
|
-
* Whether the generated images should be unzoomed.
|
|
125
|
+
* Whether the generated images should be unzoomed (requires unzoomAmount and init_image_id to be set).
|
|
123
126
|
*/
|
|
124
127
|
unzoom?: boolean;
|
|
125
128
|
/**
|
|
126
|
-
* How much the image should be unzoomed.
|
|
129
|
+
* How much the image should be unzoomed (requires an init_image_id and unzoom to be set to true).
|
|
127
130
|
*/
|
|
128
131
|
unzoomAmount?: number;
|
|
129
132
|
/**
|
|
@@ -140,6 +143,10 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
|
|
|
140
143
|
width?: number;
|
|
141
144
|
}
|
|
142
145
|
export declare class CreateGeneration200ApplicationJSONSDGenerationOutput extends SpeakeasyBase {
|
|
146
|
+
/**
|
|
147
|
+
* API Credits Cost for Image Generation. Available for Production API Users.
|
|
148
|
+
*/
|
|
149
|
+
apiCreditCost?: number;
|
|
143
150
|
generationId?: string;
|
|
144
151
|
}
|
|
145
152
|
/**
|
|
@@ -82,6 +82,12 @@ var CreateGenerationRequestBody = /** @class */ (function (_super) {
|
|
|
82
82
|
(0, class_transformer_1.Expose)({ name: "controlNetType" }),
|
|
83
83
|
__metadata("design:type", String)
|
|
84
84
|
], CreateGenerationRequestBody.prototype, "controlNetType", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, utils_1.SpeakeasyMetadata)({ elemType: shared.ElementInput }),
|
|
87
|
+
(0, class_transformer_1.Expose)({ name: "elements" }),
|
|
88
|
+
(0, class_transformer_1.Type)(function () { return shared.ElementInput; }),
|
|
89
|
+
__metadata("design:type", Array)
|
|
90
|
+
], CreateGenerationRequestBody.prototype, "elements", void 0);
|
|
85
91
|
__decorate([
|
|
86
92
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
87
93
|
(0, class_transformer_1.Expose)({ name: "expandedDomain" }),
|
|
@@ -162,6 +168,11 @@ var CreateGenerationRequestBody = /** @class */ (function (_super) {
|
|
|
162
168
|
(0, class_transformer_1.Expose)({ name: "photoReal" }),
|
|
163
169
|
__metadata("design:type", Boolean)
|
|
164
170
|
], CreateGenerationRequestBody.prototype, "photoReal", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
173
|
+
(0, class_transformer_1.Expose)({ name: "photoRealStrength" }),
|
|
174
|
+
__metadata("design:type", Number)
|
|
175
|
+
], CreateGenerationRequestBody.prototype, "photoRealStrength", void 0);
|
|
165
176
|
__decorate([
|
|
166
177
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
167
178
|
(0, class_transformer_1.Expose)({ name: "presetStyle" }),
|
|
@@ -177,6 +188,11 @@ var CreateGenerationRequestBody = /** @class */ (function (_super) {
|
|
|
177
188
|
(0, class_transformer_1.Expose)({ name: "promptMagic" }),
|
|
178
189
|
__metadata("design:type", Boolean)
|
|
179
190
|
], CreateGenerationRequestBody.prototype, "promptMagic", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
193
|
+
(0, class_transformer_1.Expose)({ name: "promptMagicStrength" }),
|
|
194
|
+
__metadata("design:type", Number)
|
|
195
|
+
], CreateGenerationRequestBody.prototype, "promptMagicStrength", void 0);
|
|
180
196
|
__decorate([
|
|
181
197
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
182
198
|
(0, class_transformer_1.Expose)({ name: "promptMagicVersion" }),
|
|
@@ -240,6 +256,11 @@ var CreateGeneration200ApplicationJSONSDGenerationOutput = /** @class */ (functi
|
|
|
240
256
|
function CreateGeneration200ApplicationJSONSDGenerationOutput() {
|
|
241
257
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
242
258
|
}
|
|
259
|
+
__decorate([
|
|
260
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
261
|
+
(0, class_transformer_1.Expose)({ name: "apiCreditCost" }),
|
|
262
|
+
__metadata("design:type", Number)
|
|
263
|
+
], CreateGeneration200ApplicationJSONSDGenerationOutput.prototype, "apiCreditCost", void 0);
|
|
243
264
|
__decorate([
|
|
244
265
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
245
266
|
(0, class_transformer_1.Expose)({ name: "generationId" }),
|
|
@@ -43,6 +43,10 @@ export declare class CreateModelRequestBody extends SpeakeasyBase {
|
|
|
43
43
|
strength?: shared.Strength;
|
|
44
44
|
}
|
|
45
45
|
export declare class CreateModel200ApplicationJSONSDTrainingOutput extends SpeakeasyBase {
|
|
46
|
+
/**
|
|
47
|
+
* API Credits Cost for Model Training. Available for Production API Users.
|
|
48
|
+
*/
|
|
49
|
+
apiCreditCost?: number;
|
|
46
50
|
customModelId?: string;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
@@ -115,6 +115,11 @@ var CreateModel200ApplicationJSONSDTrainingOutput = /** @class */ (function (_su
|
|
|
115
115
|
function CreateModel200ApplicationJSONSDTrainingOutput() {
|
|
116
116
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
117
117
|
}
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
120
|
+
(0, class_transformer_1.Expose)({ name: "apiCreditCost" }),
|
|
121
|
+
__metadata("design:type", Number)
|
|
122
|
+
], CreateModel200ApplicationJSONSDTrainingOutput.prototype, "apiCreditCost", void 0);
|
|
118
123
|
__decorate([
|
|
119
124
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
120
125
|
(0, class_transformer_1.Expose)({ name: "customModelId" }),
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SpeakeasyBase } from "../../../internal/utils";
|
|
2
|
+
import { AxiosResponse } from "axios";
|
|
3
|
+
/**
|
|
4
|
+
* Query parameters are provided in the request body as a JSON object
|
|
5
|
+
*/
|
|
6
|
+
export declare class CreateVariationNoBGRequestBody extends SpeakeasyBase {
|
|
7
|
+
id: string;
|
|
8
|
+
isVariation?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput extends SpeakeasyBase {
|
|
11
|
+
/**
|
|
12
|
+
* API Credits Cost for No Background Variation. Available for Production API Users.
|
|
13
|
+
*/
|
|
14
|
+
apiCreditCost?: number;
|
|
15
|
+
id?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Responses for POST /variations/nobg
|
|
19
|
+
*/
|
|
20
|
+
export declare class CreateVariationNoBg200ApplicationJSON extends SpeakeasyBase {
|
|
21
|
+
sdNobgJob?: CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput;
|
|
22
|
+
}
|
|
23
|
+
export declare class CreateVariationNoBGResponse extends SpeakeasyBase {
|
|
24
|
+
/**
|
|
25
|
+
* HTTP response content type for this operation
|
|
26
|
+
*/
|
|
27
|
+
contentType: string;
|
|
28
|
+
/**
|
|
29
|
+
* HTTP response status code for this operation
|
|
30
|
+
*/
|
|
31
|
+
statusCode: number;
|
|
32
|
+
/**
|
|
33
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
34
|
+
*/
|
|
35
|
+
rawResponse?: AxiosResponse;
|
|
36
|
+
/**
|
|
37
|
+
* Responses for POST /variations/nobg
|
|
38
|
+
*/
|
|
39
|
+
createVariationNoBG200ApplicationJSONObject?: CreateVariationNoBg200ApplicationJSON;
|
|
40
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __extends = (this && this.__extends) || (function () {
|
|
6
|
+
var extendStatics = function (d, b) {
|
|
7
|
+
extendStatics = Object.setPrototypeOf ||
|
|
8
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
+
return extendStatics(d, b);
|
|
11
|
+
};
|
|
12
|
+
return function (d, b) {
|
|
13
|
+
if (typeof b !== "function" && b !== null)
|
|
14
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
+
extendStatics(d, b);
|
|
16
|
+
function __() { this.constructor = d; }
|
|
17
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
21
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
22
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
23
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
24
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
25
|
+
};
|
|
26
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
27
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.CreateVariationNoBGResponse = exports.CreateVariationNoBg200ApplicationJSON = exports.CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput = exports.CreateVariationNoBGRequestBody = void 0;
|
|
31
|
+
var utils_1 = require("../../../internal/utils");
|
|
32
|
+
var class_transformer_1 = require("class-transformer");
|
|
33
|
+
/**
|
|
34
|
+
* Query parameters are provided in the request body as a JSON object
|
|
35
|
+
*/
|
|
36
|
+
var CreateVariationNoBGRequestBody = /** @class */ (function (_super) {
|
|
37
|
+
__extends(CreateVariationNoBGRequestBody, _super);
|
|
38
|
+
function CreateVariationNoBGRequestBody() {
|
|
39
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
+
}
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
43
|
+
(0, class_transformer_1.Expose)({ name: "id" }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CreateVariationNoBGRequestBody.prototype, "id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
48
|
+
(0, class_transformer_1.Expose)({ name: "isVariation" }),
|
|
49
|
+
__metadata("design:type", Boolean)
|
|
50
|
+
], CreateVariationNoBGRequestBody.prototype, "isVariation", void 0);
|
|
51
|
+
return CreateVariationNoBGRequestBody;
|
|
52
|
+
}(utils_1.SpeakeasyBase));
|
|
53
|
+
exports.CreateVariationNoBGRequestBody = CreateVariationNoBGRequestBody;
|
|
54
|
+
var CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput = /** @class */ (function (_super) {
|
|
55
|
+
__extends(CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput, _super);
|
|
56
|
+
function CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput() {
|
|
57
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
58
|
+
}
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
61
|
+
(0, class_transformer_1.Expose)({ name: "apiCreditCost" }),
|
|
62
|
+
__metadata("design:type", Number)
|
|
63
|
+
], CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput.prototype, "apiCreditCost", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
66
|
+
(0, class_transformer_1.Expose)({ name: "id" }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput.prototype, "id", void 0);
|
|
69
|
+
return CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput;
|
|
70
|
+
}(utils_1.SpeakeasyBase));
|
|
71
|
+
exports.CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput = CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput;
|
|
72
|
+
/**
|
|
73
|
+
* Responses for POST /variations/nobg
|
|
74
|
+
*/
|
|
75
|
+
var CreateVariationNoBg200ApplicationJSON = /** @class */ (function (_super) {
|
|
76
|
+
__extends(CreateVariationNoBg200ApplicationJSON, _super);
|
|
77
|
+
function CreateVariationNoBg200ApplicationJSON() {
|
|
78
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
79
|
+
}
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
82
|
+
(0, class_transformer_1.Expose)({ name: "sdNobgJob" }),
|
|
83
|
+
(0, class_transformer_1.Type)(function () { return CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput; }),
|
|
84
|
+
__metadata("design:type", CreateVariationNoBg200ApplicationJSONSDUpscaleJobOutput)
|
|
85
|
+
], CreateVariationNoBg200ApplicationJSON.prototype, "sdNobgJob", void 0);
|
|
86
|
+
return CreateVariationNoBg200ApplicationJSON;
|
|
87
|
+
}(utils_1.SpeakeasyBase));
|
|
88
|
+
exports.CreateVariationNoBg200ApplicationJSON = CreateVariationNoBg200ApplicationJSON;
|
|
89
|
+
var CreateVariationNoBGResponse = /** @class */ (function (_super) {
|
|
90
|
+
__extends(CreateVariationNoBGResponse, _super);
|
|
91
|
+
function CreateVariationNoBGResponse() {
|
|
92
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
93
|
+
}
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], CreateVariationNoBGResponse.prototype, "contentType", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
100
|
+
__metadata("design:type", Number)
|
|
101
|
+
], CreateVariationNoBGResponse.prototype, "statusCode", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
104
|
+
__metadata("design:type", Object)
|
|
105
|
+
], CreateVariationNoBGResponse.prototype, "rawResponse", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
108
|
+
__metadata("design:type", CreateVariationNoBg200ApplicationJSON)
|
|
109
|
+
], CreateVariationNoBGResponse.prototype, "createVariationNoBG200ApplicationJSONObject", void 0);
|
|
110
|
+
return CreateVariationNoBGResponse;
|
|
111
|
+
}(utils_1.SpeakeasyBase));
|
|
112
|
+
exports.CreateVariationNoBGResponse = CreateVariationNoBGResponse;
|
|
@@ -7,6 +7,10 @@ export declare class CreateVariationUpscaleRequestBody extends SpeakeasyBase {
|
|
|
7
7
|
id: string;
|
|
8
8
|
}
|
|
9
9
|
export declare class CreateVariationUpscale200ApplicationJSONSDUpscaleJobOutput extends SpeakeasyBase {
|
|
10
|
+
/**
|
|
11
|
+
* API Credits Cost for Upscale Variation. Available for Production API Users.
|
|
12
|
+
*/
|
|
13
|
+
apiCreditCost?: number;
|
|
10
14
|
id?: string;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
@@ -51,6 +51,11 @@ var CreateVariationUpscale200ApplicationJSONSDUpscaleJobOutput = /** @class */ (
|
|
|
51
51
|
function CreateVariationUpscale200ApplicationJSONSDUpscaleJobOutput() {
|
|
52
52
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
53
53
|
}
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
56
|
+
(0, class_transformer_1.Expose)({ name: "apiCreditCost" }),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], CreateVariationUpscale200ApplicationJSONSDUpscaleJobOutput.prototype, "apiCreditCost", void 0);
|
|
54
59
|
__decorate([
|
|
55
60
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
56
61
|
(0, class_transformer_1.Expose)({ name: "id" }),
|