@byte_fluffy/nexra-sdk 0.1.0-alpha.4 → 0.1.0-alpha.5
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 +9 -3
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +11 -3
- package/dist/{chunk-AV3GN4TV.js → chunk-2C2ZZKUC.js} +572 -87
- package/dist/{index-mytCeh5t.d.ts → index-FyUOK0F-.d.ts} +32 -1
- package/dist/index.d.ts +91 -3
- package/dist/index.js +246 -10
- package/package.json +1 -1
|
@@ -46,7 +46,8 @@ var image_generated_default = [
|
|
|
46
46
|
minLength: 1,
|
|
47
47
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
48
48
|
"x-ui": {
|
|
49
|
-
order:
|
|
49
|
+
order: -1,
|
|
50
|
+
hidden: true
|
|
50
51
|
},
|
|
51
52
|
const: "openai/gpt-image-2.5-flare",
|
|
52
53
|
examples: [
|
|
@@ -66,7 +67,7 @@ var image_generated_default = [
|
|
|
66
67
|
},
|
|
67
68
|
image: {
|
|
68
69
|
title: "\u8F93\u5165\u56FE\u7247",
|
|
69
|
-
description: "\u7528\u4E8E\u56FE\u7247\u7F16\u8F91\uFF0C\u6700\u591A 16 \u5F20\u3002Task \u4E2D\u586B\u5199\u56FE\u7247 URL \u6216 Data URL\uFF1B\u6267\u884C\u65F6\u6309\u539F\u751F image[] \u5B57\u6BB5\u4E0A\u4F20\u6587\u4EF6\uFF0C\u987A\u5E8F\u4E0D\u53D8\u3002",
|
|
70
|
+
description: "\u7528\u4E8E\u56FE\u7247\u7F16\u8F91\uFF0C\u6700\u591A 16 \u5F20\uFF0C\u6BCF\u5F20\u5C0F\u4E8E 50 MB\u3002\u63D0\u4F9B\u8499\u7248\u65F6\uFF0C\u8499\u7248\u5E94\u7528\u4E8E\u7B2C\u4E00\u5F20\u8F93\u5165\u56FE\uFF0C\u5E76\u4E14\u5FC5\u987B\u4E0E\u8BE5\u56FE\u683C\u5F0F\u548C\u5C3A\u5BF8\u4E00\u81F4\u3002Task \u4E2D\u586B\u5199\u56FE\u7247 URL \u6216 Data URL\uFF1B\u6267\u884C\u65F6\u6309\u539F\u751F image[] \u5B57\u6BB5\u4E0A\u4F20\u6587\u4EF6\uFF0C\u987A\u5E8F\u4E0D\u53D8\u3002",
|
|
70
71
|
anyOf: [
|
|
71
72
|
{
|
|
72
73
|
type: "string",
|
|
@@ -96,7 +97,7 @@ var image_generated_default = [
|
|
|
96
97
|
pattern: "^(https?://|data:image/)",
|
|
97
98
|
minLength: 1,
|
|
98
99
|
title: "\u7F16\u8F91\u8499\u7248",
|
|
99
|
-
description: "\u53EF\u9009\u7684\u4E00\u5F20
|
|
100
|
+
description: "\u53EF\u9009\u7684\u4E00\u5F20\u8499\u7248\uFF0C\u9700\u540C\u65F6\u63D0\u4F9B\u8F93\u5165\u56FE\u7247\uFF1B\u6587\u4EF6\u5C0F\u4E8E 50 MB\uFF0C\u5FC5\u987B\u5305\u542B Alpha \u901A\u9053\uFF0C\u5E76\u4E0E\u7B2C\u4E00\u5F20\u8F93\u5165\u56FE\u683C\u5F0F\u3001\u5C3A\u5BF8\u4E00\u81F4\u3002\u591A\u56FE\u7F16\u8F91\u65F6\u4EC5\u5E94\u7528\u4E8E\u7B2C\u4E00\u5F20\u56FE\u3002Task \u4E2D\u586B\u5199 URL \u6216 Data URL\uFF0C\u6267\u884C\u65F6\u4E0A\u4F20\u4E3A mask \u6587\u4EF6\u3002",
|
|
100
101
|
"x-ui": {
|
|
101
102
|
order: 3
|
|
102
103
|
}
|
|
@@ -123,7 +124,8 @@ var image_generated_default = [
|
|
|
123
124
|
minimum: 1,
|
|
124
125
|
maximum: 10,
|
|
125
126
|
"x-ui": {
|
|
126
|
-
order: 5
|
|
127
|
+
order: 5,
|
|
128
|
+
control: "range"
|
|
127
129
|
}
|
|
128
130
|
},
|
|
129
131
|
quality: {
|
|
@@ -146,7 +148,8 @@ var image_generated_default = [
|
|
|
146
148
|
high: "\u9AD8",
|
|
147
149
|
xhigh: "\u66F4\u9AD8",
|
|
148
150
|
max: "\u6700\u9AD8"
|
|
149
|
-
}
|
|
151
|
+
},
|
|
152
|
+
control: "segmented"
|
|
150
153
|
}
|
|
151
154
|
},
|
|
152
155
|
output_format: {
|
|
@@ -154,15 +157,18 @@ var image_generated_default = [
|
|
|
154
157
|
description: "\u8F93\u51FA\u56FE\u7247\u7684\u7F16\u7801\u683C\u5F0F\u3002",
|
|
155
158
|
enum: [
|
|
156
159
|
"png",
|
|
157
|
-
"jpeg"
|
|
160
|
+
"jpeg",
|
|
161
|
+
"webp"
|
|
158
162
|
],
|
|
159
163
|
title: "\u56FE\u7247\u683C\u5F0F",
|
|
160
164
|
"x-ui": {
|
|
161
165
|
order: 7,
|
|
162
166
|
optionLabels: {
|
|
163
167
|
png: "PNG",
|
|
164
|
-
jpeg: "JPEG"
|
|
165
|
-
|
|
168
|
+
jpeg: "JPEG",
|
|
169
|
+
webp: "WebP"
|
|
170
|
+
},
|
|
171
|
+
control: "segmented"
|
|
166
172
|
}
|
|
167
173
|
},
|
|
168
174
|
output_compression: {
|
|
@@ -170,9 +176,11 @@ var image_generated_default = [
|
|
|
170
176
|
minimum: 0,
|
|
171
177
|
maximum: 100,
|
|
172
178
|
multipleOf: 1,
|
|
173
|
-
description: "JPEG \u538B\u7F29\u8D28\u91CF\uFF0C0\uFF5E100\uFF1B\u4EC5\u5728 output_format \u4E3A jpeg \u65F6\u4F7F\u7528\u3002",
|
|
179
|
+
description: "JPEG \u6216 WebP \u538B\u7F29\u8D28\u91CF\uFF0C0\uFF5E100\uFF1B\u4EC5\u5728 output_format \u4E3A jpeg \u6216 webp \u65F6\u4F7F\u7528\u3002",
|
|
174
180
|
"x-ui": {
|
|
175
|
-
order: 8
|
|
181
|
+
order: 8,
|
|
182
|
+
control: "range",
|
|
183
|
+
unit: "%"
|
|
176
184
|
},
|
|
177
185
|
title: "\u538B\u7F29\u8D28\u91CF"
|
|
178
186
|
},
|
|
@@ -183,14 +191,15 @@ var image_generated_default = [
|
|
|
183
191
|
"opaque",
|
|
184
192
|
"transparent"
|
|
185
193
|
],
|
|
186
|
-
description: "\u53EF\u9009\u62E9\u81EA\u52A8\u3001\u4E0D\u900F\u660E\u6216\u900F\u660E\u80CC\u666F\uFF1B\u900F\u660E\u80CC\u666F\u9700\u4F7F\u7528 PNG\u3002",
|
|
194
|
+
description: "\u53EF\u9009\u62E9\u81EA\u52A8\u3001\u4E0D\u900F\u660E\u6216\u900F\u660E\u80CC\u666F\uFF1B\u900F\u660E\u80CC\u666F\u9700\u4F7F\u7528 PNG \u6216 WebP\u3002",
|
|
187
195
|
"x-ui": {
|
|
188
196
|
order: 9,
|
|
189
197
|
optionLabels: {
|
|
190
198
|
auto: "\u81EA\u52A8",
|
|
191
199
|
opaque: "\u4E0D\u900F\u660E",
|
|
192
200
|
transparent: "\u900F\u660E"
|
|
193
|
-
}
|
|
201
|
+
},
|
|
202
|
+
control: "segmented"
|
|
194
203
|
},
|
|
195
204
|
title: "\u80CC\u666F"
|
|
196
205
|
},
|
|
@@ -206,7 +215,8 @@ var image_generated_default = [
|
|
|
206
215
|
optionLabels: {
|
|
207
216
|
auto: "\u81EA\u52A8",
|
|
208
217
|
low: "\u4F4E"
|
|
209
|
-
}
|
|
218
|
+
},
|
|
219
|
+
control: "segmented"
|
|
210
220
|
},
|
|
211
221
|
title: "\u5185\u5BB9\u5BA1\u6838"
|
|
212
222
|
},
|
|
@@ -215,7 +225,8 @@ var image_generated_default = [
|
|
|
215
225
|
title: "\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6",
|
|
216
226
|
description: "\u4F20\u7ED9\u4E0A\u6E38\u7684\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6\uFF0C\u7528\u4E8E\u6EE5\u7528\u76D1\u6D4B\u3002",
|
|
217
227
|
"x-ui": {
|
|
218
|
-
order:
|
|
228
|
+
order: 99,
|
|
229
|
+
hidden: true
|
|
219
230
|
}
|
|
220
231
|
}
|
|
221
232
|
},
|
|
@@ -261,7 +272,10 @@ var image_generated_default = [
|
|
|
261
272
|
],
|
|
262
273
|
properties: {
|
|
263
274
|
output_format: {
|
|
264
|
-
|
|
275
|
+
enum: [
|
|
276
|
+
"jpeg",
|
|
277
|
+
"webp"
|
|
278
|
+
]
|
|
265
279
|
}
|
|
266
280
|
}
|
|
267
281
|
}
|
|
@@ -280,7 +294,10 @@ var image_generated_default = [
|
|
|
280
294
|
then: {
|
|
281
295
|
properties: {
|
|
282
296
|
output_format: {
|
|
283
|
-
|
|
297
|
+
enum: [
|
|
298
|
+
"png",
|
|
299
|
+
"webp"
|
|
300
|
+
]
|
|
284
301
|
}
|
|
285
302
|
}
|
|
286
303
|
}
|
|
@@ -570,7 +587,8 @@ var image_generated_default = [
|
|
|
570
587
|
minLength: 1,
|
|
571
588
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
572
589
|
"x-ui": {
|
|
573
|
-
order:
|
|
590
|
+
order: -1,
|
|
591
|
+
hidden: true
|
|
574
592
|
},
|
|
575
593
|
const: "openai/gpt-image-2.5-sunburst",
|
|
576
594
|
examples: [
|
|
@@ -590,7 +608,7 @@ var image_generated_default = [
|
|
|
590
608
|
},
|
|
591
609
|
image: {
|
|
592
610
|
title: "\u8F93\u5165\u56FE\u7247",
|
|
593
|
-
description: "\u7528\u4E8E\u56FE\u7247\u7F16\u8F91\uFF0C\u6700\u591A 16 \u5F20\u3002Task \u4E2D\u586B\u5199\u56FE\u7247 URL \u6216 Data URL\uFF1B\u6267\u884C\u65F6\u6309\u539F\u751F image[] \u5B57\u6BB5\u4E0A\u4F20\u6587\u4EF6\uFF0C\u987A\u5E8F\u4E0D\u53D8\u3002",
|
|
611
|
+
description: "\u7528\u4E8E\u56FE\u7247\u7F16\u8F91\uFF0C\u6700\u591A 16 \u5F20\uFF0C\u6BCF\u5F20\u5C0F\u4E8E 50 MB\u3002\u63D0\u4F9B\u8499\u7248\u65F6\uFF0C\u8499\u7248\u5E94\u7528\u4E8E\u7B2C\u4E00\u5F20\u8F93\u5165\u56FE\uFF0C\u5E76\u4E14\u5FC5\u987B\u4E0E\u8BE5\u56FE\u683C\u5F0F\u548C\u5C3A\u5BF8\u4E00\u81F4\u3002Task \u4E2D\u586B\u5199\u56FE\u7247 URL \u6216 Data URL\uFF1B\u6267\u884C\u65F6\u6309\u539F\u751F image[] \u5B57\u6BB5\u4E0A\u4F20\u6587\u4EF6\uFF0C\u987A\u5E8F\u4E0D\u53D8\u3002",
|
|
594
612
|
anyOf: [
|
|
595
613
|
{
|
|
596
614
|
type: "string",
|
|
@@ -620,7 +638,7 @@ var image_generated_default = [
|
|
|
620
638
|
pattern: "^(https?://|data:image/)",
|
|
621
639
|
minLength: 1,
|
|
622
640
|
title: "\u7F16\u8F91\u8499\u7248",
|
|
623
|
-
description: "\u53EF\u9009\u7684\u4E00\u5F20
|
|
641
|
+
description: "\u53EF\u9009\u7684\u4E00\u5F20\u8499\u7248\uFF0C\u9700\u540C\u65F6\u63D0\u4F9B\u8F93\u5165\u56FE\u7247\uFF1B\u6587\u4EF6\u5C0F\u4E8E 50 MB\uFF0C\u5FC5\u987B\u5305\u542B Alpha \u901A\u9053\uFF0C\u5E76\u4E0E\u7B2C\u4E00\u5F20\u8F93\u5165\u56FE\u683C\u5F0F\u3001\u5C3A\u5BF8\u4E00\u81F4\u3002\u591A\u56FE\u7F16\u8F91\u65F6\u4EC5\u5E94\u7528\u4E8E\u7B2C\u4E00\u5F20\u56FE\u3002Task \u4E2D\u586B\u5199 URL \u6216 Data URL\uFF0C\u6267\u884C\u65F6\u4E0A\u4F20\u4E3A mask \u6587\u4EF6\u3002",
|
|
624
642
|
"x-ui": {
|
|
625
643
|
order: 3
|
|
626
644
|
}
|
|
@@ -647,7 +665,8 @@ var image_generated_default = [
|
|
|
647
665
|
minimum: 1,
|
|
648
666
|
maximum: 10,
|
|
649
667
|
"x-ui": {
|
|
650
|
-
order: 5
|
|
668
|
+
order: 5,
|
|
669
|
+
control: "range"
|
|
651
670
|
}
|
|
652
671
|
},
|
|
653
672
|
quality: {
|
|
@@ -670,7 +689,8 @@ var image_generated_default = [
|
|
|
670
689
|
high: "\u9AD8",
|
|
671
690
|
xhigh: "\u66F4\u9AD8",
|
|
672
691
|
max: "\u6700\u9AD8"
|
|
673
|
-
}
|
|
692
|
+
},
|
|
693
|
+
control: "segmented"
|
|
674
694
|
}
|
|
675
695
|
},
|
|
676
696
|
output_format: {
|
|
@@ -678,15 +698,18 @@ var image_generated_default = [
|
|
|
678
698
|
description: "\u8F93\u51FA\u56FE\u7247\u7684\u7F16\u7801\u683C\u5F0F\u3002",
|
|
679
699
|
enum: [
|
|
680
700
|
"png",
|
|
681
|
-
"jpeg"
|
|
701
|
+
"jpeg",
|
|
702
|
+
"webp"
|
|
682
703
|
],
|
|
683
704
|
title: "\u56FE\u7247\u683C\u5F0F",
|
|
684
705
|
"x-ui": {
|
|
685
706
|
order: 7,
|
|
686
707
|
optionLabels: {
|
|
687
708
|
png: "PNG",
|
|
688
|
-
jpeg: "JPEG"
|
|
689
|
-
|
|
709
|
+
jpeg: "JPEG",
|
|
710
|
+
webp: "WebP"
|
|
711
|
+
},
|
|
712
|
+
control: "segmented"
|
|
690
713
|
}
|
|
691
714
|
},
|
|
692
715
|
output_compression: {
|
|
@@ -694,9 +717,11 @@ var image_generated_default = [
|
|
|
694
717
|
minimum: 0,
|
|
695
718
|
maximum: 100,
|
|
696
719
|
multipleOf: 1,
|
|
697
|
-
description: "JPEG \u538B\u7F29\u8D28\u91CF\uFF0C0\uFF5E100\uFF1B\u4EC5\u5728 output_format \u4E3A jpeg \u65F6\u4F7F\u7528\u3002",
|
|
720
|
+
description: "JPEG \u6216 WebP \u538B\u7F29\u8D28\u91CF\uFF0C0\uFF5E100\uFF1B\u4EC5\u5728 output_format \u4E3A jpeg \u6216 webp \u65F6\u4F7F\u7528\u3002",
|
|
698
721
|
"x-ui": {
|
|
699
|
-
order: 8
|
|
722
|
+
order: 8,
|
|
723
|
+
control: "range",
|
|
724
|
+
unit: "%"
|
|
700
725
|
},
|
|
701
726
|
title: "\u538B\u7F29\u8D28\u91CF"
|
|
702
727
|
},
|
|
@@ -707,14 +732,15 @@ var image_generated_default = [
|
|
|
707
732
|
"opaque",
|
|
708
733
|
"transparent"
|
|
709
734
|
],
|
|
710
|
-
description: "\u53EF\u9009\u62E9\u81EA\u52A8\u3001\u4E0D\u900F\u660E\u6216\u900F\u660E\u80CC\u666F\uFF1B\u900F\u660E\u80CC\u666F\u9700\u4F7F\u7528 PNG\u3002",
|
|
735
|
+
description: "\u53EF\u9009\u62E9\u81EA\u52A8\u3001\u4E0D\u900F\u660E\u6216\u900F\u660E\u80CC\u666F\uFF1B\u900F\u660E\u80CC\u666F\u9700\u4F7F\u7528 PNG \u6216 WebP\u3002",
|
|
711
736
|
"x-ui": {
|
|
712
737
|
order: 9,
|
|
713
738
|
optionLabels: {
|
|
714
739
|
auto: "\u81EA\u52A8",
|
|
715
740
|
opaque: "\u4E0D\u900F\u660E",
|
|
716
741
|
transparent: "\u900F\u660E"
|
|
717
|
-
}
|
|
742
|
+
},
|
|
743
|
+
control: "segmented"
|
|
718
744
|
},
|
|
719
745
|
title: "\u80CC\u666F"
|
|
720
746
|
},
|
|
@@ -730,7 +756,8 @@ var image_generated_default = [
|
|
|
730
756
|
optionLabels: {
|
|
731
757
|
auto: "\u81EA\u52A8",
|
|
732
758
|
low: "\u4F4E"
|
|
733
|
-
}
|
|
759
|
+
},
|
|
760
|
+
control: "segmented"
|
|
734
761
|
},
|
|
735
762
|
title: "\u5185\u5BB9\u5BA1\u6838"
|
|
736
763
|
},
|
|
@@ -739,7 +766,8 @@ var image_generated_default = [
|
|
|
739
766
|
title: "\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6",
|
|
740
767
|
description: "\u4F20\u7ED9\u4E0A\u6E38\u7684\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6\uFF0C\u7528\u4E8E\u6EE5\u7528\u76D1\u6D4B\u3002",
|
|
741
768
|
"x-ui": {
|
|
742
|
-
order:
|
|
769
|
+
order: 99,
|
|
770
|
+
hidden: true
|
|
743
771
|
}
|
|
744
772
|
}
|
|
745
773
|
},
|
|
@@ -785,7 +813,10 @@ var image_generated_default = [
|
|
|
785
813
|
],
|
|
786
814
|
properties: {
|
|
787
815
|
output_format: {
|
|
788
|
-
|
|
816
|
+
enum: [
|
|
817
|
+
"jpeg",
|
|
818
|
+
"webp"
|
|
819
|
+
]
|
|
789
820
|
}
|
|
790
821
|
}
|
|
791
822
|
}
|
|
@@ -804,7 +835,10 @@ var image_generated_default = [
|
|
|
804
835
|
then: {
|
|
805
836
|
properties: {
|
|
806
837
|
output_format: {
|
|
807
|
-
|
|
838
|
+
enum: [
|
|
839
|
+
"png",
|
|
840
|
+
"webp"
|
|
841
|
+
]
|
|
808
842
|
}
|
|
809
843
|
}
|
|
810
844
|
}
|
|
@@ -2240,7 +2274,8 @@ var image_generated_default = [
|
|
|
2240
2274
|
title: "\u6A21\u578B ID",
|
|
2241
2275
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
2242
2276
|
"x-ui": {
|
|
2243
|
-
order:
|
|
2277
|
+
order: -1,
|
|
2278
|
+
hidden: true
|
|
2244
2279
|
},
|
|
2245
2280
|
examples: [
|
|
2246
2281
|
"bytedance/doubao-seedream-5-0-260128"
|
|
@@ -2293,7 +2328,13 @@ var image_generated_default = [
|
|
|
2293
2328
|
"2048x2048"
|
|
2294
2329
|
],
|
|
2295
2330
|
"x-ui": {
|
|
2296
|
-
order: 3
|
|
2331
|
+
order: 3,
|
|
2332
|
+
control: "select",
|
|
2333
|
+
optionLabels: {
|
|
2334
|
+
"2K": "2K",
|
|
2335
|
+
"3K": "3K",
|
|
2336
|
+
"4K": "4K"
|
|
2337
|
+
}
|
|
2297
2338
|
}
|
|
2298
2339
|
},
|
|
2299
2340
|
response_format: {
|
|
@@ -2303,7 +2344,11 @@ var image_generated_default = [
|
|
|
2303
2344
|
"b64_json"
|
|
2304
2345
|
],
|
|
2305
2346
|
title: "\u54CD\u5E94\u56FE\u7247\u5F62\u5F0F",
|
|
2306
|
-
description: "url \u8FD4\u56DE\u56FE\u7247\u5730\u5740\uFF0Cb64_json \u8FD4\u56DE Base64 \u56FE\u7247\u6570\u636E\u3002"
|
|
2347
|
+
description: "url \u8FD4\u56DE\u56FE\u7247\u5730\u5740\uFF0Cb64_json \u8FD4\u56DE Base64 \u56FE\u7247\u6570\u636E\u3002",
|
|
2348
|
+
"x-ui": {
|
|
2349
|
+
hidden: true,
|
|
2350
|
+
order: 98
|
|
2351
|
+
}
|
|
2307
2352
|
},
|
|
2308
2353
|
output_format: {
|
|
2309
2354
|
type: "string",
|
|
@@ -2311,12 +2356,23 @@ var image_generated_default = [
|
|
|
2311
2356
|
"png",
|
|
2312
2357
|
"jpeg"
|
|
2313
2358
|
],
|
|
2314
|
-
title: "\u56FE\u7247\u683C\u5F0F"
|
|
2359
|
+
title: "\u56FE\u7247\u683C\u5F0F",
|
|
2360
|
+
"x-ui": {
|
|
2361
|
+
control: "segmented",
|
|
2362
|
+
order: 4,
|
|
2363
|
+
optionLabels: {
|
|
2364
|
+
png: "PNG",
|
|
2365
|
+
jpeg: "JPEG"
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2315
2368
|
},
|
|
2316
2369
|
watermark: {
|
|
2317
2370
|
type: "boolean",
|
|
2318
2371
|
title: "\u6C34\u5370",
|
|
2319
|
-
description: "\u662F\u5426\u6DFB\u52A0\u6C34\u5370\u3002"
|
|
2372
|
+
description: "\u662F\u5426\u6DFB\u52A0\u6C34\u5370\u3002",
|
|
2373
|
+
"x-ui": {
|
|
2374
|
+
order: 5
|
|
2375
|
+
}
|
|
2320
2376
|
}
|
|
2321
2377
|
},
|
|
2322
2378
|
required: [
|
|
@@ -2445,7 +2501,8 @@ var image_generated_default = [
|
|
|
2445
2501
|
title: "\u6A21\u578B ID",
|
|
2446
2502
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
2447
2503
|
"x-ui": {
|
|
2448
|
-
order:
|
|
2504
|
+
order: -1,
|
|
2505
|
+
hidden: true
|
|
2449
2506
|
},
|
|
2450
2507
|
examples: [
|
|
2451
2508
|
"bytedance/doubao-seedream-5-0-pro-260628"
|
|
@@ -2498,7 +2555,13 @@ var image_generated_default = [
|
|
|
2498
2555
|
"2048x2048"
|
|
2499
2556
|
],
|
|
2500
2557
|
"x-ui": {
|
|
2501
|
-
order: 3
|
|
2558
|
+
order: 3,
|
|
2559
|
+
control: "select",
|
|
2560
|
+
optionLabels: {
|
|
2561
|
+
"1K": "1K",
|
|
2562
|
+
"1.5K": "1.5K",
|
|
2563
|
+
"2K": "2K"
|
|
2564
|
+
}
|
|
2502
2565
|
}
|
|
2503
2566
|
},
|
|
2504
2567
|
response_format: {
|
|
@@ -2508,7 +2571,11 @@ var image_generated_default = [
|
|
|
2508
2571
|
"b64_json"
|
|
2509
2572
|
],
|
|
2510
2573
|
title: "\u54CD\u5E94\u56FE\u7247\u5F62\u5F0F",
|
|
2511
|
-
description: "url \u8FD4\u56DE\u56FE\u7247\u5730\u5740\uFF0Cb64_json \u8FD4\u56DE Base64 \u56FE\u7247\u6570\u636E\u3002"
|
|
2574
|
+
description: "url \u8FD4\u56DE\u56FE\u7247\u5730\u5740\uFF0Cb64_json \u8FD4\u56DE Base64 \u56FE\u7247\u6570\u636E\u3002",
|
|
2575
|
+
"x-ui": {
|
|
2576
|
+
hidden: true,
|
|
2577
|
+
order: 98
|
|
2578
|
+
}
|
|
2512
2579
|
},
|
|
2513
2580
|
output_format: {
|
|
2514
2581
|
type: "string",
|
|
@@ -2516,17 +2583,31 @@ var image_generated_default = [
|
|
|
2516
2583
|
"png",
|
|
2517
2584
|
"jpeg"
|
|
2518
2585
|
],
|
|
2519
|
-
title: "\u56FE\u7247\u683C\u5F0F"
|
|
2586
|
+
title: "\u56FE\u7247\u683C\u5F0F",
|
|
2587
|
+
"x-ui": {
|
|
2588
|
+
control: "segmented",
|
|
2589
|
+
order: 4,
|
|
2590
|
+
optionLabels: {
|
|
2591
|
+
png: "PNG",
|
|
2592
|
+
jpeg: "JPEG"
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2520
2595
|
},
|
|
2521
2596
|
watermark: {
|
|
2522
2597
|
type: "boolean",
|
|
2523
2598
|
title: "\u6C34\u5370",
|
|
2524
|
-
description: "\u662F\u5426\u6DFB\u52A0\u6C34\u5370\u3002"
|
|
2599
|
+
description: "\u662F\u5426\u6DFB\u52A0\u6C34\u5370\u3002",
|
|
2600
|
+
"x-ui": {
|
|
2601
|
+
order: 5
|
|
2602
|
+
}
|
|
2525
2603
|
},
|
|
2526
2604
|
layer_decomposition: {
|
|
2527
2605
|
type: "boolean",
|
|
2528
2606
|
title: "\u56FE\u7247\u5206\u5C42",
|
|
2529
|
-
description: "\u5C06\u4E00\u5F20\u56FE\u7247\u5206\u89E3\u4E3A\u591A\u4E2A\u56FE\u5C42\u3002"
|
|
2607
|
+
description: "\u5C06\u4E00\u5F20\u56FE\u7247\u5206\u89E3\u4E3A\u591A\u4E2A\u56FE\u5C42\u3002",
|
|
2608
|
+
"x-ui": {
|
|
2609
|
+
order: 6
|
|
2610
|
+
}
|
|
2530
2611
|
},
|
|
2531
2612
|
optimize_prompt_options: {
|
|
2532
2613
|
type: "object",
|
|
@@ -2802,7 +2883,8 @@ var image_generated_default = [
|
|
|
2802
2883
|
accept: [
|
|
2803
2884
|
"url"
|
|
2804
2885
|
]
|
|
2805
|
-
}
|
|
2886
|
+
},
|
|
2887
|
+
title: "\u53C2\u8003\u56FE\u7247"
|
|
2806
2888
|
},
|
|
2807
2889
|
ratio: {
|
|
2808
2890
|
type: "string",
|
|
@@ -2821,7 +2903,7 @@ var image_generated_default = [
|
|
|
2821
2903
|
],
|
|
2822
2904
|
"x-ui": {
|
|
2823
2905
|
order: 2,
|
|
2824
|
-
control: "
|
|
2906
|
+
control: "select",
|
|
2825
2907
|
optionLabels: {
|
|
2826
2908
|
"1:1": "1:1",
|
|
2827
2909
|
"16:9": "16:9",
|
|
@@ -2830,7 +2912,8 @@ var image_generated_default = [
|
|
|
2830
2912
|
"4:3": "4:3"
|
|
2831
2913
|
}
|
|
2832
2914
|
},
|
|
2833
|
-
default: "1:1"
|
|
2915
|
+
default: "1:1",
|
|
2916
|
+
title: "\u753B\u9762\u6BD4\u4F8B"
|
|
2834
2917
|
},
|
|
2835
2918
|
resolution: {
|
|
2836
2919
|
type: "string",
|
|
@@ -2843,15 +2926,17 @@ var image_generated_default = [
|
|
|
2843
2926
|
control: "segmented",
|
|
2844
2927
|
optionLabels: {
|
|
2845
2928
|
"1K": "1K"
|
|
2846
|
-
}
|
|
2929
|
+
},
|
|
2930
|
+
hidden: true
|
|
2847
2931
|
},
|
|
2848
|
-
default: "1K"
|
|
2932
|
+
default: "1K",
|
|
2933
|
+
title: "\u5206\u8FA8\u7387"
|
|
2849
2934
|
},
|
|
2850
2935
|
texts: {
|
|
2851
2936
|
type: "string",
|
|
2852
2937
|
description: "Describe the image to generate or the requested change to an input image.",
|
|
2853
2938
|
minLength: 1,
|
|
2854
|
-
title: "
|
|
2939
|
+
title: "\u63D0\u793A\u8BCD",
|
|
2855
2940
|
"x-ui": {
|
|
2856
2941
|
order: 0,
|
|
2857
2942
|
control: "textarea"
|
|
@@ -3019,7 +3104,8 @@ var image_generated_default = [
|
|
|
3019
3104
|
accept: [
|
|
3020
3105
|
"url"
|
|
3021
3106
|
]
|
|
3022
|
-
}
|
|
3107
|
+
},
|
|
3108
|
+
title: "\u53C2\u8003\u56FE\u7247"
|
|
3023
3109
|
},
|
|
3024
3110
|
ratio: {
|
|
3025
3111
|
type: "string",
|
|
@@ -3062,7 +3148,8 @@ var image_generated_default = [
|
|
|
3062
3148
|
"9:21": "9:21"
|
|
3063
3149
|
}
|
|
3064
3150
|
},
|
|
3065
|
-
default: "1:1"
|
|
3151
|
+
default: "1:1",
|
|
3152
|
+
title: "\u753B\u9762\u6BD4\u4F8B"
|
|
3066
3153
|
},
|
|
3067
3154
|
resolution: {
|
|
3068
3155
|
type: "string",
|
|
@@ -3083,13 +3170,14 @@ var image_generated_default = [
|
|
|
3083
3170
|
"4K": "4K"
|
|
3084
3171
|
}
|
|
3085
3172
|
},
|
|
3086
|
-
default: "1K"
|
|
3173
|
+
default: "1K",
|
|
3174
|
+
title: "\u5206\u8FA8\u7387"
|
|
3087
3175
|
},
|
|
3088
3176
|
texts: {
|
|
3089
3177
|
type: "string",
|
|
3090
3178
|
description: "Describe the image to generate or the requested change to an input image.",
|
|
3091
3179
|
minLength: 1,
|
|
3092
|
-
title: "
|
|
3180
|
+
title: "\u63D0\u793A\u8BCD",
|
|
3093
3181
|
"x-ui": {
|
|
3094
3182
|
order: 0,
|
|
3095
3183
|
control: "textarea"
|
|
@@ -3258,7 +3346,8 @@ var image_generated_default = [
|
|
|
3258
3346
|
accept: [
|
|
3259
3347
|
"url"
|
|
3260
3348
|
]
|
|
3261
|
-
}
|
|
3349
|
+
},
|
|
3350
|
+
title: "\u53C2\u8003\u56FE\u7247"
|
|
3262
3351
|
},
|
|
3263
3352
|
ratio: {
|
|
3264
3353
|
type: "string",
|
|
@@ -3301,7 +3390,8 @@ var image_generated_default = [
|
|
|
3301
3390
|
"9:21": "9:21"
|
|
3302
3391
|
}
|
|
3303
3392
|
},
|
|
3304
|
-
default: "1:1"
|
|
3393
|
+
default: "1:1",
|
|
3394
|
+
title: "\u753B\u9762\u6BD4\u4F8B"
|
|
3305
3395
|
},
|
|
3306
3396
|
resolution: {
|
|
3307
3397
|
type: "string",
|
|
@@ -3314,15 +3404,17 @@ var image_generated_default = [
|
|
|
3314
3404
|
control: "segmented",
|
|
3315
3405
|
optionLabels: {
|
|
3316
3406
|
"1K": "1K"
|
|
3317
|
-
}
|
|
3407
|
+
},
|
|
3408
|
+
hidden: true
|
|
3318
3409
|
},
|
|
3319
|
-
default: "1K"
|
|
3410
|
+
default: "1K",
|
|
3411
|
+
title: "\u5206\u8FA8\u7387"
|
|
3320
3412
|
},
|
|
3321
3413
|
texts: {
|
|
3322
3414
|
type: "string",
|
|
3323
3415
|
description: "Describe the image to generate or the requested change to an input image.",
|
|
3324
3416
|
minLength: 1,
|
|
3325
|
-
title: "
|
|
3417
|
+
title: "\u63D0\u793A\u8BCD",
|
|
3326
3418
|
"x-ui": {
|
|
3327
3419
|
order: 0,
|
|
3328
3420
|
control: "textarea"
|
|
@@ -3489,7 +3581,8 @@ var image_generated_default = [
|
|
|
3489
3581
|
accept: [
|
|
3490
3582
|
"url"
|
|
3491
3583
|
]
|
|
3492
|
-
}
|
|
3584
|
+
},
|
|
3585
|
+
title: "\u53C2\u8003\u56FE\u7247"
|
|
3493
3586
|
},
|
|
3494
3587
|
ratio: {
|
|
3495
3588
|
type: "string",
|
|
@@ -3522,7 +3615,8 @@ var image_generated_default = [
|
|
|
3522
3615
|
"21:9": "21:9"
|
|
3523
3616
|
}
|
|
3524
3617
|
},
|
|
3525
|
-
default: "1:1"
|
|
3618
|
+
default: "1:1",
|
|
3619
|
+
title: "\u753B\u9762\u6BD4\u4F8B"
|
|
3526
3620
|
},
|
|
3527
3621
|
resolution: {
|
|
3528
3622
|
type: "string",
|
|
@@ -3541,13 +3635,14 @@ var image_generated_default = [
|
|
|
3541
3635
|
"4K": "4K"
|
|
3542
3636
|
}
|
|
3543
3637
|
},
|
|
3544
|
-
default: "1K"
|
|
3638
|
+
default: "1K",
|
|
3639
|
+
title: "\u5206\u8FA8\u7387"
|
|
3545
3640
|
},
|
|
3546
3641
|
texts: {
|
|
3547
3642
|
type: "string",
|
|
3548
3643
|
description: "Describe the image to generate or the requested change to an input image.",
|
|
3549
3644
|
minLength: 1,
|
|
3550
|
-
title: "
|
|
3645
|
+
title: "\u63D0\u793A\u8BCD",
|
|
3551
3646
|
"x-ui": {
|
|
3552
3647
|
order: 0,
|
|
3553
3648
|
control: "textarea"
|
|
@@ -3663,7 +3758,8 @@ var image_generated_default = [
|
|
|
3663
3758
|
minLength: 1,
|
|
3664
3759
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
3665
3760
|
"x-ui": {
|
|
3666
|
-
order:
|
|
3761
|
+
order: -1,
|
|
3762
|
+
hidden: true
|
|
3667
3763
|
},
|
|
3668
3764
|
const: "openai/gpt-image-2",
|
|
3669
3765
|
examples: [
|
|
@@ -3683,7 +3779,7 @@ var image_generated_default = [
|
|
|
3683
3779
|
},
|
|
3684
3780
|
image: {
|
|
3685
3781
|
title: "\u8F93\u5165\u56FE\u7247",
|
|
3686
|
-
description: "\u7528\u4E8E\u56FE\u7247\u7F16\u8F91\uFF0C\u6700\u591A 16 \u5F20\u3002Task \u4E2D\u586B\u5199\u56FE\u7247 URL \u6216 Data URL\uFF1B\u6267\u884C\u65F6\u6309\u539F\u751F image[] \u5B57\u6BB5\u4E0A\u4F20\u6587\u4EF6\uFF0C\u987A\u5E8F\u4E0D\u53D8\u3002",
|
|
3782
|
+
description: "\u7528\u4E8E\u56FE\u7247\u7F16\u8F91\uFF0C\u6700\u591A 16 \u5F20\uFF0C\u6BCF\u5F20\u5C0F\u4E8E 50 MB\u3002\u63D0\u4F9B\u8499\u7248\u65F6\uFF0C\u8499\u7248\u5E94\u7528\u4E8E\u7B2C\u4E00\u5F20\u8F93\u5165\u56FE\uFF0C\u5E76\u4E14\u5FC5\u987B\u4E0E\u8BE5\u56FE\u683C\u5F0F\u548C\u5C3A\u5BF8\u4E00\u81F4\u3002Task \u4E2D\u586B\u5199\u56FE\u7247 URL \u6216 Data URL\uFF1B\u6267\u884C\u65F6\u6309\u539F\u751F image[] \u5B57\u6BB5\u4E0A\u4F20\u6587\u4EF6\uFF0C\u987A\u5E8F\u4E0D\u53D8\u3002",
|
|
3687
3783
|
anyOf: [
|
|
3688
3784
|
{
|
|
3689
3785
|
type: "string",
|
|
@@ -3713,7 +3809,7 @@ var image_generated_default = [
|
|
|
3713
3809
|
pattern: "^(https?://|data:image/)",
|
|
3714
3810
|
minLength: 1,
|
|
3715
3811
|
title: "\u7F16\u8F91\u8499\u7248",
|
|
3716
|
-
description: "\u53EF\u9009\u7684\u4E00\u5F20
|
|
3812
|
+
description: "\u53EF\u9009\u7684\u4E00\u5F20\u8499\u7248\uFF0C\u9700\u540C\u65F6\u63D0\u4F9B\u8F93\u5165\u56FE\u7247\uFF1B\u6587\u4EF6\u5C0F\u4E8E 50 MB\uFF0C\u5FC5\u987B\u5305\u542B Alpha \u901A\u9053\uFF0C\u5E76\u4E0E\u7B2C\u4E00\u5F20\u8F93\u5165\u56FE\u683C\u5F0F\u3001\u5C3A\u5BF8\u4E00\u81F4\u3002\u591A\u56FE\u7F16\u8F91\u65F6\u4EC5\u5E94\u7528\u4E8E\u7B2C\u4E00\u5F20\u56FE\u3002Task \u4E2D\u586B\u5199 URL \u6216 Data URL\uFF0C\u6267\u884C\u65F6\u4E0A\u4F20\u4E3A mask \u6587\u4EF6\u3002",
|
|
3717
3813
|
"x-ui": {
|
|
3718
3814
|
order: 3
|
|
3719
3815
|
}
|
|
@@ -3740,7 +3836,8 @@ var image_generated_default = [
|
|
|
3740
3836
|
minimum: 1,
|
|
3741
3837
|
maximum: 10,
|
|
3742
3838
|
"x-ui": {
|
|
3743
|
-
order: 5
|
|
3839
|
+
order: 5,
|
|
3840
|
+
control: "range"
|
|
3744
3841
|
}
|
|
3745
3842
|
},
|
|
3746
3843
|
quality: {
|
|
@@ -3759,7 +3856,8 @@ var image_generated_default = [
|
|
|
3759
3856
|
low: "\u4F4E",
|
|
3760
3857
|
medium: "\u4E2D",
|
|
3761
3858
|
high: "\u9AD8"
|
|
3762
|
-
}
|
|
3859
|
+
},
|
|
3860
|
+
control: "segmented"
|
|
3763
3861
|
}
|
|
3764
3862
|
},
|
|
3765
3863
|
output_format: {
|
|
@@ -3767,15 +3865,18 @@ var image_generated_default = [
|
|
|
3767
3865
|
description: "\u8F93\u51FA\u56FE\u7247\u7684\u7F16\u7801\u683C\u5F0F\u3002",
|
|
3768
3866
|
enum: [
|
|
3769
3867
|
"png",
|
|
3770
|
-
"jpeg"
|
|
3868
|
+
"jpeg",
|
|
3869
|
+
"webp"
|
|
3771
3870
|
],
|
|
3772
3871
|
title: "\u56FE\u7247\u683C\u5F0F",
|
|
3773
3872
|
"x-ui": {
|
|
3774
3873
|
order: 7,
|
|
3775
3874
|
optionLabels: {
|
|
3776
3875
|
png: "PNG",
|
|
3777
|
-
jpeg: "JPEG"
|
|
3778
|
-
|
|
3876
|
+
jpeg: "JPEG",
|
|
3877
|
+
webp: "WebP"
|
|
3878
|
+
},
|
|
3879
|
+
control: "segmented"
|
|
3779
3880
|
}
|
|
3780
3881
|
},
|
|
3781
3882
|
output_compression: {
|
|
@@ -3783,9 +3884,11 @@ var image_generated_default = [
|
|
|
3783
3884
|
minimum: 0,
|
|
3784
3885
|
maximum: 100,
|
|
3785
3886
|
multipleOf: 1,
|
|
3786
|
-
description: "JPEG \u538B\u7F29\u8D28\u91CF\uFF0C0\uFF5E100\uFF1B\u4EC5\u5728 output_format \u4E3A jpeg \u65F6\u4F7F\u7528\u3002",
|
|
3887
|
+
description: "JPEG \u6216 WebP \u538B\u7F29\u8D28\u91CF\uFF0C0\uFF5E100\uFF1B\u4EC5\u5728 output_format \u4E3A jpeg \u6216 webp \u65F6\u4F7F\u7528\u3002",
|
|
3787
3888
|
"x-ui": {
|
|
3788
|
-
order: 8
|
|
3889
|
+
order: 8,
|
|
3890
|
+
control: "range",
|
|
3891
|
+
unit: "%"
|
|
3789
3892
|
},
|
|
3790
3893
|
title: "\u538B\u7F29\u8D28\u91CF"
|
|
3791
3894
|
},
|
|
@@ -3796,14 +3899,15 @@ var image_generated_default = [
|
|
|
3796
3899
|
"opaque",
|
|
3797
3900
|
"transparent"
|
|
3798
3901
|
],
|
|
3799
|
-
description: "\u53EF\u9009\u62E9\u81EA\u52A8\u3001\u4E0D\u900F\u660E\u6216\u900F\u660E\u80CC\u666F\uFF1B\u900F\u660E\u80CC\u666F\u4E3A\u4E0A\u6E38\u9884\u89C8\u80FD\u529B\uFF0C\u9700\u4F7F\u7528 PNG\u3002",
|
|
3902
|
+
description: "\u53EF\u9009\u62E9\u81EA\u52A8\u3001\u4E0D\u900F\u660E\u6216\u900F\u660E\u80CC\u666F\uFF1B\u900F\u660E\u80CC\u666F\u4E3A\u4E0A\u6E38\u9884\u89C8\u80FD\u529B\uFF0C\u9700\u4F7F\u7528 PNG \u6216 WebP\u3002",
|
|
3800
3903
|
"x-ui": {
|
|
3801
3904
|
order: 9,
|
|
3802
3905
|
optionLabels: {
|
|
3803
3906
|
auto: "\u81EA\u52A8",
|
|
3804
3907
|
opaque: "\u4E0D\u900F\u660E",
|
|
3805
3908
|
transparent: "\u900F\u660E"
|
|
3806
|
-
}
|
|
3909
|
+
},
|
|
3910
|
+
control: "segmented"
|
|
3807
3911
|
},
|
|
3808
3912
|
title: "\u80CC\u666F"
|
|
3809
3913
|
},
|
|
@@ -3819,7 +3923,8 @@ var image_generated_default = [
|
|
|
3819
3923
|
optionLabels: {
|
|
3820
3924
|
auto: "\u81EA\u52A8",
|
|
3821
3925
|
low: "\u4F4E"
|
|
3822
|
-
}
|
|
3926
|
+
},
|
|
3927
|
+
control: "segmented"
|
|
3823
3928
|
},
|
|
3824
3929
|
title: "\u5185\u5BB9\u5BA1\u6838"
|
|
3825
3930
|
},
|
|
@@ -3828,7 +3933,8 @@ var image_generated_default = [
|
|
|
3828
3933
|
title: "\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6",
|
|
3829
3934
|
description: "\u4F20\u7ED9\u4E0A\u6E38\u7684\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6\uFF0C\u7528\u4E8E\u6EE5\u7528\u76D1\u6D4B\u3002",
|
|
3830
3935
|
"x-ui": {
|
|
3831
|
-
order:
|
|
3936
|
+
order: 99,
|
|
3937
|
+
hidden: true
|
|
3832
3938
|
}
|
|
3833
3939
|
}
|
|
3834
3940
|
},
|
|
@@ -3873,7 +3979,10 @@ var image_generated_default = [
|
|
|
3873
3979
|
],
|
|
3874
3980
|
properties: {
|
|
3875
3981
|
output_format: {
|
|
3876
|
-
|
|
3982
|
+
enum: [
|
|
3983
|
+
"jpeg",
|
|
3984
|
+
"webp"
|
|
3985
|
+
]
|
|
3877
3986
|
}
|
|
3878
3987
|
}
|
|
3879
3988
|
}
|
|
@@ -3892,7 +4001,10 @@ var image_generated_default = [
|
|
|
3892
4001
|
then: {
|
|
3893
4002
|
properties: {
|
|
3894
4003
|
output_format: {
|
|
3895
|
-
|
|
4004
|
+
enum: [
|
|
4005
|
+
"png",
|
|
4006
|
+
"webp"
|
|
4007
|
+
]
|
|
3896
4008
|
}
|
|
3897
4009
|
}
|
|
3898
4010
|
}
|
|
@@ -5498,7 +5610,8 @@ var image_generated_default = [
|
|
|
5498
5610
|
title: "\u6A21\u578B ID",
|
|
5499
5611
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
5500
5612
|
"x-ui": {
|
|
5501
|
-
order:
|
|
5613
|
+
order: -1,
|
|
5614
|
+
hidden: true
|
|
5502
5615
|
},
|
|
5503
5616
|
const: "xai/grok-imagine-image-quality",
|
|
5504
5617
|
examples: [
|
|
@@ -5738,7 +5851,25 @@ var image_generated_default = [
|
|
|
5738
5851
|
],
|
|
5739
5852
|
"x-ui": {
|
|
5740
5853
|
order: 4,
|
|
5741
|
-
control: "select"
|
|
5854
|
+
control: "select",
|
|
5855
|
+
optionLabels: {
|
|
5856
|
+
auto: "\u81EA\u52A8",
|
|
5857
|
+
"1:1": "1:1",
|
|
5858
|
+
"16:9": "16:9",
|
|
5859
|
+
"9:16": "9:16",
|
|
5860
|
+
"4:3": "4:3",
|
|
5861
|
+
"3:4": "3:4",
|
|
5862
|
+
"3:2": "3:2",
|
|
5863
|
+
"2:3": "2:3",
|
|
5864
|
+
"2:1": "2:1",
|
|
5865
|
+
"1:2": "1:2",
|
|
5866
|
+
"19.5:9": "19.5:9",
|
|
5867
|
+
"9:19.5": "9:19.5",
|
|
5868
|
+
"20:9": "20:9",
|
|
5869
|
+
"9:20": "9:20",
|
|
5870
|
+
"21:9": "21:9",
|
|
5871
|
+
"5:2": "5:2"
|
|
5872
|
+
}
|
|
5742
5873
|
},
|
|
5743
5874
|
title: "\u753B\u9762\u6BD4\u4F8B"
|
|
5744
5875
|
},
|
|
@@ -5751,7 +5882,11 @@ var image_generated_default = [
|
|
|
5751
5882
|
title: "\u8F93\u51FA\u5206\u8FA8\u7387",
|
|
5752
5883
|
"x-ui": {
|
|
5753
5884
|
order: 5,
|
|
5754
|
-
control: "
|
|
5885
|
+
control: "segmented",
|
|
5886
|
+
optionLabels: {
|
|
5887
|
+
"1k": "1K",
|
|
5888
|
+
"2k": "2K"
|
|
5889
|
+
}
|
|
5755
5890
|
}
|
|
5756
5891
|
},
|
|
5757
5892
|
n: {
|
|
@@ -5764,7 +5899,7 @@ var image_generated_default = [
|
|
|
5764
5899
|
title: "\u8F93\u51FA\u5F20\u6570",
|
|
5765
5900
|
"x-ui": {
|
|
5766
5901
|
order: 6,
|
|
5767
|
-
control: "
|
|
5902
|
+
control: "range"
|
|
5768
5903
|
}
|
|
5769
5904
|
},
|
|
5770
5905
|
response_format: {
|
|
@@ -5780,13 +5915,14 @@ var image_generated_default = [
|
|
|
5780
5915
|
title: "\u56FE\u7247\u8FD4\u56DE\u683C\u5F0F",
|
|
5781
5916
|
description: "url \u8FD4\u56DE\u56FE\u7247\u5730\u5740\uFF1Bb64_json \u8FD4\u56DE Base64\u3002",
|
|
5782
5917
|
"x-ui": {
|
|
5783
|
-
order:
|
|
5918
|
+
order: 98,
|
|
5784
5919
|
control: "select",
|
|
5785
5920
|
optionLabels: {
|
|
5786
5921
|
url: "\u56FE\u7247 URL",
|
|
5787
5922
|
b64_json: "Base64",
|
|
5788
5923
|
null: "\u4E0A\u6E38\u9ED8\u8BA4"
|
|
5789
|
-
}
|
|
5924
|
+
},
|
|
5925
|
+
hidden: true
|
|
5790
5926
|
}
|
|
5791
5927
|
},
|
|
5792
5928
|
user: {
|
|
@@ -5797,7 +5933,8 @@ var image_generated_default = [
|
|
|
5797
5933
|
title: "\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6",
|
|
5798
5934
|
description: "\u4F20\u7ED9 xAI \u7684\u7EC8\u7AEF\u7528\u6237\u6807\u8BC6\uFF0C\u7528\u4E8E\u6EE5\u7528\u76D1\u6D4B\u3002",
|
|
5799
5935
|
"x-ui": {
|
|
5800
|
-
order:
|
|
5936
|
+
order: 99,
|
|
5937
|
+
hidden: true
|
|
5801
5938
|
}
|
|
5802
5939
|
}
|
|
5803
5940
|
},
|
|
@@ -6028,6 +6165,347 @@ var generatedCatalog = Object.freeze([
|
|
|
6028
6165
|
...image_generated_default
|
|
6029
6166
|
]);
|
|
6030
6167
|
|
|
6168
|
+
// src/catalog/media-geometry.ts
|
|
6169
|
+
var RATIO_FIELDS = ["ratio", "aspect_ratio", "aspectRatio"];
|
|
6170
|
+
var QUALITY_FIELDS = ["quality"];
|
|
6171
|
+
var TIER_PATTERN = /^(\d+(?:\.\d+)?)k$/i;
|
|
6172
|
+
var PIXEL_PATTERN = /^([1-9]\d{2,4})[x*]([1-9]\d{2,4})$/i;
|
|
6173
|
+
var QUALITY_LABELS = {
|
|
6174
|
+
auto: "\u81EA\u52A8",
|
|
6175
|
+
low: "\u4F4E",
|
|
6176
|
+
medium: "\u4E2D\u7B49",
|
|
6177
|
+
high: "\u9AD8",
|
|
6178
|
+
xhigh: "\u66F4\u9AD8",
|
|
6179
|
+
max: "\u6700\u9AD8",
|
|
6180
|
+
"1": "\u4F4E",
|
|
6181
|
+
"2": "\u4E2D\u7B49",
|
|
6182
|
+
"4": "\u9AD8"
|
|
6183
|
+
};
|
|
6184
|
+
var UNIFIED_TO_NUMERIC_QUALITY = {
|
|
6185
|
+
low: "1",
|
|
6186
|
+
medium: "2",
|
|
6187
|
+
high: "4"
|
|
6188
|
+
};
|
|
6189
|
+
var PIXEL_SIZE_BY_RATIO = {
|
|
6190
|
+
"1K": { "1:1": "1024x1024", "16:9": "1792x1008", "9:16": "1008x1792", "4:3": "1344x1008", "3:4": "1008x1344", "3:2": "1536x1024", "2:3": "1024x1536", "21:9": "2016x864", "9:21": "864x2016" },
|
|
6191
|
+
"2K": { "1:1": "2048x2048", "16:9": "2560x1440", "9:16": "1440x2560", "4:3": "2048x1536", "3:4": "1536x2048", "3:2": "2016x1344", "2:3": "1344x2016", "21:9": "2352x1008", "9:21": "1008x2352" },
|
|
6192
|
+
"4K": { "1:1": "2880x2880", "16:9": "3840x2160", "9:16": "2160x3840", "4:3": "3264x2448", "3:4": "2448x3264", "3:2": "3504x2336", "2:3": "2336x3504", "21:9": "3808x1632", "9:21": "1632x3808" }
|
|
6193
|
+
};
|
|
6194
|
+
var LITE_TIER_SIZE_BY_RATIO = {
|
|
6195
|
+
"1K": { "1:1": "1K", "4:3": "1152x864", "3:4": "864x1152", "16:9": "1424x800", "9:16": "800x1424", "3:2": "1248x832", "2:3": "832x1248", "21:9": "1568x672" },
|
|
6196
|
+
"2K": { "1:1": "2K", "4:3": "2304x1728", "3:4": "1728x2304", "16:9": "2848x1600", "9:16": "1600x2848", "3:2": "2496x1664", "2:3": "1664x2496", "21:9": "3136x1344" },
|
|
6197
|
+
"3K": { "1:1": "3K", "4:3": "3456x2592", "3:4": "2592x3456", "16:9": "4096x2304", "9:16": "2304x4096", "3:2": "3744x2496", "2:3": "2496x3744", "21:9": "4704x2016" },
|
|
6198
|
+
"4K": { "1:1": "4K", "4:3": "4704x3520", "3:4": "3520x4704", "16:9": "5504x3040", "9:16": "3040x5504", "3:2": "4992x3328", "2:3": "3328x4992", "21:9": "6240x2656" }
|
|
6199
|
+
};
|
|
6200
|
+
var PRO_TIER_SIZE_BY_RATIO = {
|
|
6201
|
+
"1K": { "1:1": "1K", "4:3": "1152x864", "3:4": "864x1152", "16:9": "1424x800", "9:16": "800x1424", "3:2": "1248x832", "2:3": "832x1248", "21:9": "1568x672" },
|
|
6202
|
+
"1.5K": { "1:1": "1.5K", "4:3": "1792x1344", "3:4": "1344x1792", "16:9": "2048x1152", "9:16": "1152x2048", "3:2": "1872x1248", "2:3": "1248x1872", "21:9": "2352x1008" },
|
|
6203
|
+
"2K": { "1:1": "2K", "4:3": "2368x1776", "3:4": "1776x2368", "16:9": "2816x1584", "9:16": "1584x2816", "3:2": "2496x1664", "2:3": "1664x2496", "21:9": "3136x1344" }
|
|
6204
|
+
};
|
|
6205
|
+
function isObject(value) {
|
|
6206
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
6207
|
+
}
|
|
6208
|
+
function propertiesOf(schema) {
|
|
6209
|
+
if (!isObject(schema)) return {};
|
|
6210
|
+
return isObject(schema.properties) ? schema.properties : {};
|
|
6211
|
+
}
|
|
6212
|
+
function stringList(value) {
|
|
6213
|
+
if (!Array.isArray(value)) return [];
|
|
6214
|
+
return value.filter((item) => typeof item === "string" && item.length > 0);
|
|
6215
|
+
}
|
|
6216
|
+
function stringOptions(property) {
|
|
6217
|
+
const fromEnum = stringList(property.enum);
|
|
6218
|
+
if (fromEnum.length) return fromEnum;
|
|
6219
|
+
return stringList(property.examples);
|
|
6220
|
+
}
|
|
6221
|
+
function optionLabelsOf(property, options, fallback) {
|
|
6222
|
+
const ui = isObject(property["x-ui"]) ? property["x-ui"] : {};
|
|
6223
|
+
const fromSchema = isObject(ui.optionLabels) ? ui.optionLabels : {};
|
|
6224
|
+
const labels = {};
|
|
6225
|
+
for (const option of options) {
|
|
6226
|
+
const schemaLabel = fromSchema[option];
|
|
6227
|
+
labels[option] = typeof schemaLabel === "string" && schemaLabel ? schemaLabel : fallback[option] ?? option;
|
|
6228
|
+
}
|
|
6229
|
+
return labels;
|
|
6230
|
+
}
|
|
6231
|
+
function defaultOf(property, options) {
|
|
6232
|
+
return typeof property.default === "string" && property.default ? property.default : options[0];
|
|
6233
|
+
}
|
|
6234
|
+
function displayTier(value) {
|
|
6235
|
+
const matched = TIER_PATTERN.exec(value.trim());
|
|
6236
|
+
return matched ? `${matched[1]}K` : value.trim();
|
|
6237
|
+
}
|
|
6238
|
+
function sizeSeparator(property) {
|
|
6239
|
+
const pattern = typeof property.pattern === "string" ? property.pattern : "";
|
|
6240
|
+
if (pattern.includes("\\*") || pattern.includes("*")) return "*";
|
|
6241
|
+
return "x";
|
|
6242
|
+
}
|
|
6243
|
+
function collectTiers(property) {
|
|
6244
|
+
const fromText = [...stringOptions(property), typeof property.pattern === "string" ? property.pattern : ""].flatMap((text) => text.match(/\d+(?:\.\d+)?[kK]/g) ?? []);
|
|
6245
|
+
const unique = [...new Set(fromText.map(displayTier))];
|
|
6246
|
+
return unique;
|
|
6247
|
+
}
|
|
6248
|
+
function locate(root, names) {
|
|
6249
|
+
const nested = propertiesOf(root.parameters);
|
|
6250
|
+
for (const field of names) {
|
|
6251
|
+
if (isObject(root[field])) return { field, property: root[field] };
|
|
6252
|
+
}
|
|
6253
|
+
for (const field of names) {
|
|
6254
|
+
if (isObject(nested[field])) return { field, nest: "parameters", property: nested[field] };
|
|
6255
|
+
}
|
|
6256
|
+
return void 0;
|
|
6257
|
+
}
|
|
6258
|
+
function inspect(schema) {
|
|
6259
|
+
const root = propertiesOf(schema);
|
|
6260
|
+
const size = locate(root, ["size"]);
|
|
6261
|
+
const ratio = locate(root, RATIO_FIELDS);
|
|
6262
|
+
const resolution = locate(root, ["resolution"]);
|
|
6263
|
+
const quality = locate(root, QUALITY_FIELDS);
|
|
6264
|
+
if (resolution && ratio) return { kind: "resolution-ratio", size, ratio, resolution, quality };
|
|
6265
|
+
if (ratio && !size) return { kind: "ratio-only", size, ratio, resolution, quality };
|
|
6266
|
+
if (size) {
|
|
6267
|
+
const tiers = collectTiers(size.property);
|
|
6268
|
+
const kind = tiers.length > 0 ? "tier-size" : "pixel-size";
|
|
6269
|
+
return { kind, size, ratio, resolution, quality };
|
|
6270
|
+
}
|
|
6271
|
+
return { kind: "none", size, ratio, resolution, quality };
|
|
6272
|
+
}
|
|
6273
|
+
function identityLabels(options) {
|
|
6274
|
+
return Object.fromEntries(options.map((option) => [option, option]));
|
|
6275
|
+
}
|
|
6276
|
+
function pixelDimensions(size) {
|
|
6277
|
+
const matched = PIXEL_PATTERN.exec(size.replaceAll("*", "x"));
|
|
6278
|
+
return matched ? [Number(matched[1]), Number(matched[2])] : void 0;
|
|
6279
|
+
}
|
|
6280
|
+
function maxExampleEdge(property) {
|
|
6281
|
+
const edges = stringList(property.examples).flatMap((example) => pixelDimensions(example) ?? []);
|
|
6282
|
+
return edges.length ? Math.max(...edges) : void 0;
|
|
6283
|
+
}
|
|
6284
|
+
function matchesSize(property, mapped) {
|
|
6285
|
+
const size = rewriteSeparator(mapped, sizeSeparator(property));
|
|
6286
|
+
const pattern = typeof property.pattern === "string" ? property.pattern : "";
|
|
6287
|
+
if (pattern) {
|
|
6288
|
+
try {
|
|
6289
|
+
if (!new RegExp(pattern).test(size)) return false;
|
|
6290
|
+
} catch {
|
|
6291
|
+
return false;
|
|
6292
|
+
}
|
|
6293
|
+
}
|
|
6294
|
+
const dims = pixelDimensions(size);
|
|
6295
|
+
const exampleMax = maxExampleEdge(property);
|
|
6296
|
+
const kTiers = collectTiers(property);
|
|
6297
|
+
if (kTiers.length === 0 && dims && exampleMax !== void 0 && exampleMax <= 2048 && Math.max(dims[0], dims[1]) > 2048) return false;
|
|
6298
|
+
return true;
|
|
6299
|
+
}
|
|
6300
|
+
function filterTable(table, property, allowedTiers) {
|
|
6301
|
+
const filtered = {};
|
|
6302
|
+
for (const [resolution, ratios] of Object.entries(table)) {
|
|
6303
|
+
if (allowedTiers && !allowedTiers.includes(resolution)) continue;
|
|
6304
|
+
const kept = {};
|
|
6305
|
+
for (const [ratio, mapped] of Object.entries(ratios)) {
|
|
6306
|
+
if (matchesSize(property, mapped)) kept[ratio] = mapped;
|
|
6307
|
+
}
|
|
6308
|
+
if (Object.keys(kept).length > 0) filtered[resolution] = kept;
|
|
6309
|
+
}
|
|
6310
|
+
return filtered;
|
|
6311
|
+
}
|
|
6312
|
+
function tableFor(kind, size) {
|
|
6313
|
+
if (!size) return void 0;
|
|
6314
|
+
if (kind === "pixel-size") {
|
|
6315
|
+
const source = sizeSeparator(size.property) === "*" ? { "1K": PIXEL_SIZE_BY_RATIO["1K"] } : PIXEL_SIZE_BY_RATIO;
|
|
6316
|
+
return filterTable(source, size.property);
|
|
6317
|
+
}
|
|
6318
|
+
if (kind === "tier-size") {
|
|
6319
|
+
const tiers = collectTiers(size.property);
|
|
6320
|
+
const source = tiers.includes("1.5K") ? PRO_TIER_SIZE_BY_RATIO : LITE_TIER_SIZE_BY_RATIO;
|
|
6321
|
+
return filterTable(source, size.property, tiers);
|
|
6322
|
+
}
|
|
6323
|
+
return void 0;
|
|
6324
|
+
}
|
|
6325
|
+
function rewriteSeparator(size, separator) {
|
|
6326
|
+
return separator === "*" ? size.replaceAll("x", "*") : size.replaceAll("*", "x");
|
|
6327
|
+
}
|
|
6328
|
+
function matchOption(property, value, label) {
|
|
6329
|
+
const options = stringOptions(property);
|
|
6330
|
+
if (options.length === 0) return value;
|
|
6331
|
+
const exact = options.find((option) => option === value);
|
|
6332
|
+
if (exact) return exact;
|
|
6333
|
+
const ignoredCase = options.find((option) => option.toLowerCase() === value.toLowerCase());
|
|
6334
|
+
if (ignoredCase) return ignoredCase;
|
|
6335
|
+
throw new Error(`Nexra catalog has no ${label} option ${value}`);
|
|
6336
|
+
}
|
|
6337
|
+
function fieldView(located, options, fallbackLabels) {
|
|
6338
|
+
return {
|
|
6339
|
+
field: located.field,
|
|
6340
|
+
...located.nest ? { nest: located.nest } : {},
|
|
6341
|
+
options,
|
|
6342
|
+
default: defaultOf(located.property, options),
|
|
6343
|
+
optionLabels: optionLabelsOf(located.property, options, fallbackLabels)
|
|
6344
|
+
};
|
|
6345
|
+
}
|
|
6346
|
+
function ratioView(located, options) {
|
|
6347
|
+
const view = fieldView(located, options, identityLabels(options));
|
|
6348
|
+
return { ...view, optionLabels: identityLabels(options) };
|
|
6349
|
+
}
|
|
6350
|
+
function writeField(output, located, value) {
|
|
6351
|
+
if (!located.nest) {
|
|
6352
|
+
output[located.field] = value;
|
|
6353
|
+
return;
|
|
6354
|
+
}
|
|
6355
|
+
const current = output[located.nest];
|
|
6356
|
+
const nested = isObject(current) ? { ...current } : {};
|
|
6357
|
+
nested[located.field] = value;
|
|
6358
|
+
output[located.nest] = nested;
|
|
6359
|
+
}
|
|
6360
|
+
function readField(input, located) {
|
|
6361
|
+
if (!located.nest) {
|
|
6362
|
+
const value2 = input[located.field];
|
|
6363
|
+
return typeof value2 === "string" ? value2 : void 0;
|
|
6364
|
+
}
|
|
6365
|
+
const nested = input[located.nest];
|
|
6366
|
+
if (!isObject(nested)) return void 0;
|
|
6367
|
+
const value = nested[located.field];
|
|
6368
|
+
return typeof value === "string" ? value : void 0;
|
|
6369
|
+
}
|
|
6370
|
+
function reverseLookup(table, size) {
|
|
6371
|
+
const normalized = size.replaceAll("*", "x");
|
|
6372
|
+
if (TIER_PATTERN.test(normalized)) return { resolution: displayTier(normalized), ratio: "1:1" };
|
|
6373
|
+
for (const [resolution, ratios] of Object.entries(table)) {
|
|
6374
|
+
for (const [ratio, mapped] of Object.entries(ratios)) {
|
|
6375
|
+
if (mapped.replaceAll("*", "x") === normalized) return { resolution, ratio };
|
|
6376
|
+
}
|
|
6377
|
+
}
|
|
6378
|
+
return void 0;
|
|
6379
|
+
}
|
|
6380
|
+
function projectMediaGeometry(inputSchema) {
|
|
6381
|
+
const inspected = inspect(inputSchema);
|
|
6382
|
+
const table = tableFor(inspected.kind, inspected.size);
|
|
6383
|
+
const quality = inspected.quality ? fieldView(inspected.quality, stringOptions(inspected.quality.property), QUALITY_LABELS) : void 0;
|
|
6384
|
+
if (inspected.kind === "resolution-ratio" && inspected.resolution && inspected.ratio) {
|
|
6385
|
+
const resolutionOptions = stringOptions(inspected.resolution.property).map(displayTier);
|
|
6386
|
+
const ratioOptions = stringOptions(inspected.ratio.property);
|
|
6387
|
+
return {
|
|
6388
|
+
kind: inspected.kind,
|
|
6389
|
+
resolution: fieldView(inspected.resolution, resolutionOptions, identityLabels(resolutionOptions)),
|
|
6390
|
+
ratio: ratioView(inspected.ratio, ratioOptions),
|
|
6391
|
+
...quality ? { quality } : {}
|
|
6392
|
+
};
|
|
6393
|
+
}
|
|
6394
|
+
if (inspected.kind === "ratio-only" && inspected.ratio) {
|
|
6395
|
+
const ratioOptions = stringOptions(inspected.ratio.property);
|
|
6396
|
+
return { kind: inspected.kind, ratio: ratioView(inspected.ratio, ratioOptions), ...quality ? { quality } : {} };
|
|
6397
|
+
}
|
|
6398
|
+
if ((inspected.kind === "pixel-size" || inspected.kind === "tier-size") && inspected.size && table) {
|
|
6399
|
+
const resolutionOptions = Object.keys(table);
|
|
6400
|
+
const ratioOptions = [...new Set(Object.values(table).flatMap((ratios) => Object.keys(ratios)))];
|
|
6401
|
+
return {
|
|
6402
|
+
kind: inspected.kind,
|
|
6403
|
+
resolution: {
|
|
6404
|
+
field: "resolution",
|
|
6405
|
+
options: resolutionOptions,
|
|
6406
|
+
default: resolutionOptions.includes("2K") ? "2K" : resolutionOptions[0],
|
|
6407
|
+
optionLabels: identityLabels(resolutionOptions)
|
|
6408
|
+
},
|
|
6409
|
+
ratio: {
|
|
6410
|
+
field: "ratio",
|
|
6411
|
+
options: ratioOptions,
|
|
6412
|
+
default: ratioOptions.includes("1:1") ? "1:1" : ratioOptions[0],
|
|
6413
|
+
optionLabels: identityLabels(ratioOptions)
|
|
6414
|
+
},
|
|
6415
|
+
...quality ? { quality } : {}
|
|
6416
|
+
};
|
|
6417
|
+
}
|
|
6418
|
+
return { kind: "none", ...quality ? { quality } : {} };
|
|
6419
|
+
}
|
|
6420
|
+
function encodeMediaGeometry(inputSchema, geometry) {
|
|
6421
|
+
const inspected = inspect(inputSchema);
|
|
6422
|
+
const output = {};
|
|
6423
|
+
const resolution = geometry.resolution?.trim();
|
|
6424
|
+
const ratio = geometry.ratio?.trim();
|
|
6425
|
+
const quality = geometry.quality?.trim();
|
|
6426
|
+
if (inspected.kind === "resolution-ratio" && inspected.resolution && inspected.ratio) {
|
|
6427
|
+
if (resolution) writeField(output, inspected.resolution, matchOption(inspected.resolution.property, resolution, "resolution"));
|
|
6428
|
+
if (ratio) writeField(output, inspected.ratio, matchOption(inspected.ratio.property, ratio, "ratio"));
|
|
6429
|
+
} else if (inspected.kind === "ratio-only" && inspected.ratio && ratio) {
|
|
6430
|
+
writeField(output, inspected.ratio, matchOption(inspected.ratio.property, ratio, "ratio"));
|
|
6431
|
+
} else if ((inspected.kind === "pixel-size" || inspected.kind === "tier-size") && inspected.size && resolution && ratio) {
|
|
6432
|
+
const table = tableFor(inspected.kind, inspected.size);
|
|
6433
|
+
const mapped = table?.[displayTier(resolution)]?.[ratio];
|
|
6434
|
+
if (!mapped) throw new Error(`Nexra catalog has no size for ${ratio} ${displayTier(resolution)}`);
|
|
6435
|
+
writeField(output, inspected.size, rewriteSeparator(mapped, sizeSeparator(inspected.size.property)));
|
|
6436
|
+
}
|
|
6437
|
+
if (quality && inspected.quality) {
|
|
6438
|
+
const options = stringOptions(inspected.quality.property);
|
|
6439
|
+
const numeric = UNIFIED_TO_NUMERIC_QUALITY[quality];
|
|
6440
|
+
const candidate = numeric && options.includes(numeric) ? numeric : quality;
|
|
6441
|
+
writeField(output, inspected.quality, matchOption(inspected.quality.property, candidate, "quality"));
|
|
6442
|
+
}
|
|
6443
|
+
return output;
|
|
6444
|
+
}
|
|
6445
|
+
function decodeMediaGeometry(inputSchema, nativeInput) {
|
|
6446
|
+
const inspected = inspect(inputSchema);
|
|
6447
|
+
const quality = inspected.quality ? readField(nativeInput, inspected.quality) : void 0;
|
|
6448
|
+
const decodedQuality = quality && UNIFIED_TO_NUMERIC_QUALITY.low && quality === "1" ? "low" : quality === "2" ? "medium" : quality === "4" ? "high" : quality;
|
|
6449
|
+
if (inspected.kind === "resolution-ratio" && inspected.resolution && inspected.ratio) {
|
|
6450
|
+
const resolution = readField(nativeInput, inspected.resolution);
|
|
6451
|
+
const ratio = readField(nativeInput, inspected.ratio);
|
|
6452
|
+
return {
|
|
6453
|
+
...resolution ? { resolution: displayTier(resolution) } : {},
|
|
6454
|
+
...ratio && ratio !== "auto" ? { ratio } : {},
|
|
6455
|
+
...decodedQuality ? { quality: decodedQuality } : {}
|
|
6456
|
+
};
|
|
6457
|
+
}
|
|
6458
|
+
if (inspected.kind === "ratio-only" && inspected.ratio) {
|
|
6459
|
+
const ratio = readField(nativeInput, inspected.ratio);
|
|
6460
|
+
return { ...ratio ? { ratio } : {}, ...decodedQuality ? { quality: decodedQuality } : {} };
|
|
6461
|
+
}
|
|
6462
|
+
if ((inspected.kind === "pixel-size" || inspected.kind === "tier-size") && inspected.size) {
|
|
6463
|
+
const size = readField(nativeInput, inspected.size);
|
|
6464
|
+
const table = tableFor(inspected.kind, inspected.size);
|
|
6465
|
+
const mapped = size && table ? reverseLookup(table, size) : void 0;
|
|
6466
|
+
return { ...mapped, ...decodedQuality ? { quality: decodedQuality } : {} };
|
|
6467
|
+
}
|
|
6468
|
+
return decodedQuality ? { quality: decodedQuality } : {};
|
|
6469
|
+
}
|
|
6470
|
+
function unifiedFromInput(input) {
|
|
6471
|
+
return {
|
|
6472
|
+
...typeof input.resolution === "string" ? { resolution: input.resolution } : {},
|
|
6473
|
+
...typeof input.ratio === "string" ? { ratio: input.ratio } : typeof input.aspectRatio === "string" ? { ratio: input.aspectRatio } : typeof input.aspect_ratio === "string" ? { ratio: input.aspect_ratio } : {},
|
|
6474
|
+
...typeof input.quality === "string" ? { quality: input.quality } : {}
|
|
6475
|
+
};
|
|
6476
|
+
}
|
|
6477
|
+
function applyMediaGeometry(inputSchema, input) {
|
|
6478
|
+
const inspected = inspect(inputSchema);
|
|
6479
|
+
const next = { ...input };
|
|
6480
|
+
if (inspected.size?.nest === "parameters" && isObject(input.parameters)) {
|
|
6481
|
+
next.parameters = { ...input.parameters };
|
|
6482
|
+
}
|
|
6483
|
+
const nativeSize = inspected.size ? readField(next, inspected.size) : void 0;
|
|
6484
|
+
const unified = unifiedFromInput(next);
|
|
6485
|
+
const shouldEncode = Boolean(
|
|
6486
|
+
(unified.resolution || unified.ratio || unified.quality) && !nativeSize
|
|
6487
|
+
);
|
|
6488
|
+
if (!shouldEncode) return next;
|
|
6489
|
+
const encoded = encodeMediaGeometry(inputSchema, unified);
|
|
6490
|
+
if (isObject(encoded.parameters) && isObject(next.parameters)) {
|
|
6491
|
+
next.parameters = { ...next.parameters, ...encoded.parameters };
|
|
6492
|
+
} else {
|
|
6493
|
+
Object.assign(next, encoded);
|
|
6494
|
+
}
|
|
6495
|
+
const ratioField = inspected.ratio?.field;
|
|
6496
|
+
if (inspected.kind === "pixel-size" || inspected.kind === "tier-size") {
|
|
6497
|
+
delete next.resolution;
|
|
6498
|
+
delete next.ratio;
|
|
6499
|
+
delete next.aspectRatio;
|
|
6500
|
+
delete next.aspect_ratio;
|
|
6501
|
+
} else {
|
|
6502
|
+
if (ratioField !== "ratio") delete next.ratio;
|
|
6503
|
+
if (ratioField !== "aspectRatio") delete next.aspectRatio;
|
|
6504
|
+
if (ratioField !== "aspect_ratio") delete next.aspect_ratio;
|
|
6505
|
+
}
|
|
6506
|
+
return next;
|
|
6507
|
+
}
|
|
6508
|
+
|
|
6031
6509
|
// src/errors.ts
|
|
6032
6510
|
var NexraApiError = class extends Error {
|
|
6033
6511
|
status;
|
|
@@ -6065,7 +6543,7 @@ var NexraWaitTimeoutError = class extends Error {
|
|
|
6065
6543
|
};
|
|
6066
6544
|
|
|
6067
6545
|
// src/generated/version.generated.ts
|
|
6068
|
-
var SDK_VERSION = "0.1.0-alpha.
|
|
6546
|
+
var SDK_VERSION = "0.1.0-alpha.5";
|
|
6069
6547
|
|
|
6070
6548
|
// src/transport.ts
|
|
6071
6549
|
var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
|
|
@@ -6202,9 +6680,12 @@ var CatalogClient = class {
|
|
|
6202
6680
|
}
|
|
6203
6681
|
transport;
|
|
6204
6682
|
quote(request, signal) {
|
|
6683
|
+
const spec = getModelSpec(request.modelId);
|
|
6684
|
+
const schema = spec?.operations.find((operation) => operation.operation === request.operation)?.inputSchema ?? spec?.operations[0]?.inputSchema;
|
|
6685
|
+
const input = schema ? applyMediaGeometry(schema, request.input) : request.input;
|
|
6205
6686
|
return this.transport.json(
|
|
6206
6687
|
"/catalog/quotes",
|
|
6207
|
-
{ method: "POST", ...jsonBody(request), signal },
|
|
6688
|
+
{ method: "POST", ...jsonBody({ ...request, input }), signal },
|
|
6208
6689
|
{ retryable: false }
|
|
6209
6690
|
);
|
|
6210
6691
|
}
|
|
@@ -6233,6 +6714,10 @@ export {
|
|
|
6233
6714
|
jsonBody,
|
|
6234
6715
|
queryString,
|
|
6235
6716
|
sleep,
|
|
6717
|
+
projectMediaGeometry,
|
|
6718
|
+
encodeMediaGeometry,
|
|
6719
|
+
decodeMediaGeometry,
|
|
6720
|
+
applyMediaGeometry,
|
|
6236
6721
|
CatalogClient,
|
|
6237
6722
|
getModelSpec,
|
|
6238
6723
|
listModelSpecs
|