@leonardo-ai/sdk 4.3.0 → 4.3.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.
- package/.speakeasy/gen.lock +28 -6
- package/README.md +4 -0
- package/docs/sdks/generation/README.md +181 -0
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/package.json +1 -1
- package/sdk/generation.d.ts +28 -0
- package/sdk/generation.d.ts.map +1 -1
- package/sdk/generation.js +232 -0
- package/sdk/generation.js.map +1 -1
- package/sdk/models/operations/index.d.ts +4 -0
- package/sdk/models/operations/index.d.ts.map +1 -1
- package/sdk/models/operations/index.js +4 -0
- package/sdk/models/operations/index.js.map +1 -1
- package/sdk/models/operations/postgenerationslcm.d.ts +146 -0
- package/sdk/models/operations/postgenerationslcm.d.ts.map +1 -0
- package/sdk/models/operations/postgenerationslcm.js +194 -0
- package/sdk/models/operations/postgenerationslcm.js.map +1 -0
- package/sdk/models/operations/postlcminpainting.d.ts +152 -0
- package/sdk/models/operations/postlcminpainting.d.ts.map +1 -0
- package/sdk/models/operations/postlcminpainting.js +198 -0
- package/sdk/models/operations/postlcminpainting.js.map +1 -0
- package/sdk/models/operations/postlcminstantrefine.d.ts +146 -0
- package/sdk/models/operations/postlcminstantrefine.d.ts.map +1 -0
- package/sdk/models/operations/postlcminstantrefine.js +194 -0
- package/sdk/models/operations/postlcminstantrefine.js.map +1 -0
- package/sdk/models/operations/postlcmupscale.d.ts +167 -0
- package/sdk/models/operations/postlcmupscale.d.ts.map +1 -0
- package/sdk/models/operations/postlcmupscale.js +218 -0
- package/sdk/models/operations/postlcmupscale.js.map +1 -0
- package/sdk/models/shared/index.d.ts +1 -0
- package/sdk/models/shared/index.d.ts.map +1 -1
- package/sdk/models/shared/index.js +1 -0
- package/sdk/models/shared/index.js.map +1 -1
- package/sdk/models/shared/lcmgenerationstyle.d.ts +23 -0
- package/sdk/models/shared/lcmgenerationstyle.d.ts.map +1 -0
- package/sdk/models/shared/lcmgenerationstyle.js +30 -0
- package/sdk/models/shared/lcmgenerationstyle.js.map +1 -0
- package/src/lib/config.ts +3 -3
- package/src/sdk/generation.ts +316 -0
- package/src/sdk/models/operations/index.ts +4 -0
- package/src/sdk/models/operations/postgenerationslcm.ts +309 -0
- package/src/sdk/models/operations/postlcminpainting.ts +326 -0
- package/src/sdk/models/operations/postlcminstantrefine.ts +325 -0
- package/src/sdk/models/operations/postlcmupscale.ts +360 -0
- package/src/sdk/models/shared/index.ts +1 -0
- package/src/sdk/models/shared/lcmgenerationstyle.ts +28 -0
package/src/sdk/generation.ts
CHANGED
|
@@ -458,6 +458,85 @@ export class Generation extends ClientSDK {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
+
/**
|
|
462
|
+
* Create LCM Generation
|
|
463
|
+
*
|
|
464
|
+
* @remarks
|
|
465
|
+
* This endpoint will generate a LCM image generation.
|
|
466
|
+
*/
|
|
467
|
+
async postGenerationsLcm(
|
|
468
|
+
input: operations.PostGenerationsLcmRequestBody | undefined,
|
|
469
|
+
options?: RequestOptions
|
|
470
|
+
): Promise<operations.PostGenerationsLcmResponse> {
|
|
471
|
+
const headers$ = new Headers();
|
|
472
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
473
|
+
headers$.set("Content-Type", "application/json");
|
|
474
|
+
headers$.set("Accept", "application/json");
|
|
475
|
+
|
|
476
|
+
const payload$ = schemas$.parse(
|
|
477
|
+
input,
|
|
478
|
+
(value$) =>
|
|
479
|
+
operations.PostGenerationsLcmRequestBody$.outboundSchema.optional().parse(value$),
|
|
480
|
+
"Input validation failed"
|
|
481
|
+
);
|
|
482
|
+
const body$ =
|
|
483
|
+
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
484
|
+
|
|
485
|
+
const path$ = this.templateURLComponent("/generations-lcm")();
|
|
486
|
+
|
|
487
|
+
const query$ = "";
|
|
488
|
+
|
|
489
|
+
let security$;
|
|
490
|
+
if (typeof this.options$.bearerAuth === "function") {
|
|
491
|
+
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
492
|
+
} else if (this.options$.bearerAuth) {
|
|
493
|
+
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
494
|
+
} else {
|
|
495
|
+
security$ = {};
|
|
496
|
+
}
|
|
497
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
498
|
+
|
|
499
|
+
const context = { operationID: "post_/generations-lcm" };
|
|
500
|
+
const doOptions = { context, errorCodes: [] };
|
|
501
|
+
const request = this.createRequest$(
|
|
502
|
+
{
|
|
503
|
+
security: securitySettings$,
|
|
504
|
+
method: "POST",
|
|
505
|
+
path: path$,
|
|
506
|
+
headers: headers$,
|
|
507
|
+
query: query$,
|
|
508
|
+
body: body$,
|
|
509
|
+
},
|
|
510
|
+
options
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
const response = await this.do$(request, doOptions);
|
|
514
|
+
|
|
515
|
+
const responseFields$ = {
|
|
516
|
+
ContentType: response.headers.get("content-type") ?? "application/octet-stream",
|
|
517
|
+
StatusCode: response.status,
|
|
518
|
+
RawResponse: response,
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
522
|
+
const responseBody = await response.json();
|
|
523
|
+
const result = schemas$.parse(
|
|
524
|
+
responseBody,
|
|
525
|
+
(val$) => {
|
|
526
|
+
return operations.PostGenerationsLcmResponse$.inboundSchema.parse({
|
|
527
|
+
...responseFields$,
|
|
528
|
+
object: val$,
|
|
529
|
+
});
|
|
530
|
+
},
|
|
531
|
+
"Response validation failed"
|
|
532
|
+
);
|
|
533
|
+
return result;
|
|
534
|
+
} else {
|
|
535
|
+
const responseBody = await response.text();
|
|
536
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
461
540
|
/**
|
|
462
541
|
* Create SVD Motion Generation
|
|
463
542
|
*
|
|
@@ -619,4 +698,241 @@ export class Generation extends ClientSDK {
|
|
|
619
698
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
620
699
|
}
|
|
621
700
|
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Perform inpainting on a LCM image
|
|
704
|
+
*
|
|
705
|
+
* @remarks
|
|
706
|
+
* This endpoint will perform a inpainting on a LCM image
|
|
707
|
+
*/
|
|
708
|
+
async postLcmInpainting(
|
|
709
|
+
input: operations.PostLcmInpaintingRequestBody | undefined,
|
|
710
|
+
options?: RequestOptions
|
|
711
|
+
): Promise<operations.PostLcmInpaintingResponse> {
|
|
712
|
+
const headers$ = new Headers();
|
|
713
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
714
|
+
headers$.set("Content-Type", "application/json");
|
|
715
|
+
headers$.set("Accept", "application/json");
|
|
716
|
+
|
|
717
|
+
const payload$ = schemas$.parse(
|
|
718
|
+
input,
|
|
719
|
+
(value$) =>
|
|
720
|
+
operations.PostLcmInpaintingRequestBody$.outboundSchema.optional().parse(value$),
|
|
721
|
+
"Input validation failed"
|
|
722
|
+
);
|
|
723
|
+
const body$ =
|
|
724
|
+
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
725
|
+
|
|
726
|
+
const path$ = this.templateURLComponent("/lcm-inpainting")();
|
|
727
|
+
|
|
728
|
+
const query$ = "";
|
|
729
|
+
|
|
730
|
+
let security$;
|
|
731
|
+
if (typeof this.options$.bearerAuth === "function") {
|
|
732
|
+
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
733
|
+
} else if (this.options$.bearerAuth) {
|
|
734
|
+
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
735
|
+
} else {
|
|
736
|
+
security$ = {};
|
|
737
|
+
}
|
|
738
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
739
|
+
|
|
740
|
+
const context = { operationID: "post_/lcm-inpainting" };
|
|
741
|
+
const doOptions = { context, errorCodes: [] };
|
|
742
|
+
const request = this.createRequest$(
|
|
743
|
+
{
|
|
744
|
+
security: securitySettings$,
|
|
745
|
+
method: "POST",
|
|
746
|
+
path: path$,
|
|
747
|
+
headers: headers$,
|
|
748
|
+
query: query$,
|
|
749
|
+
body: body$,
|
|
750
|
+
},
|
|
751
|
+
options
|
|
752
|
+
);
|
|
753
|
+
|
|
754
|
+
const response = await this.do$(request, doOptions);
|
|
755
|
+
|
|
756
|
+
const responseFields$ = {
|
|
757
|
+
ContentType: response.headers.get("content-type") ?? "application/octet-stream",
|
|
758
|
+
StatusCode: response.status,
|
|
759
|
+
RawResponse: response,
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
763
|
+
const responseBody = await response.json();
|
|
764
|
+
const result = schemas$.parse(
|
|
765
|
+
responseBody,
|
|
766
|
+
(val$) => {
|
|
767
|
+
return operations.PostLcmInpaintingResponse$.inboundSchema.parse({
|
|
768
|
+
...responseFields$,
|
|
769
|
+
object: val$,
|
|
770
|
+
});
|
|
771
|
+
},
|
|
772
|
+
"Response validation failed"
|
|
773
|
+
);
|
|
774
|
+
return result;
|
|
775
|
+
} else {
|
|
776
|
+
const responseBody = await response.text();
|
|
777
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Perform instant refine on a LCM image
|
|
783
|
+
*
|
|
784
|
+
* @remarks
|
|
785
|
+
* This endpoint will perform instant refine on a LCM image
|
|
786
|
+
*/
|
|
787
|
+
async postLcmInstantRefine(
|
|
788
|
+
input: operations.PostLcmInstantRefineRequestBody | undefined,
|
|
789
|
+
options?: RequestOptions
|
|
790
|
+
): Promise<operations.PostLcmInstantRefineResponse> {
|
|
791
|
+
const headers$ = new Headers();
|
|
792
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
793
|
+
headers$.set("Content-Type", "application/json");
|
|
794
|
+
headers$.set("Accept", "application/json");
|
|
795
|
+
|
|
796
|
+
const payload$ = schemas$.parse(
|
|
797
|
+
input,
|
|
798
|
+
(value$) =>
|
|
799
|
+
operations.PostLcmInstantRefineRequestBody$.outboundSchema.optional().parse(value$),
|
|
800
|
+
"Input validation failed"
|
|
801
|
+
);
|
|
802
|
+
const body$ =
|
|
803
|
+
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
804
|
+
|
|
805
|
+
const path$ = this.templateURLComponent("/lcm-instant-refine")();
|
|
806
|
+
|
|
807
|
+
const query$ = "";
|
|
808
|
+
|
|
809
|
+
let security$;
|
|
810
|
+
if (typeof this.options$.bearerAuth === "function") {
|
|
811
|
+
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
812
|
+
} else if (this.options$.bearerAuth) {
|
|
813
|
+
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
814
|
+
} else {
|
|
815
|
+
security$ = {};
|
|
816
|
+
}
|
|
817
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
818
|
+
|
|
819
|
+
const context = { operationID: "post_/lcm-instant-refine" };
|
|
820
|
+
const doOptions = { context, errorCodes: [] };
|
|
821
|
+
const request = this.createRequest$(
|
|
822
|
+
{
|
|
823
|
+
security: securitySettings$,
|
|
824
|
+
method: "POST",
|
|
825
|
+
path: path$,
|
|
826
|
+
headers: headers$,
|
|
827
|
+
query: query$,
|
|
828
|
+
body: body$,
|
|
829
|
+
},
|
|
830
|
+
options
|
|
831
|
+
);
|
|
832
|
+
|
|
833
|
+
const response = await this.do$(request, doOptions);
|
|
834
|
+
|
|
835
|
+
const responseFields$ = {
|
|
836
|
+
ContentType: response.headers.get("content-type") ?? "application/octet-stream",
|
|
837
|
+
StatusCode: response.status,
|
|
838
|
+
RawResponse: response,
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
842
|
+
const responseBody = await response.json();
|
|
843
|
+
const result = schemas$.parse(
|
|
844
|
+
responseBody,
|
|
845
|
+
(val$) => {
|
|
846
|
+
return operations.PostLcmInstantRefineResponse$.inboundSchema.parse({
|
|
847
|
+
...responseFields$,
|
|
848
|
+
object: val$,
|
|
849
|
+
});
|
|
850
|
+
},
|
|
851
|
+
"Response validation failed"
|
|
852
|
+
);
|
|
853
|
+
return result;
|
|
854
|
+
} else {
|
|
855
|
+
const responseBody = await response.text();
|
|
856
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Perform Alchemy Upscale on a LCM image
|
|
862
|
+
*
|
|
863
|
+
* @remarks
|
|
864
|
+
* This endpoint will perform Alchemy Upscale on a LCM image
|
|
865
|
+
*/
|
|
866
|
+
async postLcmUpscale(
|
|
867
|
+
input: operations.PostLcmUpscaleRequestBody | undefined,
|
|
868
|
+
options?: RequestOptions
|
|
869
|
+
): Promise<operations.PostLcmUpscaleResponse> {
|
|
870
|
+
const headers$ = new Headers();
|
|
871
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
872
|
+
headers$.set("Content-Type", "application/json");
|
|
873
|
+
headers$.set("Accept", "application/json");
|
|
874
|
+
|
|
875
|
+
const payload$ = schemas$.parse(
|
|
876
|
+
input,
|
|
877
|
+
(value$) =>
|
|
878
|
+
operations.PostLcmUpscaleRequestBody$.outboundSchema.optional().parse(value$),
|
|
879
|
+
"Input validation failed"
|
|
880
|
+
);
|
|
881
|
+
const body$ =
|
|
882
|
+
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
883
|
+
|
|
884
|
+
const path$ = this.templateURLComponent("/lcm-upscale")();
|
|
885
|
+
|
|
886
|
+
const query$ = "";
|
|
887
|
+
|
|
888
|
+
let security$;
|
|
889
|
+
if (typeof this.options$.bearerAuth === "function") {
|
|
890
|
+
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
891
|
+
} else if (this.options$.bearerAuth) {
|
|
892
|
+
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
893
|
+
} else {
|
|
894
|
+
security$ = {};
|
|
895
|
+
}
|
|
896
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
897
|
+
|
|
898
|
+
const context = { operationID: "post_/lcm-upscale" };
|
|
899
|
+
const doOptions = { context, errorCodes: [] };
|
|
900
|
+
const request = this.createRequest$(
|
|
901
|
+
{
|
|
902
|
+
security: securitySettings$,
|
|
903
|
+
method: "POST",
|
|
904
|
+
path: path$,
|
|
905
|
+
headers: headers$,
|
|
906
|
+
query: query$,
|
|
907
|
+
body: body$,
|
|
908
|
+
},
|
|
909
|
+
options
|
|
910
|
+
);
|
|
911
|
+
|
|
912
|
+
const response = await this.do$(request, doOptions);
|
|
913
|
+
|
|
914
|
+
const responseFields$ = {
|
|
915
|
+
ContentType: response.headers.get("content-type") ?? "application/octet-stream",
|
|
916
|
+
StatusCode: response.status,
|
|
917
|
+
RawResponse: response,
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
921
|
+
const responseBody = await response.json();
|
|
922
|
+
const result = schemas$.parse(
|
|
923
|
+
responseBody,
|
|
924
|
+
(val$) => {
|
|
925
|
+
return operations.PostLcmUpscaleResponse$.inboundSchema.parse({
|
|
926
|
+
...responseFields$,
|
|
927
|
+
object: val$,
|
|
928
|
+
});
|
|
929
|
+
},
|
|
930
|
+
"Response validation failed"
|
|
931
|
+
);
|
|
932
|
+
return result;
|
|
933
|
+
} else {
|
|
934
|
+
const responseBody = await response.text();
|
|
935
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
622
938
|
}
|
|
@@ -22,8 +22,12 @@ export * from "./getmodelbyid";
|
|
|
22
22
|
export * from "./getplatformmodels";
|
|
23
23
|
export * from "./getuserself";
|
|
24
24
|
export * from "./getvariationbyid";
|
|
25
|
+
export * from "./postgenerationslcm";
|
|
25
26
|
export * from "./postgenerationsmotionsvd";
|
|
26
27
|
export * from "./postgenerationstexture";
|
|
28
|
+
export * from "./postlcminpainting";
|
|
29
|
+
export * from "./postlcminstantrefine";
|
|
30
|
+
export * from "./postlcmupscale";
|
|
27
31
|
export * from "./postmodels3dupload";
|
|
28
32
|
export * from "./postvariationsunzoom";
|
|
29
33
|
export * from "./uploaddatasetimage";
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as shared from "../../../sdk/models/shared";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Query parameters can also be provided in the request body as a JSON object
|
|
10
|
+
*/
|
|
11
|
+
export type PostGenerationsLcmRequestBody = {
|
|
12
|
+
/**
|
|
13
|
+
* How strongly the generation should reflect the prompt. Must be a float between 0.5 and 20.
|
|
14
|
+
*/
|
|
15
|
+
guidance?: number | null | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The output width of the image. Must be 512, 640 or 1024.
|
|
18
|
+
*/
|
|
19
|
+
height?: number | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Image data used to generate image. In base64 format. Prefix: `data:image/jpeg;base64,`
|
|
22
|
+
*/
|
|
23
|
+
imageDataUrl: string;
|
|
24
|
+
/**
|
|
25
|
+
* The prompt used to generate images
|
|
26
|
+
*/
|
|
27
|
+
prompt: string;
|
|
28
|
+
requestTimestamp?: string | undefined;
|
|
29
|
+
seed?: number | null | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The number of steps to use for the generation. Must be between 4 and 16.
|
|
32
|
+
*/
|
|
33
|
+
steps?: number | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* How strongly the generated images should reflect the original image supplied in imageDataUrl. Must be a float between 0.1 and 1.
|
|
36
|
+
*/
|
|
37
|
+
strength?: number | null | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The style to generate LCM images with.
|
|
40
|
+
*/
|
|
41
|
+
style?: shared.LcmGenerationStyle | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The output width of the image. Must be 512, 640 or 1024.
|
|
44
|
+
*/
|
|
45
|
+
width?: number | null | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type LcmGenerationOutput = {
|
|
49
|
+
/**
|
|
50
|
+
* API credits cost, available for Production API users.
|
|
51
|
+
*/
|
|
52
|
+
apiCreditCost?: number | null | undefined;
|
|
53
|
+
imageDataUrl?: Array<string> | undefined;
|
|
54
|
+
requestTimestamp?: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Responses for POST /generations-lcm
|
|
59
|
+
*/
|
|
60
|
+
export type PostGenerationsLcmResponseBody = {
|
|
61
|
+
lcmGenerationJob?: LcmGenerationOutput | null | undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type PostGenerationsLcmResponse = {
|
|
65
|
+
/**
|
|
66
|
+
* HTTP response content type for this operation
|
|
67
|
+
*/
|
|
68
|
+
contentType: string;
|
|
69
|
+
/**
|
|
70
|
+
* HTTP response status code for this operation
|
|
71
|
+
*/
|
|
72
|
+
statusCode: number;
|
|
73
|
+
/**
|
|
74
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
75
|
+
*/
|
|
76
|
+
rawResponse: Response;
|
|
77
|
+
/**
|
|
78
|
+
* Responses for POST /generations-lcm
|
|
79
|
+
*/
|
|
80
|
+
object?: PostGenerationsLcmResponseBody | undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export namespace PostGenerationsLcmRequestBody$ {
|
|
85
|
+
export type Inbound = {
|
|
86
|
+
guidance?: number | null | undefined;
|
|
87
|
+
height?: number | null | undefined;
|
|
88
|
+
imageDataUrl: string;
|
|
89
|
+
prompt: string;
|
|
90
|
+
requestTimestamp?: string | undefined;
|
|
91
|
+
seed?: number | null | undefined;
|
|
92
|
+
steps?: number | null | undefined;
|
|
93
|
+
strength?: number | null | undefined;
|
|
94
|
+
style?: shared.LcmGenerationStyle | undefined;
|
|
95
|
+
width?: number | null | undefined;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const inboundSchema: z.ZodType<PostGenerationsLcmRequestBody, z.ZodTypeDef, Inbound> = z
|
|
99
|
+
.object({
|
|
100
|
+
guidance: z.nullable(z.number()).optional(),
|
|
101
|
+
height: z.nullable(z.number().int().default(512)),
|
|
102
|
+
imageDataUrl: z.string(),
|
|
103
|
+
prompt: z.string(),
|
|
104
|
+
requestTimestamp: z.string().optional(),
|
|
105
|
+
seed: z.nullable(z.number().int()).optional(),
|
|
106
|
+
steps: z.nullable(z.number().int()).optional(),
|
|
107
|
+
strength: z.nullable(z.number()).optional(),
|
|
108
|
+
style: shared.LcmGenerationStyle$.optional(),
|
|
109
|
+
width: z.nullable(z.number().int().default(512)),
|
|
110
|
+
})
|
|
111
|
+
.transform((v) => {
|
|
112
|
+
return {
|
|
113
|
+
...(v.guidance === undefined ? null : { guidance: v.guidance }),
|
|
114
|
+
height: v.height,
|
|
115
|
+
imageDataUrl: v.imageDataUrl,
|
|
116
|
+
prompt: v.prompt,
|
|
117
|
+
...(v.requestTimestamp === undefined
|
|
118
|
+
? null
|
|
119
|
+
: { requestTimestamp: v.requestTimestamp }),
|
|
120
|
+
...(v.seed === undefined ? null : { seed: v.seed }),
|
|
121
|
+
...(v.steps === undefined ? null : { steps: v.steps }),
|
|
122
|
+
...(v.strength === undefined ? null : { strength: v.strength }),
|
|
123
|
+
...(v.style === undefined ? null : { style: v.style }),
|
|
124
|
+
width: v.width,
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export type Outbound = {
|
|
129
|
+
guidance?: number | null | undefined;
|
|
130
|
+
height: number | null;
|
|
131
|
+
imageDataUrl: string;
|
|
132
|
+
prompt: string;
|
|
133
|
+
requestTimestamp?: string | undefined;
|
|
134
|
+
seed?: number | null | undefined;
|
|
135
|
+
steps?: number | null | undefined;
|
|
136
|
+
strength?: number | null | undefined;
|
|
137
|
+
style?: shared.LcmGenerationStyle | undefined;
|
|
138
|
+
width: number | null;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PostGenerationsLcmRequestBody> =
|
|
142
|
+
z
|
|
143
|
+
.object({
|
|
144
|
+
guidance: z.nullable(z.number()).optional(),
|
|
145
|
+
height: z.nullable(z.number().int().default(512)),
|
|
146
|
+
imageDataUrl: z.string(),
|
|
147
|
+
prompt: z.string(),
|
|
148
|
+
requestTimestamp: z.string().optional(),
|
|
149
|
+
seed: z.nullable(z.number().int()).optional(),
|
|
150
|
+
steps: z.nullable(z.number().int()).optional(),
|
|
151
|
+
strength: z.nullable(z.number()).optional(),
|
|
152
|
+
style: shared.LcmGenerationStyle$.optional(),
|
|
153
|
+
width: z.nullable(z.number().int().default(512)),
|
|
154
|
+
})
|
|
155
|
+
.transform((v) => {
|
|
156
|
+
return {
|
|
157
|
+
...(v.guidance === undefined ? null : { guidance: v.guidance }),
|
|
158
|
+
height: v.height,
|
|
159
|
+
imageDataUrl: v.imageDataUrl,
|
|
160
|
+
prompt: v.prompt,
|
|
161
|
+
...(v.requestTimestamp === undefined
|
|
162
|
+
? null
|
|
163
|
+
: { requestTimestamp: v.requestTimestamp }),
|
|
164
|
+
...(v.seed === undefined ? null : { seed: v.seed }),
|
|
165
|
+
...(v.steps === undefined ? null : { steps: v.steps }),
|
|
166
|
+
...(v.strength === undefined ? null : { strength: v.strength }),
|
|
167
|
+
...(v.style === undefined ? null : { style: v.style }),
|
|
168
|
+
width: v.width,
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** @internal */
|
|
174
|
+
export namespace LcmGenerationOutput$ {
|
|
175
|
+
export type Inbound = {
|
|
176
|
+
apiCreditCost?: number | null | undefined;
|
|
177
|
+
imageDataUrl?: Array<string> | undefined;
|
|
178
|
+
requestTimestamp?: string | undefined;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const inboundSchema: z.ZodType<LcmGenerationOutput, z.ZodTypeDef, Inbound> = z
|
|
182
|
+
.object({
|
|
183
|
+
apiCreditCost: z.nullable(z.number().int()).optional(),
|
|
184
|
+
imageDataUrl: z.array(z.string()).optional(),
|
|
185
|
+
requestTimestamp: z.string().optional(),
|
|
186
|
+
})
|
|
187
|
+
.transform((v) => {
|
|
188
|
+
return {
|
|
189
|
+
...(v.apiCreditCost === undefined ? null : { apiCreditCost: v.apiCreditCost }),
|
|
190
|
+
...(v.imageDataUrl === undefined ? null : { imageDataUrl: v.imageDataUrl }),
|
|
191
|
+
...(v.requestTimestamp === undefined
|
|
192
|
+
? null
|
|
193
|
+
: { requestTimestamp: v.requestTimestamp }),
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
export type Outbound = {
|
|
198
|
+
apiCreditCost?: number | null | undefined;
|
|
199
|
+
imageDataUrl?: Array<string> | undefined;
|
|
200
|
+
requestTimestamp?: string | undefined;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, LcmGenerationOutput> = z
|
|
204
|
+
.object({
|
|
205
|
+
apiCreditCost: z.nullable(z.number().int()).optional(),
|
|
206
|
+
imageDataUrl: z.array(z.string()).optional(),
|
|
207
|
+
requestTimestamp: z.string().optional(),
|
|
208
|
+
})
|
|
209
|
+
.transform((v) => {
|
|
210
|
+
return {
|
|
211
|
+
...(v.apiCreditCost === undefined ? null : { apiCreditCost: v.apiCreditCost }),
|
|
212
|
+
...(v.imageDataUrl === undefined ? null : { imageDataUrl: v.imageDataUrl }),
|
|
213
|
+
...(v.requestTimestamp === undefined
|
|
214
|
+
? null
|
|
215
|
+
: { requestTimestamp: v.requestTimestamp }),
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** @internal */
|
|
221
|
+
export namespace PostGenerationsLcmResponseBody$ {
|
|
222
|
+
export type Inbound = {
|
|
223
|
+
lcmGenerationJob?: LcmGenerationOutput$.Inbound | null | undefined;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const inboundSchema: z.ZodType<PostGenerationsLcmResponseBody, z.ZodTypeDef, Inbound> = z
|
|
227
|
+
.object({
|
|
228
|
+
lcmGenerationJob: z
|
|
229
|
+
.nullable(z.lazy(() => LcmGenerationOutput$.inboundSchema))
|
|
230
|
+
.optional(),
|
|
231
|
+
})
|
|
232
|
+
.transform((v) => {
|
|
233
|
+
return {
|
|
234
|
+
...(v.lcmGenerationJob === undefined
|
|
235
|
+
? null
|
|
236
|
+
: { lcmGenerationJob: v.lcmGenerationJob }),
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
export type Outbound = {
|
|
241
|
+
lcmGenerationJob?: LcmGenerationOutput$.Outbound | null | undefined;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PostGenerationsLcmResponseBody> =
|
|
245
|
+
z
|
|
246
|
+
.object({
|
|
247
|
+
lcmGenerationJob: z
|
|
248
|
+
.nullable(z.lazy(() => LcmGenerationOutput$.outboundSchema))
|
|
249
|
+
.optional(),
|
|
250
|
+
})
|
|
251
|
+
.transform((v) => {
|
|
252
|
+
return {
|
|
253
|
+
...(v.lcmGenerationJob === undefined
|
|
254
|
+
? null
|
|
255
|
+
: { lcmGenerationJob: v.lcmGenerationJob }),
|
|
256
|
+
};
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** @internal */
|
|
261
|
+
export namespace PostGenerationsLcmResponse$ {
|
|
262
|
+
export type Inbound = {
|
|
263
|
+
ContentType: string;
|
|
264
|
+
StatusCode: number;
|
|
265
|
+
RawResponse: Response;
|
|
266
|
+
object?: PostGenerationsLcmResponseBody$.Inbound | undefined;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export const inboundSchema: z.ZodType<PostGenerationsLcmResponse, z.ZodTypeDef, Inbound> = z
|
|
270
|
+
.object({
|
|
271
|
+
ContentType: z.string(),
|
|
272
|
+
StatusCode: z.number().int(),
|
|
273
|
+
RawResponse: z.instanceof(Response),
|
|
274
|
+
object: z.lazy(() => PostGenerationsLcmResponseBody$.inboundSchema).optional(),
|
|
275
|
+
})
|
|
276
|
+
.transform((v) => {
|
|
277
|
+
return {
|
|
278
|
+
contentType: v.ContentType,
|
|
279
|
+
statusCode: v.StatusCode,
|
|
280
|
+
rawResponse: v.RawResponse,
|
|
281
|
+
...(v.object === undefined ? null : { object: v.object }),
|
|
282
|
+
};
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
export type Outbound = {
|
|
286
|
+
ContentType: string;
|
|
287
|
+
StatusCode: number;
|
|
288
|
+
RawResponse: never;
|
|
289
|
+
object?: PostGenerationsLcmResponseBody$.Outbound | undefined;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PostGenerationsLcmResponse> = z
|
|
293
|
+
.object({
|
|
294
|
+
contentType: z.string(),
|
|
295
|
+
statusCode: z.number().int(),
|
|
296
|
+
rawResponse: z.instanceof(Response).transform(() => {
|
|
297
|
+
throw new Error("Response cannot be serialized");
|
|
298
|
+
}),
|
|
299
|
+
object: z.lazy(() => PostGenerationsLcmResponseBody$.outboundSchema).optional(),
|
|
300
|
+
})
|
|
301
|
+
.transform((v) => {
|
|
302
|
+
return {
|
|
303
|
+
ContentType: v.contentType,
|
|
304
|
+
StatusCode: v.statusCode,
|
|
305
|
+
RawResponse: v.rawResponse,
|
|
306
|
+
...(v.object === undefined ? null : { object: v.object }),
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
}
|