@leonardo-ai/sdk 1.64.2 → 1.64.3

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 CHANGED
@@ -134,8 +134,6 @@ Here's an example of one such pagination call:
134
134
  # Error Handling
135
135
 
136
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
137
  <!-- End Error Handling -->
140
138
 
141
139
 
@@ -159,9 +157,70 @@ const httpClient = axios.create({
159
157
 
160
158
  const sdk = new Leonardo({defaultClient: httpClient});
161
159
  ```
160
+ <!-- End Custom HTTP Client -->
162
161
 
163
162
 
164
- <!-- End Custom HTTP Client -->
163
+
164
+ <!-- Start Server Selection -->
165
+ # Server Selection
166
+
167
+ ## Select Server by Index
168
+
169
+ You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
170
+
171
+ | # | Server | Variables |
172
+ | - | ------ | --------- |
173
+ | 0 | `https://cloud.leonardo.ai/api/rest/v1` | None |
174
+
175
+ For example:
176
+
177
+
178
+ ```typescript
179
+ import { Leonardo } from "@leonardo-ai/sdk";
180
+
181
+ (async () => {
182
+ const sdk = new Leonardo({
183
+ bearerAuth: "",
184
+ serverIdx: 0,
185
+ });
186
+
187
+ const res = await sdk.dataset.createDataset({
188
+ name: "string",
189
+ });
190
+
191
+ if (res.statusCode == 200) {
192
+ // handle response
193
+ }
194
+ })();
195
+
196
+ ```
197
+
198
+
199
+ ## Override Server URL Per-Client
200
+
201
+ The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
202
+
203
+
204
+ ```typescript
205
+ import { Leonardo } from "@leonardo-ai/sdk";
206
+
207
+ (async () => {
208
+ const sdk = new Leonardo({
209
+ bearerAuth: "",
210
+ serverURL: "https://cloud.leonardo.ai/api/rest/v1",
211
+ });
212
+
213
+ const res = await sdk.dataset.createDataset({
214
+ name: "string",
215
+ });
216
+
217
+ if (res.statusCode == 200) {
218
+ // handle response
219
+ }
220
+ })();
221
+
222
+ ```
223
+ <!-- End Server Selection -->
165
224
 
166
225
  <!-- Placeholder for Future Speakeasy SDK Sections -->
167
226
 
@@ -31,7 +31,7 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
31
31
  */
32
32
  guidanceScale?: number;
33
33
  /**
34
- * The height of the images. Must be between 32 and 1024 and be a multiple of 8.
34
+ * The input height of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features.
35
35
  */
36
36
  height?: number;
37
37
  /**
@@ -81,7 +81,7 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
81
81
  */
82
82
  photoReal?: boolean;
83
83
  /**
84
- * Depth of field of photoReal. Must be 0.55 for low, 0.5 for medium, or 0.45 for high.
84
+ * Depth of field of photoReal. Must be 0.55 for low, 0.5 for medium, or 0.45 for high. Defaults to 0.55 if not specified.
85
85
  */
86
86
  photoRealStrength?: number;
87
87
  /**
@@ -138,7 +138,7 @@ export declare class CreateGenerationRequestBody extends SpeakeasyBase {
138
138
  */
139
139
  weighting?: number;
140
140
  /**
141
- * The width of the images. Must be between 32 and 1024 and be a multiple of 8.
141
+ * The input width of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features.
142
142
  */
143
143
  width?: number;
144
144
  }
@@ -100,7 +100,7 @@ export declare class GetGenerationById200ApplicationJSONGenerations extends Spea
100
100
  */
101
101
  photoReal?: boolean;
102
102
  /**
103
- * Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high.
103
+ * Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high. Default is 0.55.
104
104
  */
105
105
  photoRealStrength?: number;
106
106
  /**
@@ -99,7 +99,7 @@ export declare class GetGenerationsByUserId200ApplicationJSONGenerations extends
99
99
  */
100
100
  photoReal?: boolean;
101
101
  /**
102
- * Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high.
102
+ * Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high. Default is 0.55.
103
103
  */
104
104
  photoRealStrength?: number;
105
105
  /**
package/dist/sdk/sdk.js CHANGED
@@ -52,9 +52,9 @@ var SDKConfiguration = /** @class */ (function () {
52
52
  function SDKConfiguration(init) {
53
53
  this.language = "typescript";
54
54
  this.openapiDocVersion = "v1.0.0";
55
- this.sdkVersion = "1.64.2";
56
- this.genVersion = "2.172.0";
57
- this.userAgent = "speakeasy-sdk/typescript 1.64.2 2.172.0 v1.0.0 @leonardo-ai/sdk";
55
+ this.sdkVersion = "1.64.3";
56
+ this.genVersion = "2.172.4";
57
+ this.userAgent = "speakeasy-sdk/typescript 1.64.3 2.172.4 v1.0.0 @leonardo-ai/sdk";
58
58
  Object.assign(this, init);
59
59
  }
60
60
  return SDKConfiguration;
@@ -14,7 +14,7 @@ Query parameters to be provided in the request body as a JSON object
14
14
  | `elements` | [shared.ElementInput](../../models/shared/elementinput.md)[] | :heavy_minus_sign: | N/A |
15
15
  | `expandedDomain` | *boolean* | :heavy_minus_sign: | Enable to use the Expanded Domain feature of Alchemy. |
16
16
  | `guidanceScale` | *number* | :heavy_minus_sign: | How strongly the generation should reflect the prompt. 7 is recommended. Must be between 1 and 20. |
17
- | `height` | *number* | :heavy_minus_sign: | The height of the images. Must be between 32 and 1024 and be a multiple of 8. |
17
+ | `height` | *number* | :heavy_minus_sign: | The input height of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features. |
18
18
  | `highContrast` | *boolean* | :heavy_minus_sign: | Enable to use the High Contrast feature of Prompt Magic. Note: Controls RAW mode. Set to false to enable RAW mode. |
19
19
  | `highResolution` | *boolean* | :heavy_minus_sign: | Enable to use the High Resolution feature of Prompt Magic. |
20
20
  | `imagePromptWeight` | *number* | :heavy_minus_sign: | N/A |
@@ -28,7 +28,7 @@ Query parameters to be provided in the request body as a JSON object
28
28
  | `numImages` | *number* | :heavy_minus_sign: | The number of images to generate. Must be between 1 and 8. If either width or height is over 768, must be between 1 and 4. |
29
29
  | `numInferenceSteps` | *number* | :heavy_minus_sign: | The number of inference steps to use for the generation. Must be between 30 and 60. |
30
30
  | `photoReal` | *boolean* | :heavy_minus_sign: | Enable the photoReal feature. Requires enabling alchemy and unspecifying modelId. |
31
- | `photoRealStrength` | *number* | :heavy_minus_sign: | Depth of field of photoReal. Must be 0.55 for low, 0.5 for medium, or 0.45 for high. |
31
+ | `photoRealStrength` | *number* | :heavy_minus_sign: | Depth of field of photoReal. Must be 0.55 for low, 0.5 for medium, or 0.45 for high. Defaults to 0.55 if not specified. |
32
32
  | `presetStyle` | [shared.SdGenerationStyle](../../models/shared/sdgenerationstyle.md) | :heavy_minus_sign: | 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. |
33
33
  | `prompt` | *string* | :heavy_minus_sign: | The prompt used to generate images |
34
34
  | `promptMagic` | *boolean* | :heavy_minus_sign: | Enable to use Prompt Magic. |
@@ -43,4 +43,4 @@ Query parameters to be provided in the request body as a JSON object
43
43
  | `unzoomAmount` | *number* | :heavy_minus_sign: | How much the image should be unzoomed (requires an init_image_id and unzoom to be set to true). |
44
44
  | `upscaleRatio` | *number* | :heavy_minus_sign: | How much the image should be upscaled. (Enterprise Only) |
45
45
  | `weighting` | *number* | :heavy_minus_sign: | How much weighting to use for generation. |
46
- | `width` | *number* | :heavy_minus_sign: | The width of the images. Must be between 32 and 1024 and be a multiple of 8. |
46
+ | `width` | *number* | :heavy_minus_sign: | The input width of the images. Must be between 32 and 1024 and be a multiple of 8. Note: Input resolution is not always the same as output resolution due to upscaling from other features. |
@@ -19,7 +19,7 @@ columns and relationships of "generations"
19
19
  | `modelId` | *string* | :heavy_minus_sign: | N/A |
20
20
  | `negativePrompt` | *string* | :heavy_minus_sign: | N/A |
21
21
  | `photoReal` | *boolean* | :heavy_minus_sign: | If photoReal feature was used. |
22
- | `photoRealStrength` | *number* | :heavy_minus_sign: | Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high. |
22
+ | `photoRealStrength` | *number* | :heavy_minus_sign: | Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high. Default is 0.55. |
23
23
  | `presetStyle` | [shared.SdGenerationStyle](../../models/shared/sdgenerationstyle.md) | :heavy_minus_sign: | 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. |
24
24
  | `prompt` | *string* | :heavy_minus_sign: | N/A |
25
25
  | `promptMagic` | *boolean* | :heavy_minus_sign: | If prompt magic was used. |
@@ -19,7 +19,7 @@ columns and relationships of "generations"
19
19
  | `modelId` | *string* | :heavy_minus_sign: | N/A |
20
20
  | `negativePrompt` | *string* | :heavy_minus_sign: | N/A |
21
21
  | `photoReal` | *boolean* | :heavy_minus_sign: | If photoReal feature was used. |
22
- | `photoRealStrength` | *number* | :heavy_minus_sign: | Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high. |
22
+ | `photoRealStrength` | *number* | :heavy_minus_sign: | Depth of field of photoReal used. 0.55 is low, 0.5 is medium, and 0.45 is high. Default is 0.55. |
23
23
  | `presetStyle` | [shared.SdGenerationStyle](../../models/shared/sdgenerationstyle.md) | :heavy_minus_sign: | 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. |
24
24
  | `prompt` | *string* | :heavy_minus_sign: | N/A |
25
25
  | `promptMagic` | *boolean* | :heavy_minus_sign: | If prompt magic was used. |
@@ -27,6 +27,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
27
27
  name: "string",
28
28
  });
29
29
 
30
+
30
31
  if (res.statusCode == 200) {
31
32
  // handle response
32
33
  }
@@ -64,6 +65,7 @@ const id: string = "string";
64
65
 
65
66
  const res = await sdk.dataset.deleteDatasetById(id);
66
67
 
68
+
67
69
  if (res.statusCode == 200) {
68
70
  // handle response
69
71
  }
@@ -101,6 +103,7 @@ const id: string = "string";
101
103
 
102
104
  const res = await sdk.dataset.getDatasetById(id);
103
105
 
106
+
104
107
  if (res.statusCode == 200) {
105
108
  // handle response
106
109
  }
@@ -141,6 +144,7 @@ const datasetId: string = "string";
141
144
 
142
145
  const res = await sdk.dataset.uploadDatasetImage(requestBody, datasetId);
143
146
 
147
+
144
148
  if (res.statusCode == 200) {
145
149
  // handle response
146
150
  }
@@ -182,6 +186,7 @@ const datasetId: string = "string";
182
186
 
183
187
  const res = await sdk.dataset.uploadDatasetImageFromGen(requestBody, datasetId);
184
188
 
189
+
185
190
  if (res.statusCode == 200) {
186
191
  // handle response
187
192
  }
@@ -21,6 +21,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
21
21
 
22
22
  const res = await sdk.element.getElements();
23
23
 
24
+
24
25
  if (res.statusCode == 200) {
25
26
  // handle response
26
27
  }
@@ -34,6 +34,7 @@ import { ControlnetType, SdGenerationSchedulers, SdGenerationStyle, SdVersions }
34
34
  ],
35
35
  });
36
36
 
37
+
37
38
  if (res.statusCode == 200) {
38
39
  // handle response
39
40
  }
@@ -71,6 +72,7 @@ const id: string = "string";
71
72
 
72
73
  const res = await sdk.generation.deleteGenerationById(id);
73
74
 
75
+
74
76
  if (res.statusCode == 200) {
75
77
  // handle response
76
78
  }
@@ -109,6 +111,7 @@ const requestBody: DeleteGenerationsTextureIdRequestBody = {};
109
111
 
110
112
  const res = await sdk.generation.deleteGenerationsTextureId(id, requestBody);
111
113
 
114
+
112
115
  if (res.statusCode == 200) {
113
116
  // handle response
114
117
  }
@@ -147,6 +150,7 @@ const id: string = "string";
147
150
 
148
151
  const res = await sdk.generation.getGenerationById(id);
149
152
 
153
+
150
154
  if (res.statusCode == 200) {
151
155
  // handle response
152
156
  }
@@ -186,6 +190,7 @@ const offset: number = 770121;
186
190
 
187
191
  const res = await sdk.generation.getGenerationsByUserId(userId, limit, offset);
188
192
 
193
+
189
194
  if (res.statusCode == 200) {
190
195
  // handle response
191
196
  }
@@ -223,6 +228,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
223
228
 
224
229
  const res = await sdk.generation.postGenerationsTexture({});
225
230
 
231
+
226
232
  if (res.statusCode == 200) {
227
233
  // handle response
228
234
  }
@@ -25,6 +25,7 @@ const id: string = "string";
25
25
 
26
26
  const res = await sdk.initImage.deleteInitImageById(id);
27
27
 
28
+
28
29
  if (res.statusCode == 200) {
29
30
  // handle response
30
31
  }
@@ -62,6 +63,7 @@ const id: string = "string";
62
63
 
63
64
  const res = await sdk.initImage.getInitImageById(id);
64
65
 
66
+
65
67
  if (res.statusCode == 200) {
66
68
  // handle response
67
69
  }
@@ -99,6 +101,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
99
101
  extension: "png",
100
102
  });
101
103
 
104
+
102
105
  if (res.statusCode == 200) {
103
106
  // handle response
104
107
  }
@@ -31,6 +31,7 @@ import { CustomModelType, SdVersions, Strength } from "@leonardo-ai/sdk/dist/sdk
31
31
  name: "string",
32
32
  });
33
33
 
34
+
34
35
  if (res.statusCode == 200) {
35
36
  // handle response
36
37
  }
@@ -68,6 +69,7 @@ const id: string = "string";
68
69
 
69
70
  const res = await sdk.model.deleteModelById(id);
70
71
 
72
+
71
73
  if (res.statusCode == 200) {
72
74
  // handle response
73
75
  }
@@ -106,6 +108,7 @@ const requestBody: DeleteModels3dIdRequestBody = {};
106
108
 
107
109
  const res = await sdk.model.deleteModels3dId(id, requestBody);
108
110
 
111
+
109
112
  if (res.statusCode == 200) {
110
113
  // handle response
111
114
  }
@@ -144,6 +147,7 @@ const id: string = "string";
144
147
 
145
148
  const res = await sdk.model.getModelById(id);
146
149
 
150
+
147
151
  if (res.statusCode == 200) {
148
152
  // handle response
149
153
  }
@@ -182,6 +186,7 @@ const offset: number = 472174;
182
186
 
183
187
  const res = await sdk.model.getPlatformModels(limit, offset);
184
188
 
189
+
185
190
  if (res.statusCode == 200) {
186
191
  // handle response
187
192
  }
@@ -218,6 +223,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
218
223
 
219
224
  const res = await sdk.model.postModels3dUpload({});
220
225
 
226
+
221
227
  if (res.statusCode == 200) {
222
228
  // handle response
223
229
  }
@@ -21,6 +21,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
21
21
 
22
22
  const res = await sdk.user.getUserSelf();
23
23
 
24
+
24
25
  if (res.statusCode == 200) {
25
26
  // handle response
26
27
  }
@@ -26,6 +26,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
26
26
  id: "<ID>",
27
27
  });
28
28
 
29
+
29
30
  if (res.statusCode == 200) {
30
31
  // handle response
31
32
  }
@@ -63,6 +64,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
63
64
  id: "<ID>",
64
65
  });
65
66
 
67
+
66
68
  if (res.statusCode == 200) {
67
69
  // handle response
68
70
  }
@@ -100,6 +102,7 @@ const id: string = "string";
100
102
 
101
103
  const res = await sdk.variation.getVariationById(id);
102
104
 
105
+
103
106
  if (res.statusCode == 200) {
104
107
  // handle response
105
108
  }
@@ -135,6 +138,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
135
138
 
136
139
  const res = await sdk.variation.postVariationsUnzoom({});
137
140
 
141
+
138
142
  if (res.statusCode == 200) {
139
143
  // handle response
140
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardo-ai/sdk",
3
- "version": "1.64.2",
3
+ "version": "1.64.3",
4
4
  "author": "leonardoai",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build",