@leonardo-ai/sdk 4.6.0 → 4.10.1

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.
Files changed (112) hide show
  1. package/README.md +2 -1
  2. package/docs/sdks/dataset/README.md +6 -16
  3. package/docs/sdks/generation/README.md +5 -23
  4. package/docs/sdks/initimage/README.md +2 -6
  5. package/docs/sdks/model/README.md +3 -10
  6. package/docs/sdks/variation/README.md +43 -3
  7. package/hooks/hooks.d.ts +5 -1
  8. package/hooks/hooks.d.ts.map +1 -1
  9. package/hooks/hooks.js +11 -0
  10. package/hooks/hooks.js.map +1 -1
  11. package/hooks/types.d.ts +29 -16
  12. package/hooks/types.d.ts.map +1 -1
  13. package/lib/config.d.ts +3 -3
  14. package/lib/config.js +3 -3
  15. package/lib/config.js.map +1 -1
  16. package/lib/encodings.d.ts +0 -1
  17. package/lib/encodings.d.ts.map +1 -1
  18. package/lib/http.d.ts +10 -1
  19. package/lib/http.d.ts.map +1 -1
  20. package/lib/http.js +45 -15
  21. package/lib/http.js.map +1 -1
  22. package/lib/sdks.d.ts +1 -1
  23. package/lib/sdks.d.ts.map +1 -1
  24. package/lib/sdks.js +10 -6
  25. package/lib/sdks.js.map +1 -1
  26. package/lib/security.d.ts +1 -1
  27. package/lib/security.d.ts.map +1 -1
  28. package/package.json +7 -7
  29. package/sdk/dataset.d.ts +1 -1
  30. package/sdk/dataset.d.ts.map +1 -1
  31. package/sdk/dataset.js +23 -17
  32. package/sdk/dataset.js.map +1 -1
  33. package/sdk/element.d.ts.map +1 -1
  34. package/sdk/element.js +4 -3
  35. package/sdk/element.js.map +1 -1
  36. package/sdk/generation.d.ts +7 -7
  37. package/sdk/generation.d.ts.map +1 -1
  38. package/sdk/generation.js +65 -47
  39. package/sdk/generation.js.map +1 -1
  40. package/sdk/initimage.d.ts +1 -1
  41. package/sdk/initimage.d.ts.map +1 -1
  42. package/sdk/initimage.js +15 -11
  43. package/sdk/initimage.js.map +1 -1
  44. package/sdk/model.d.ts +2 -2
  45. package/sdk/model.d.ts.map +1 -1
  46. package/sdk/model.js +30 -22
  47. package/sdk/model.js.map +1 -1
  48. package/sdk/models/errors/sdkerror.d.ts +1 -0
  49. package/sdk/models/errors/sdkerror.d.ts.map +1 -1
  50. package/sdk/models/errors/sdkerror.js +3 -1
  51. package/sdk/models/errors/sdkerror.js.map +1 -1
  52. package/sdk/models/operations/creategeneration.d.ts +6 -6
  53. package/sdk/models/operations/creategeneration.d.ts.map +1 -1
  54. package/sdk/models/operations/creategeneration.js +24 -24
  55. package/sdk/models/operations/creategeneration.js.map +1 -1
  56. package/sdk/models/operations/createuniversalupscalerjob.d.ts +131 -0
  57. package/sdk/models/operations/createuniversalupscalerjob.d.ts.map +1 -0
  58. package/sdk/models/operations/createuniversalupscalerjob.js +170 -0
  59. package/sdk/models/operations/createuniversalupscalerjob.js.map +1 -0
  60. package/sdk/models/operations/getgenerationbyid.d.ts +1 -1
  61. package/sdk/models/operations/getgenerationbyid.d.ts.map +1 -1
  62. package/sdk/models/operations/getgenerationbyid.js +4 -4
  63. package/sdk/models/operations/getgenerationbyid.js.map +1 -1
  64. package/sdk/models/operations/getgenerationsbyuserid.d.ts +1 -1
  65. package/sdk/models/operations/getgenerationsbyuserid.d.ts.map +1 -1
  66. package/sdk/models/operations/getgenerationsbyuserid.js +4 -4
  67. package/sdk/models/operations/getgenerationsbyuserid.js.map +1 -1
  68. package/sdk/models/operations/index.d.ts +1 -0
  69. package/sdk/models/operations/index.d.ts.map +1 -1
  70. package/sdk/models/operations/index.js +1 -0
  71. package/sdk/models/operations/index.js.map +1 -1
  72. package/sdk/models/shared/index.d.ts +1 -0
  73. package/sdk/models/shared/index.d.ts.map +1 -1
  74. package/sdk/models/shared/index.js +1 -0
  75. package/sdk/models/shared/index.js.map +1 -1
  76. package/sdk/models/shared/universalupscalerstyle.d.ts +13 -0
  77. package/sdk/models/shared/universalupscalerstyle.d.ts.map +1 -0
  78. package/sdk/models/shared/universalupscalerstyle.js +43 -0
  79. package/sdk/models/shared/universalupscalerstyle.js.map +1 -0
  80. package/sdk/prompt.d.ts +1 -1
  81. package/sdk/prompt.d.ts.map +1 -1
  82. package/sdk/prompt.js +11 -8
  83. package/sdk/prompt.js.map +1 -1
  84. package/sdk/user.d.ts.map +1 -1
  85. package/sdk/user.js +4 -3
  86. package/sdk/user.js.map +1 -1
  87. package/sdk/variation.d.ts +10 -3
  88. package/sdk/variation.d.ts.map +1 -1
  89. package/sdk/variation.js +89 -18
  90. package/sdk/variation.js.map +1 -1
  91. package/src/hooks/hooks.ts +18 -0
  92. package/src/hooks/types.ts +31 -16
  93. package/src/lib/config.ts +3 -3
  94. package/src/lib/http.ts +64 -16
  95. package/src/lib/sdks.ts +15 -6
  96. package/src/lib/security.ts +1 -1
  97. package/src/sdk/dataset.ts +48 -17
  98. package/src/sdk/element.ts +9 -3
  99. package/src/sdk/generation.ts +120 -47
  100. package/src/sdk/initimage.ts +30 -11
  101. package/src/sdk/model.ts +60 -22
  102. package/src/sdk/models/errors/sdkerror.ts +4 -1
  103. package/src/sdk/models/operations/creategeneration.ts +34 -30
  104. package/src/sdk/models/operations/createuniversalupscalerjob.ts +296 -0
  105. package/src/sdk/models/operations/getgenerationbyid.ts +9 -5
  106. package/src/sdk/models/operations/getgenerationsbyuserid.ts +9 -5
  107. package/src/sdk/models/operations/index.ts +1 -0
  108. package/src/sdk/models/shared/index.ts +1 -0
  109. package/src/sdk/models/shared/universalupscalerstyle.ts +19 -0
  110. package/src/sdk/prompt.ts +21 -8
  111. package/src/sdk/user.ts +9 -3
  112. package/src/sdk/variation.ts +134 -18
package/src/sdk/model.ts CHANGED
@@ -45,16 +45,17 @@ export class Model extends ClientSDK {
45
45
  * This endpoint will train a new custom model
46
46
  */
47
47
  async createModel(
48
- input: operations.CreateModelRequestBody,
48
+ request: operations.CreateModelRequestBody,
49
49
  options?: RequestOptions
50
50
  ): Promise<operations.CreateModelResponse> {
51
+ const input$ = request;
51
52
  const headers$ = new Headers();
52
53
  headers$.set("user-agent", SDK_METADATA.userAgent);
53
54
  headers$.set("Content-Type", "application/json");
54
55
  headers$.set("Accept", "application/json");
55
56
 
56
57
  const payload$ = schemas$.parse(
57
- input,
58
+ input$,
58
59
  (value$) => operations.CreateModelRequestBody$.outboundSchema.parse(value$),
59
60
  "Input validation failed"
60
61
  );
@@ -80,7 +81,8 @@ export class Model extends ClientSDK {
80
81
  const securitySettings$ = this.resolveGlobalSecurity(security$);
81
82
 
82
83
  const doOptions = { context, errorCodes: [] };
83
- const request = this.createRequest$(
84
+ const request$ = this.createRequest$(
85
+ context,
84
86
  {
85
87
  security: securitySettings$,
86
88
  method: "POST",
@@ -92,12 +94,13 @@ export class Model extends ClientSDK {
92
94
  options
93
95
  );
94
96
 
95
- const response = await this.do$(request, doOptions);
97
+ const response = await this.do$(request$, doOptions);
96
98
 
97
99
  const responseFields$ = {
98
100
  ContentType: response.headers.get("content-type") ?? "application/octet-stream",
99
101
  StatusCode: response.status,
100
102
  RawResponse: response,
103
+ Headers: {},
101
104
  };
102
105
 
103
106
  if (this.matchResponse(response, 200, "application/json")) {
@@ -115,7 +118,11 @@ export class Model extends ClientSDK {
115
118
  return result;
116
119
  } else {
117
120
  const responseBody = await response.text();
118
- throw new errors.SDKError("Unexpected API response", response, responseBody);
121
+ throw new errors.SDKError(
122
+ "Unexpected API response status or content-type",
123
+ response,
124
+ responseBody
125
+ );
119
126
  }
120
127
  }
121
128
 
@@ -169,7 +176,8 @@ export class Model extends ClientSDK {
169
176
  const securitySettings$ = this.resolveGlobalSecurity(security$);
170
177
 
171
178
  const doOptions = { context, errorCodes: [] };
172
- const request = this.createRequest$(
179
+ const request$ = this.createRequest$(
180
+ context,
173
181
  {
174
182
  security: securitySettings$,
175
183
  method: "DELETE",
@@ -181,12 +189,13 @@ export class Model extends ClientSDK {
181
189
  options
182
190
  );
183
191
 
184
- const response = await this.do$(request, doOptions);
192
+ const response = await this.do$(request$, doOptions);
185
193
 
186
194
  const responseFields$ = {
187
195
  ContentType: response.headers.get("content-type") ?? "application/octet-stream",
188
196
  StatusCode: response.status,
189
197
  RawResponse: response,
198
+ Headers: {},
190
199
  };
191
200
 
192
201
  if (this.matchResponse(response, 200, "application/json")) {
@@ -204,7 +213,11 @@ export class Model extends ClientSDK {
204
213
  return result;
205
214
  } else {
206
215
  const responseBody = await response.text();
207
- throw new errors.SDKError("Unexpected API response", response, responseBody);
216
+ throw new errors.SDKError(
217
+ "Unexpected API response status or content-type",
218
+ response,
219
+ responseBody
220
+ );
208
221
  }
209
222
  }
210
223
 
@@ -255,7 +268,8 @@ export class Model extends ClientSDK {
255
268
  const securitySettings$ = this.resolveGlobalSecurity(security$);
256
269
 
257
270
  const doOptions = { context, errorCodes: [] };
258
- const request = this.createRequest$(
271
+ const request$ = this.createRequest$(
272
+ context,
259
273
  {
260
274
  security: securitySettings$,
261
275
  method: "DELETE",
@@ -267,12 +281,13 @@ export class Model extends ClientSDK {
267
281
  options
268
282
  );
269
283
 
270
- const response = await this.do$(request, doOptions);
284
+ const response = await this.do$(request$, doOptions);
271
285
 
272
286
  const responseFields$ = {
273
287
  ContentType: response.headers.get("content-type") ?? "application/octet-stream",
274
288
  StatusCode: response.status,
275
289
  RawResponse: response,
290
+ Headers: {},
276
291
  };
277
292
 
278
293
  if (this.matchResponse(response, 200, "application/json")) {
@@ -290,7 +305,11 @@ export class Model extends ClientSDK {
290
305
  return result;
291
306
  } else {
292
307
  const responseBody = await response.text();
293
- throw new errors.SDKError("Unexpected API response", response, responseBody);
308
+ throw new errors.SDKError(
309
+ "Unexpected API response status or content-type",
310
+ response,
311
+ responseBody
312
+ );
294
313
  }
295
314
  }
296
315
 
@@ -341,7 +360,8 @@ export class Model extends ClientSDK {
341
360
  const securitySettings$ = this.resolveGlobalSecurity(security$);
342
361
 
343
362
  const doOptions = { context, errorCodes: [] };
344
- const request = this.createRequest$(
363
+ const request$ = this.createRequest$(
364
+ context,
345
365
  {
346
366
  security: securitySettings$,
347
367
  method: "GET",
@@ -353,12 +373,13 @@ export class Model extends ClientSDK {
353
373
  options
354
374
  );
355
375
 
356
- const response = await this.do$(request, doOptions);
376
+ const response = await this.do$(request$, doOptions);
357
377
 
358
378
  const responseFields$ = {
359
379
  ContentType: response.headers.get("content-type") ?? "application/octet-stream",
360
380
  StatusCode: response.status,
361
381
  RawResponse: response,
382
+ Headers: {},
362
383
  };
363
384
 
364
385
  if (this.matchResponse(response, 200, "application/json")) {
@@ -376,7 +397,11 @@ export class Model extends ClientSDK {
376
397
  return result;
377
398
  } else {
378
399
  const responseBody = await response.text();
379
- throw new errors.SDKError("Unexpected API response", response, responseBody);
400
+ throw new errors.SDKError(
401
+ "Unexpected API response status or content-type",
402
+ response,
403
+ responseBody
404
+ );
380
405
  }
381
406
  }
382
407
 
@@ -413,7 +438,8 @@ export class Model extends ClientSDK {
413
438
  const securitySettings$ = this.resolveGlobalSecurity(security$);
414
439
 
415
440
  const doOptions = { context, errorCodes: [] };
416
- const request = this.createRequest$(
441
+ const request$ = this.createRequest$(
442
+ context,
417
443
  {
418
444
  security: securitySettings$,
419
445
  method: "GET",
@@ -424,12 +450,13 @@ export class Model extends ClientSDK {
424
450
  options
425
451
  );
426
452
 
427
- const response = await this.do$(request, doOptions);
453
+ const response = await this.do$(request$, doOptions);
428
454
 
429
455
  const responseFields$ = {
430
456
  ContentType: response.headers.get("content-type") ?? "application/octet-stream",
431
457
  StatusCode: response.status,
432
458
  RawResponse: response,
459
+ Headers: {},
433
460
  };
434
461
 
435
462
  if (this.matchResponse(response, 200, "application/json")) {
@@ -447,7 +474,11 @@ export class Model extends ClientSDK {
447
474
  return result;
448
475
  } else {
449
476
  const responseBody = await response.text();
450
- throw new errors.SDKError("Unexpected API response", response, responseBody);
477
+ throw new errors.SDKError(
478
+ "Unexpected API response status or content-type",
479
+ response,
480
+ responseBody
481
+ );
451
482
  }
452
483
  }
453
484
 
@@ -458,16 +489,17 @@ export class Model extends ClientSDK {
458
489
  * This endpoint returns presigned details to upload a 3D model to S3
459
490
  */
460
491
  async uploadModelAsset(
461
- input: operations.UploadModelAssetRequestBody | undefined,
492
+ request?: operations.UploadModelAssetRequestBody | undefined,
462
493
  options?: RequestOptions
463
494
  ): Promise<operations.UploadModelAssetResponse> {
495
+ const input$ = request;
464
496
  const headers$ = new Headers();
465
497
  headers$.set("user-agent", SDK_METADATA.userAgent);
466
498
  headers$.set("Content-Type", "application/json");
467
499
  headers$.set("Accept", "application/json");
468
500
 
469
501
  const payload$ = schemas$.parse(
470
- input,
502
+ input$,
471
503
  (value$) =>
472
504
  operations.UploadModelAssetRequestBody$.outboundSchema.optional().parse(value$),
473
505
  "Input validation failed"
@@ -495,7 +527,8 @@ export class Model extends ClientSDK {
495
527
  const securitySettings$ = this.resolveGlobalSecurity(security$);
496
528
 
497
529
  const doOptions = { context, errorCodes: [] };
498
- const request = this.createRequest$(
530
+ const request$ = this.createRequest$(
531
+ context,
499
532
  {
500
533
  security: securitySettings$,
501
534
  method: "POST",
@@ -507,12 +540,13 @@ export class Model extends ClientSDK {
507
540
  options
508
541
  );
509
542
 
510
- const response = await this.do$(request, doOptions);
543
+ const response = await this.do$(request$, doOptions);
511
544
 
512
545
  const responseFields$ = {
513
546
  ContentType: response.headers.get("content-type") ?? "application/octet-stream",
514
547
  StatusCode: response.status,
515
548
  RawResponse: response,
549
+ Headers: {},
516
550
  };
517
551
 
518
552
  if (this.matchResponse(response, 200, "application/json")) {
@@ -530,7 +564,11 @@ export class Model extends ClientSDK {
530
564
  return result;
531
565
  } else {
532
566
  const responseBody = await response.text();
533
- throw new errors.SDKError("Unexpected API response", response, responseBody);
567
+ throw new errors.SDKError(
568
+ "Unexpected API response status or content-type",
569
+ response,
570
+ responseBody
571
+ );
534
572
  }
535
573
  }
536
574
  }
@@ -4,6 +4,7 @@
4
4
 
5
5
  export class SDKError extends Error {
6
6
  public readonly statusCode: number;
7
+ public readonly contentType: string;
7
8
 
8
9
  constructor(
9
10
  message: string,
@@ -11,11 +12,13 @@ export class SDKError extends Error {
11
12
  public readonly body: string = ""
12
13
  ) {
13
14
  const statusCode = rawResponse.status;
15
+ const contentType = rawResponse.headers.get("content-type") || "";
14
16
  const bodyString = body.length > 0 ? `\n${body}` : "";
15
17
 
16
- super(`${message}: Status ${statusCode}${bodyString}`);
18
+ super(`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`);
17
19
 
18
20
  this.statusCode = statusCode;
21
+ this.contentType = contentType;
19
22
 
20
23
  this.name = "SDKError";
21
24
  }
@@ -85,7 +85,7 @@ export type CreateGenerationRequestBody = {
85
85
  */
86
86
  numImages?: number | null | undefined;
87
87
  /**
88
- * The number of inference steps to use for the generation. Must be between 30 and 60.
88
+ * The Step Count to use for the generation. Must be between 10 and 60. Default is 15.
89
89
  */
90
90
  numInferenceSteps?: number | null | undefined;
91
91
  /**
@@ -154,7 +154,7 @@ export type CreateGenerationRequestBody = {
154
154
  */
155
155
  upscaleRatio?: number | null | undefined;
156
156
  /**
157
- * How much weighting to use for generation.
157
+ * How much weighting to use for ControlNet. This parameter works with controlNet and controlNetType.
158
158
  */
159
159
  weighting?: number | null | undefined;
160
160
  /**
@@ -247,7 +247,7 @@ export namespace CreateGenerationRequestBody$ {
247
247
 
248
248
  export const inboundSchema: z.ZodType<CreateGenerationRequestBody, z.ZodTypeDef, Inbound> = z
249
249
  .object({
250
- alchemy: z.nullable(z.boolean()).optional(),
250
+ alchemy: z.nullable(z.boolean().default(true)),
251
251
  contrastRatio: z.nullable(z.number()).optional(),
252
252
  controlNet: z.nullable(z.boolean()).optional(),
253
253
  controlNetType: shared.ControlnetType$.optional(),
@@ -255,7 +255,7 @@ export namespace CreateGenerationRequestBody$ {
255
255
  expandedDomain: z.nullable(z.boolean()).optional(),
256
256
  fantasyAvatar: z.nullable(z.boolean()).optional(),
257
257
  guidance_scale: z.nullable(z.number().int()).optional(),
258
- height: z.nullable(z.number().int().default(512)),
258
+ height: z.nullable(z.number().int().default(768)),
259
259
  highContrast: z.nullable(z.boolean()).optional(),
260
260
  highResolution: z.nullable(z.boolean()).optional(),
261
261
  imagePromptWeight: z.nullable(z.number()).optional(),
@@ -263,15 +263,17 @@ export namespace CreateGenerationRequestBody$ {
263
263
  init_generation_image_id: z.nullable(z.string()).optional(),
264
264
  init_image_id: z.nullable(z.string()).optional(),
265
265
  init_strength: z.nullable(z.number()).optional(),
266
- modelId: z.nullable(z.string().default("6bef9f1b-29cb-40c7-b9df-32b51c1f67d3")),
266
+ modelId: z.nullable(z.string().default("b24e16ff-06e3-43eb-8d33-4416c2d75876")),
267
267
  negative_prompt: z.nullable(z.string()).optional(),
268
- num_images: z.nullable(z.number().int()).optional(),
268
+ num_images: z.nullable(z.number().int().default(4)),
269
269
  num_inference_steps: z.nullable(z.number().int()).optional(),
270
270
  photoReal: z.nullable(z.boolean()).optional(),
271
271
  photoRealStrength: z.nullable(z.number()).optional(),
272
272
  photoRealVersion: z.nullable(z.string()).optional(),
273
- presetStyle: z.nullable(shared.SdGenerationStyle$).optional(),
274
- prompt: z.string().default("An oil painting of a cat"),
273
+ presetStyle: z.nullable(
274
+ shared.SdGenerationStyle$.default(shared.SdGenerationStyle.Dynamic)
275
+ ),
276
+ prompt: z.string().default("A majestic cat in the snow"),
275
277
  promptMagic: z.nullable(z.boolean()).optional(),
276
278
  promptMagicStrength: z.nullable(z.number()).optional(),
277
279
  promptMagicVersion: z.nullable(z.string()).optional(),
@@ -280,16 +282,16 @@ export namespace CreateGenerationRequestBody$ {
280
282
  sd_version: shared.SdVersions$.optional(),
281
283
  seed: z.nullable(z.number().int()).optional(),
282
284
  tiling: z.nullable(z.boolean()).optional(),
283
- transparency: z.nullable(TransparencyType$.default(TransparencyType.Disabled)),
285
+ transparency: z.nullable(TransparencyType$).optional(),
284
286
  unzoom: z.nullable(z.boolean()).optional(),
285
287
  unzoomAmount: z.nullable(z.number()).optional(),
286
288
  upscaleRatio: z.nullable(z.number()).optional(),
287
289
  weighting: z.nullable(z.number()).optional(),
288
- width: z.nullable(z.number().int().default(512)),
290
+ width: z.nullable(z.number().int().default(1024)),
289
291
  })
290
292
  .transform((v) => {
291
293
  return {
292
- ...(v.alchemy === undefined ? null : { alchemy: v.alchemy }),
294
+ alchemy: v.alchemy,
293
295
  ...(v.contrastRatio === undefined ? null : { contrastRatio: v.contrastRatio }),
294
296
  ...(v.controlNet === undefined ? null : { controlNet: v.controlNet }),
295
297
  ...(v.controlNetType === undefined ? null : { controlNetType: v.controlNetType }),
@@ -311,7 +313,7 @@ export namespace CreateGenerationRequestBody$ {
311
313
  ...(v.init_strength === undefined ? null : { initStrength: v.init_strength }),
312
314
  modelId: v.modelId,
313
315
  ...(v.negative_prompt === undefined ? null : { negativePrompt: v.negative_prompt }),
314
- ...(v.num_images === undefined ? null : { numImages: v.num_images }),
316
+ numImages: v.num_images,
315
317
  ...(v.num_inference_steps === undefined
316
318
  ? null
317
319
  : { numInferenceSteps: v.num_inference_steps }),
@@ -322,7 +324,7 @@ export namespace CreateGenerationRequestBody$ {
322
324
  ...(v.photoRealVersion === undefined
323
325
  ? null
324
326
  : { photoRealVersion: v.photoRealVersion }),
325
- ...(v.presetStyle === undefined ? null : { presetStyle: v.presetStyle }),
327
+ presetStyle: v.presetStyle,
326
328
  prompt: v.prompt,
327
329
  ...(v.promptMagic === undefined ? null : { promptMagic: v.promptMagic }),
328
330
  ...(v.promptMagicStrength === undefined
@@ -336,7 +338,7 @@ export namespace CreateGenerationRequestBody$ {
336
338
  ...(v.sd_version === undefined ? null : { sdVersion: v.sd_version }),
337
339
  ...(v.seed === undefined ? null : { seed: v.seed }),
338
340
  ...(v.tiling === undefined ? null : { tiling: v.tiling }),
339
- transparency: v.transparency,
341
+ ...(v.transparency === undefined ? null : { transparency: v.transparency }),
340
342
  ...(v.unzoom === undefined ? null : { unzoom: v.unzoom }),
341
343
  ...(v.unzoomAmount === undefined ? null : { unzoomAmount: v.unzoomAmount }),
342
344
  ...(v.upscaleRatio === undefined ? null : { upscaleRatio: v.upscaleRatio }),
@@ -346,7 +348,7 @@ export namespace CreateGenerationRequestBody$ {
346
348
  });
347
349
 
348
350
  export type Outbound = {
349
- alchemy?: boolean | null | undefined;
351
+ alchemy: boolean | null;
350
352
  contrastRatio?: number | null | undefined;
351
353
  controlNet?: boolean | null | undefined;
352
354
  controlNetType?: shared.ControlnetType | undefined;
@@ -364,12 +366,12 @@ export namespace CreateGenerationRequestBody$ {
364
366
  init_strength?: number | null | undefined;
365
367
  modelId: string | null;
366
368
  negative_prompt?: string | null | undefined;
367
- num_images?: number | null | undefined;
369
+ num_images: number | null;
368
370
  num_inference_steps?: number | null | undefined;
369
371
  photoReal?: boolean | null | undefined;
370
372
  photoRealStrength?: number | null | undefined;
371
373
  photoRealVersion?: string | null | undefined;
372
- presetStyle?: shared.SdGenerationStyle | null | undefined;
374
+ presetStyle: shared.SdGenerationStyle | null;
373
375
  prompt: string;
374
376
  promptMagic?: boolean | null | undefined;
375
377
  promptMagicStrength?: number | null | undefined;
@@ -379,7 +381,7 @@ export namespace CreateGenerationRequestBody$ {
379
381
  sd_version?: shared.SdVersions | undefined;
380
382
  seed?: number | null | undefined;
381
383
  tiling?: boolean | null | undefined;
382
- transparency: TransparencyType | null;
384
+ transparency?: TransparencyType | null | undefined;
383
385
  unzoom?: boolean | null | undefined;
384
386
  unzoomAmount?: number | null | undefined;
385
387
  upscaleRatio?: number | null | undefined;
@@ -389,7 +391,7 @@ export namespace CreateGenerationRequestBody$ {
389
391
 
390
392
  export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreateGenerationRequestBody> = z
391
393
  .object({
392
- alchemy: z.nullable(z.boolean()).optional(),
394
+ alchemy: z.nullable(z.boolean().default(true)),
393
395
  contrastRatio: z.nullable(z.number()).optional(),
394
396
  controlNet: z.nullable(z.boolean()).optional(),
395
397
  controlNetType: shared.ControlnetType$.optional(),
@@ -397,7 +399,7 @@ export namespace CreateGenerationRequestBody$ {
397
399
  expandedDomain: z.nullable(z.boolean()).optional(),
398
400
  fantasyAvatar: z.nullable(z.boolean()).optional(),
399
401
  guidanceScale: z.nullable(z.number().int()).optional(),
400
- height: z.nullable(z.number().int().default(512)),
402
+ height: z.nullable(z.number().int().default(768)),
401
403
  highContrast: z.nullable(z.boolean()).optional(),
402
404
  highResolution: z.nullable(z.boolean()).optional(),
403
405
  imagePromptWeight: z.nullable(z.number()).optional(),
@@ -405,15 +407,17 @@ export namespace CreateGenerationRequestBody$ {
405
407
  initGenerationImageId: z.nullable(z.string()).optional(),
406
408
  initImageId: z.nullable(z.string()).optional(),
407
409
  initStrength: z.nullable(z.number()).optional(),
408
- modelId: z.nullable(z.string().default("6bef9f1b-29cb-40c7-b9df-32b51c1f67d3")),
410
+ modelId: z.nullable(z.string().default("b24e16ff-06e3-43eb-8d33-4416c2d75876")),
409
411
  negativePrompt: z.nullable(z.string()).optional(),
410
- numImages: z.nullable(z.number().int()).optional(),
412
+ numImages: z.nullable(z.number().int().default(4)),
411
413
  numInferenceSteps: z.nullable(z.number().int()).optional(),
412
414
  photoReal: z.nullable(z.boolean()).optional(),
413
415
  photoRealStrength: z.nullable(z.number()).optional(),
414
416
  photoRealVersion: z.nullable(z.string()).optional(),
415
- presetStyle: z.nullable(shared.SdGenerationStyle$).optional(),
416
- prompt: z.string().default("An oil painting of a cat"),
417
+ presetStyle: z.nullable(
418
+ shared.SdGenerationStyle$.default(shared.SdGenerationStyle.Dynamic)
419
+ ),
420
+ prompt: z.string().default("A majestic cat in the snow"),
417
421
  promptMagic: z.nullable(z.boolean()).optional(),
418
422
  promptMagicStrength: z.nullable(z.number()).optional(),
419
423
  promptMagicVersion: z.nullable(z.string()).optional(),
@@ -422,16 +426,16 @@ export namespace CreateGenerationRequestBody$ {
422
426
  sdVersion: shared.SdVersions$.optional(),
423
427
  seed: z.nullable(z.number().int()).optional(),
424
428
  tiling: z.nullable(z.boolean()).optional(),
425
- transparency: z.nullable(TransparencyType$.default(TransparencyType.Disabled)),
429
+ transparency: z.nullable(TransparencyType$).optional(),
426
430
  unzoom: z.nullable(z.boolean()).optional(),
427
431
  unzoomAmount: z.nullable(z.number()).optional(),
428
432
  upscaleRatio: z.nullable(z.number()).optional(),
429
433
  weighting: z.nullable(z.number()).optional(),
430
- width: z.nullable(z.number().int().default(512)),
434
+ width: z.nullable(z.number().int().default(1024)),
431
435
  })
432
436
  .transform((v) => {
433
437
  return {
434
- ...(v.alchemy === undefined ? null : { alchemy: v.alchemy }),
438
+ alchemy: v.alchemy,
435
439
  ...(v.contrastRatio === undefined ? null : { contrastRatio: v.contrastRatio }),
436
440
  ...(v.controlNet === undefined ? null : { controlNet: v.controlNet }),
437
441
  ...(v.controlNetType === undefined ? null : { controlNetType: v.controlNetType }),
@@ -453,7 +457,7 @@ export namespace CreateGenerationRequestBody$ {
453
457
  ...(v.initStrength === undefined ? null : { init_strength: v.initStrength }),
454
458
  modelId: v.modelId,
455
459
  ...(v.negativePrompt === undefined ? null : { negative_prompt: v.negativePrompt }),
456
- ...(v.numImages === undefined ? null : { num_images: v.numImages }),
460
+ num_images: v.numImages,
457
461
  ...(v.numInferenceSteps === undefined
458
462
  ? null
459
463
  : { num_inference_steps: v.numInferenceSteps }),
@@ -464,7 +468,7 @@ export namespace CreateGenerationRequestBody$ {
464
468
  ...(v.photoRealVersion === undefined
465
469
  ? null
466
470
  : { photoRealVersion: v.photoRealVersion }),
467
- ...(v.presetStyle === undefined ? null : { presetStyle: v.presetStyle }),
471
+ presetStyle: v.presetStyle,
468
472
  prompt: v.prompt,
469
473
  ...(v.promptMagic === undefined ? null : { promptMagic: v.promptMagic }),
470
474
  ...(v.promptMagicStrength === undefined
@@ -478,7 +482,7 @@ export namespace CreateGenerationRequestBody$ {
478
482
  ...(v.sdVersion === undefined ? null : { sd_version: v.sdVersion }),
479
483
  ...(v.seed === undefined ? null : { seed: v.seed }),
480
484
  ...(v.tiling === undefined ? null : { tiling: v.tiling }),
481
- transparency: v.transparency,
485
+ ...(v.transparency === undefined ? null : { transparency: v.transparency }),
482
486
  ...(v.unzoom === undefined ? null : { unzoom: v.unzoom }),
483
487
  ...(v.unzoomAmount === undefined ? null : { unzoomAmount: v.unzoomAmount }),
484
488
  ...(v.upscaleRatio === undefined ? null : { upscaleRatio: v.upscaleRatio }),