@nodaro/shared 3.56.0 → 3.58.0
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/dist/{chunk-PFXPAWPQ.cjs → chunk-4UUX62S3.cjs} +12 -12
- package/dist/{chunk-PFXPAWPQ.cjs.map → chunk-4UUX62S3.cjs.map} +1 -1
- package/dist/{chunk-CGZLENU4.cjs → chunk-4ZZ6SVIQ.cjs} +90 -6
- package/dist/chunk-4ZZ6SVIQ.cjs.map +1 -0
- package/dist/{chunk-33P5FI2U.cjs → chunk-5PJC4ZWO.cjs} +6 -6
- package/dist/{chunk-33P5FI2U.cjs.map → chunk-5PJC4ZWO.cjs.map} +1 -1
- package/dist/{chunk-TSKYEREJ.cjs → chunk-5UVBFY2G.cjs} +11 -11
- package/dist/{chunk-TSKYEREJ.cjs.map → chunk-5UVBFY2G.cjs.map} +1 -1
- package/dist/{chunk-2AR3OXAA.js → chunk-6CYS7VRH.js} +89 -7
- package/dist/chunk-6CYS7VRH.js.map +1 -0
- package/dist/{chunk-4O5STV7N.js → chunk-6TFWFYYI.js} +3 -3
- package/dist/{chunk-4O5STV7N.js.map → chunk-6TFWFYYI.js.map} +1 -1
- package/dist/{chunk-DURFRWAW.js → chunk-A5ESI2NY.js} +8 -8
- package/dist/{chunk-DURFRWAW.js.map → chunk-A5ESI2NY.js.map} +1 -1
- package/dist/{chunk-62ZQQA7L.js → chunk-BSENM6HM.js} +3 -3
- package/dist/{chunk-62ZQQA7L.js.map → chunk-BSENM6HM.js.map} +1 -1
- package/dist/{chunk-RX7WII6I.js → chunk-CNSRCZYY.js} +5 -5
- package/dist/{chunk-RX7WII6I.js.map → chunk-CNSRCZYY.js.map} +1 -1
- package/dist/{chunk-2J6NTA5I.js → chunk-DC2QPACA.js} +5 -5
- package/dist/chunk-DC2QPACA.js.map +1 -0
- package/dist/{chunk-HWJE4FNS.cjs → chunk-DCP7JFSE.cjs} +5 -5
- package/dist/{chunk-HWJE4FNS.cjs.map → chunk-DCP7JFSE.cjs.map} +1 -1
- package/dist/{chunk-AZDVL7IM.js → chunk-HEUWAIXG.js} +6 -6
- package/dist/chunk-HEUWAIXG.js.map +1 -0
- package/dist/{chunk-JO3XSUO2.cjs → chunk-I7NG2D6X.cjs} +21 -21
- package/dist/{chunk-JO3XSUO2.cjs.map → chunk-I7NG2D6X.cjs.map} +1 -1
- package/dist/{chunk-FCQYMPUQ.cjs → chunk-IKOKRJDI.cjs} +4 -4
- package/dist/{chunk-FCQYMPUQ.cjs.map → chunk-IKOKRJDI.cjs.map} +1 -1
- package/dist/{chunk-ZYITB47P.js → chunk-IQBIH3AE.js} +3 -3
- package/dist/{chunk-ZYITB47P.js.map → chunk-IQBIH3AE.js.map} +1 -1
- package/dist/{chunk-55FQBILM.js → chunk-JUEFRVHZ.js} +4 -4
- package/dist/{chunk-55FQBILM.js.map → chunk-JUEFRVHZ.js.map} +1 -1
- package/dist/{chunk-4ONS6QRT.js → chunk-K6UMB37V.js} +3 -3
- package/dist/{chunk-4ONS6QRT.js.map → chunk-K6UMB37V.js.map} +1 -1
- package/dist/{chunk-IKP4GOWZ.cjs → chunk-KYHDKKUJ.cjs} +8 -8
- package/dist/{chunk-IKP4GOWZ.cjs.map → chunk-KYHDKKUJ.cjs.map} +1 -1
- package/dist/{chunk-7DGJDISO.js → chunk-L26G7B27.js} +3 -3
- package/dist/{chunk-7DGJDISO.js.map → chunk-L26G7B27.js.map} +1 -1
- package/dist/{chunk-JHTYULY2.js → chunk-M7SMSAOU.js} +4 -4
- package/dist/{chunk-JHTYULY2.js.map → chunk-M7SMSAOU.js.map} +1 -1
- package/dist/{chunk-6GGHM33Z.js → chunk-ODTZV3BW.js} +4 -4
- package/dist/{chunk-6GGHM33Z.js.map → chunk-ODTZV3BW.js.map} +1 -1
- package/dist/{chunk-MROKQP4U.js → chunk-OMUYZKRB.js} +3 -3
- package/dist/{chunk-MROKQP4U.js.map → chunk-OMUYZKRB.js.map} +1 -1
- package/dist/{chunk-AKDJKMAL.cjs → chunk-PK4ZR2SK.cjs} +4 -4
- package/dist/{chunk-AKDJKMAL.cjs.map → chunk-PK4ZR2SK.cjs.map} +1 -1
- package/dist/chunk-QCW6J6BQ.cjs +27 -0
- package/dist/chunk-QCW6J6BQ.cjs.map +1 -0
- package/dist/{chunk-ZXDH3L3P.cjs → chunk-QPBBIRLF.cjs} +40 -39
- package/dist/{chunk-ZXDH3L3P.cjs.map → chunk-QPBBIRLF.cjs.map} +1 -1
- package/dist/{chunk-ILMHITHK.cjs → chunk-QVPIO2NU.cjs} +5 -5
- package/dist/{chunk-ILMHITHK.cjs.map → chunk-QVPIO2NU.cjs.map} +1 -1
- package/dist/{chunk-EWARI452.cjs → chunk-S5VBJJUT.cjs} +46 -46
- package/dist/chunk-S5VBJJUT.cjs.map +1 -0
- package/dist/{chunk-ST4WQ6ND.js → chunk-SEQ5L72K.js} +52 -11
- package/dist/chunk-SEQ5L72K.js.map +1 -0
- package/dist/{chunk-EAKO7PGC.js → chunk-VVGSIWNL.js} +5 -4
- package/dist/{chunk-EAKO7PGC.js.map → chunk-VVGSIWNL.js.map} +1 -1
- package/dist/{chunk-O7DXNX5J.cjs → chunk-VZXRDSWA.cjs} +74 -28
- package/dist/chunk-VZXRDSWA.cjs.map +1 -0
- package/dist/{chunk-WKCFTWLO.cjs → chunk-WBERPAXE.cjs} +6 -6
- package/dist/{chunk-WKCFTWLO.cjs.map → chunk-WBERPAXE.cjs.map} +1 -1
- package/dist/{chunk-H7VMJBNZ.cjs → chunk-WLFT5UVV.cjs} +8 -8
- package/dist/{chunk-H7VMJBNZ.cjs.map → chunk-WLFT5UVV.cjs.map} +1 -1
- package/dist/{chunk-4JODLC2N.js → chunk-ZMH56CLL.js} +3 -3
- package/dist/{chunk-4JODLC2N.js.map → chunk-ZMH56CLL.js.map} +1 -1
- package/dist/{chunk-CLKU3ZIU.cjs → chunk-ZX6RRM6R.cjs} +43 -43
- package/dist/{chunk-CLKU3ZIU.cjs.map → chunk-ZX6RRM6R.cjs.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +150 -150
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +7 -7
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/model-catalog.cjs +76 -68
- package/dist/entries/model-catalog.d.cts +2 -2
- package/dist/entries/model-catalog.d.ts +2 -2
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +303 -283
- package/dist/entries/models.d.cts +3 -3
- package/dist/entries/models.d.ts +3 -3
- package/dist/entries/models.js +4 -4
- package/dist/entries/nodes.cjs +206 -206
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +1 -1
- package/dist/entries/pipeline.d.ts +1 -1
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +117 -117
- package/dist/entries/video.js +4 -4
- package/dist/index.cjs +1093 -1065
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -17
- package/dist/{model-catalog-vQ3NWn24.d.cts → model-catalog-CCsA1isC.d.cts} +58 -13
- package/dist/{model-catalog-vQ3NWn24.d.ts → model-catalog-CCsA1isC.d.ts} +58 -13
- package/dist/{model-constants-QZVHZX25.d.ts → model-constants-BtXkUsX3.d.cts} +36 -9
- package/dist/{model-constants-QZVHZX25.d.cts → model-constants-BtXkUsX3.d.ts} +36 -9
- package/package.json +1 -1
- package/src/__tests__/auto-aspect-source.test.ts +93 -0
- package/src/__tests__/gvp-supported-providers.test.ts +2 -0
- package/src/__tests__/normalize-model-input.test.ts +62 -8
- package/src/__tests__/resolutions-by-aspect-ratio.test.ts +134 -0
- package/src/__tests__/seedance-25-catalog-modes.test.ts +35 -0
- package/src/__tests__/video-frame-slot.test.ts +5 -0
- package/src/credit-identifiers.ts +3 -1
- package/src/entries/model-catalog.ts +2 -0
- package/src/entries/models.ts +5 -0
- package/src/model-catalog.ts +161 -20
- package/src/model-constants.ts +79 -7
- package/src/node-default-mappings.ts +1 -0
- package/src/video-ui-defaults.ts +2 -1
- package/dist/chunk-2AR3OXAA.js.map +0 -1
- package/dist/chunk-2J6NTA5I.js.map +0 -1
- package/dist/chunk-AZDVL7IM.js.map +0 -1
- package/dist/chunk-CGZLENU4.cjs.map +0 -1
- package/dist/chunk-EWARI452.cjs.map +0 -1
- package/dist/chunk-O7DXNX5J.cjs.map +0 -1
- package/dist/chunk-ST4WQ6ND.js.map +0 -1
- package/dist/chunk-XPUGMYAJ.cjs +0 -27
- package/dist/chunk-XPUGMYAJ.cjs.map +0 -1
|
@@ -106,6 +106,12 @@ var GPT_IMAGE_2_5_RATIOS = [
|
|
|
106
106
|
"9:8",
|
|
107
107
|
"8:9"
|
|
108
108
|
];
|
|
109
|
+
var GPT_IMAGE_2_5_RESOLUTIONS_BY_RATIO = {
|
|
110
|
+
"27:16": ["1K"],
|
|
111
|
+
"16:27": ["1K"],
|
|
112
|
+
"9:8": ["1K"],
|
|
113
|
+
"8:9": ["1K"]
|
|
114
|
+
};
|
|
109
115
|
var GPT_IMAGE_2_6_RATIOS = [
|
|
110
116
|
"auto",
|
|
111
117
|
"1:1",
|
|
@@ -544,6 +550,7 @@ var IMAGE_MODELS = {
|
|
|
544
550
|
features: ["reference-image"],
|
|
545
551
|
aspectRatios: GPT_IMAGE_2_5_RATIOS,
|
|
546
552
|
resolutions: ["1K", "2K", "4K"],
|
|
553
|
+
resolutionsByAspectRatio: GPT_IMAGE_2_5_RESOLUTIONS_BY_RATIO,
|
|
547
554
|
backgrounds: GPT_IMAGE_BACKGROUNDS,
|
|
548
555
|
transparentResolution: "1K",
|
|
549
556
|
backgroundOnlyAtTransparentResolution: true,
|
|
@@ -575,6 +582,7 @@ var IMAGE_MODELS = {
|
|
|
575
582
|
features: ["reference-image"],
|
|
576
583
|
aspectRatios: GPT_IMAGE_2_5_RATIOS,
|
|
577
584
|
resolutions: ["1K", "2K", "4K"],
|
|
585
|
+
resolutionsByAspectRatio: GPT_IMAGE_2_5_RESOLUTIONS_BY_RATIO,
|
|
578
586
|
backgrounds: GPT_IMAGE_BACKGROUNDS,
|
|
579
587
|
transparentResolution: "1K",
|
|
580
588
|
backgroundOnlyAtTransparentResolution: true,
|
|
@@ -606,6 +614,7 @@ var IMAGE_MODELS = {
|
|
|
606
614
|
features: ["reference-image"],
|
|
607
615
|
aspectRatios: GPT_IMAGE_2_5_RATIOS,
|
|
608
616
|
resolutions: ["1K", "2K", "4K"],
|
|
617
|
+
resolutionsByAspectRatio: GPT_IMAGE_2_5_RESOLUTIONS_BY_RATIO,
|
|
609
618
|
backgrounds: GPT_IMAGE_BACKGROUNDS,
|
|
610
619
|
transparentResolution: "1K",
|
|
611
620
|
backgroundOnlyAtTransparentResolution: true,
|
|
@@ -637,6 +646,7 @@ var IMAGE_MODELS = {
|
|
|
637
646
|
features: ["reference-image"],
|
|
638
647
|
aspectRatios: GPT_IMAGE_2_5_RATIOS,
|
|
639
648
|
resolutions: ["1K", "2K", "4K"],
|
|
649
|
+
resolutionsByAspectRatio: GPT_IMAGE_2_5_RESOLUTIONS_BY_RATIO,
|
|
640
650
|
backgrounds: GPT_IMAGE_BACKGROUNDS,
|
|
641
651
|
transparentResolution: "1K",
|
|
642
652
|
backgroundOnlyAtTransparentResolution: true,
|
|
@@ -667,6 +677,7 @@ var IMAGE_MODELS = {
|
|
|
667
677
|
useCases: ["typography", "high-res", "general", "draft"],
|
|
668
678
|
features: ["reference-image"],
|
|
669
679
|
aspectRatios: GPT_IMAGE_2_6_RATIOS,
|
|
680
|
+
autoAspectFromSourceImage: true,
|
|
670
681
|
resolutions: ["1K", "2K", "4K"],
|
|
671
682
|
qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
|
|
672
683
|
defaultQuality: "medium",
|
|
@@ -708,6 +719,7 @@ var IMAGE_MODELS = {
|
|
|
708
719
|
useCases: ["edit", "high-res"],
|
|
709
720
|
features: ["reference-image"],
|
|
710
721
|
aspectRatios: GPT_IMAGE_2_6_RATIOS,
|
|
722
|
+
autoAspectFromSourceImage: true,
|
|
711
723
|
resolutions: ["1K", "2K", "4K"],
|
|
712
724
|
qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
|
|
713
725
|
defaultQuality: "medium",
|
|
@@ -736,6 +748,7 @@ var IMAGE_MODELS = {
|
|
|
736
748
|
useCases: ["typography", "high-res", "general"],
|
|
737
749
|
features: ["reference-image"],
|
|
738
750
|
aspectRatios: GPT_IMAGE_2_6_RATIOS,
|
|
751
|
+
autoAspectFromSourceImage: true,
|
|
739
752
|
resolutions: ["1K", "2K", "4K"],
|
|
740
753
|
qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
|
|
741
754
|
defaultQuality: "medium",
|
|
@@ -777,6 +790,7 @@ var IMAGE_MODELS = {
|
|
|
777
790
|
useCases: ["edit", "high-res"],
|
|
778
791
|
features: ["reference-image"],
|
|
779
792
|
aspectRatios: GPT_IMAGE_2_6_RATIOS,
|
|
793
|
+
autoAspectFromSourceImage: true,
|
|
780
794
|
resolutions: ["1K", "2K", "4K"],
|
|
781
795
|
qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
|
|
782
796
|
defaultQuality: "medium",
|
|
@@ -811,6 +825,7 @@ var IMAGE_MODELS = {
|
|
|
811
825
|
useCases: ["general", "draft"],
|
|
812
826
|
features: ["reference-image"],
|
|
813
827
|
aspectRatios: GPT_IMAGE_2_6_ECONOMY_RATIOS,
|
|
828
|
+
autoAspectFromSourceImage: true,
|
|
814
829
|
backgrounds: GPT_IMAGE_BACKGROUNDS,
|
|
815
830
|
pricing: [{ identifier: "gpt-image-2-6-economy", credits: 13, note: "1K flat" }],
|
|
816
831
|
valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
|
|
@@ -829,6 +844,7 @@ var IMAGE_MODELS = {
|
|
|
829
844
|
useCases: ["edit", "draft"],
|
|
830
845
|
features: ["reference-image"],
|
|
831
846
|
aspectRatios: GPT_IMAGE_2_6_ECONOMY_RATIOS,
|
|
847
|
+
autoAspectFromSourceImage: true,
|
|
832
848
|
backgrounds: GPT_IMAGE_BACKGROUNDS,
|
|
833
849
|
pricing: [{ identifier: "gpt-image-2-6-economy-i2i", credits: 13, note: "1K flat" }],
|
|
834
850
|
valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
|
|
@@ -1545,6 +1561,34 @@ var VIDEO_MODELS = {
|
|
|
1545
1561
|
{ identifier: "gemini-omni-flash:4k:vref", credits: 630, note: "video-edit 4K" }
|
|
1546
1562
|
]
|
|
1547
1563
|
},
|
|
1564
|
+
"gemini-omni-flash-1-2": {
|
|
1565
|
+
id: "gemini-omni-flash-1-2",
|
|
1566
|
+
kind: "video",
|
|
1567
|
+
modes: ["i2v", "t2v"],
|
|
1568
|
+
// V2V is served via the i2v handle, not a catalog mode
|
|
1569
|
+
family: "Google",
|
|
1570
|
+
maker: "google",
|
|
1571
|
+
label: "Gemini Omni Flash 1.2",
|
|
1572
|
+
series: "Gemini",
|
|
1573
|
+
description: "Google Gemini Omni Flash 1.2 \u2014 3\u201315s video with native sound, from 360p to 4K: from text, up to 6 reference images, exact first and last frames, or a video edit. Priced per second.",
|
|
1574
|
+
useCases: ["cinematic", "fast"],
|
|
1575
|
+
features: ["audio", "reference-image", "reference-to-video", "end-frame"],
|
|
1576
|
+
referenceSyntax: "image N",
|
|
1577
|
+
aspectRatios: ["16:9", "9:16", "auto"],
|
|
1578
|
+
resolutions: ["360p", "720p", "1080p", "4k"],
|
|
1579
|
+
defaultResolution: "720p",
|
|
1580
|
+
unlistedResolutionRendersAs: "720p",
|
|
1581
|
+
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1582
|
+
defaultDuration: 8,
|
|
1583
|
+
pricing: [
|
|
1584
|
+
{ identifier: "gemini-omni-flash-1-2", credits: 180, note: "default 8s 720p \u2014 see :Ns:res variants" },
|
|
1585
|
+
{ identifier: "gemini-omni-flash-1-2:3s:360p", credits: 30, note: "3s 360p (min)" },
|
|
1586
|
+
{ identifier: "gemini-omni-flash-1-2:8s:720p", credits: 180, note: "8s 720p (the default tier)" },
|
|
1587
|
+
{ identifier: "gemini-omni-flash-1-2:8s:1080p", credits: 200, note: "8s 1080p" },
|
|
1588
|
+
{ identifier: "gemini-omni-flash-1-2:8s:4k", credits: 440, note: "8s 4K" },
|
|
1589
|
+
{ identifier: "gemini-omni-flash-1-2:15s:4k", credits: 830, note: "15s 4K (max)" }
|
|
1590
|
+
]
|
|
1591
|
+
},
|
|
1548
1592
|
// ── Kling ──
|
|
1549
1593
|
"kling": {
|
|
1550
1594
|
id: "kling",
|
|
@@ -1863,7 +1907,10 @@ var VIDEO_MODELS = {
|
|
|
1863
1907
|
"seedance-2-5": {
|
|
1864
1908
|
id: "seedance-2-5",
|
|
1865
1909
|
kind: "video",
|
|
1866
|
-
|
|
1910
|
+
// `v2v`: it edits a clip by instruction on the same route as the other edit
|
|
1911
|
+
// models (/v1/video-to-video, through its reference lane, in the clip's own
|
|
1912
|
+
// ratio and length). It still makes a clip from words or a picture.
|
|
1913
|
+
modes: ["i2v", "t2v", "v2v"],
|
|
1867
1914
|
family: "Bytedance",
|
|
1868
1915
|
maker: "bytedance",
|
|
1869
1916
|
label: "Seedance 2.5",
|
|
@@ -3459,6 +3506,8 @@ function validateModelInput(modelId, input) {
|
|
|
3459
3506
|
return null;
|
|
3460
3507
|
}
|
|
3461
3508
|
function defaultResolutionFor(modelId) {
|
|
3509
|
+
const declared = MODEL_CATALOG[modelId]?.defaultResolution;
|
|
3510
|
+
if (declared) return declared;
|
|
3462
3511
|
if (!isFlux2Model(modelId)) return void 0;
|
|
3463
3512
|
return modelId === "flux-2-klein" ? "1 MP" : "2 MP";
|
|
3464
3513
|
}
|
|
@@ -3497,8 +3546,29 @@ function nearestCatalogAspectRatio(sourceWidth, sourceHeight, ratios) {
|
|
|
3497
3546
|
}
|
|
3498
3547
|
function autoAspectNeedsSourceImage(modelId, aspectRatio) {
|
|
3499
3548
|
if (!modelId || !isAutoAspectToken(aspectRatio)) return false;
|
|
3500
|
-
const
|
|
3501
|
-
|
|
3549
|
+
const entry = MODEL_CATALOG[modelId];
|
|
3550
|
+
const ratios = entry?.aspectRatios;
|
|
3551
|
+
if (ratios === void 0 || ratios.length === 0) return false;
|
|
3552
|
+
return entry?.autoAspectFromSourceImage === true || !ratios.some(isAutoAspectToken);
|
|
3553
|
+
}
|
|
3554
|
+
function resolutionsAtAspectRatio(modelId, aspectRatio) {
|
|
3555
|
+
const m = MODEL_CATALOG[modelId];
|
|
3556
|
+
const all = m?.resolutions;
|
|
3557
|
+
if (!all || all.length === 0) return void 0;
|
|
3558
|
+
const byRatio = m.resolutionsByAspectRatio;
|
|
3559
|
+
const ratio = typeof aspectRatio === "string" ? aspectRatio.trim() : void 0;
|
|
3560
|
+
const only = byRatio && ratio !== void 0 && Object.prototype.hasOwnProperty.call(byRatio, ratio) ? byRatio[ratio] : void 0;
|
|
3561
|
+
return only ? all.filter((r) => only.includes(r)) : all;
|
|
3562
|
+
}
|
|
3563
|
+
function resolutionAtAspectRatio(modelId, aspectRatio, resolution) {
|
|
3564
|
+
if (resolution === void 0) return void 0;
|
|
3565
|
+
const all = MODEL_CATALOG[modelId]?.resolutions;
|
|
3566
|
+
const offered = resolutionsAtAspectRatio(modelId, aspectRatio);
|
|
3567
|
+
if (!all || !offered || offered.length === 0 || offered.includes(resolution)) return resolution;
|
|
3568
|
+
const at = all.indexOf(resolution);
|
|
3569
|
+
if (at < 0) return resolution;
|
|
3570
|
+
const atOrBelow = offered.filter((r) => all.indexOf(r) <= at);
|
|
3571
|
+
return atOrBelow.length > 0 ? atOrBelow[atOrBelow.length - 1] : offered[0];
|
|
3502
3572
|
}
|
|
3503
3573
|
function normalizeModelInput(modelId, input, context = {}) {
|
|
3504
3574
|
const m = MODEL_CATALOG[modelId];
|
|
@@ -3531,11 +3601,12 @@ function normalizeModelInput(modelId, input, context = {}) {
|
|
|
3531
3601
|
const sourceRatio = autoAspectNeedsSourceImage(modelId, input.aspectRatio) && usableSize(context.sourceImage) ? nearestCatalogAspectRatio(context.sourceImage.width, context.sourceImage.height, m.aspectRatios ?? []) : void 0;
|
|
3532
3602
|
if (sourceRatio !== void 0 && input.aspectRatio !== void 0) {
|
|
3533
3603
|
const { width, height } = context.sourceImage;
|
|
3604
|
+
const why = m.autoAspectFromSourceImage === true ? `${m.label}'s own "auto" does not keep the photo's shape` : `${m.label} has no "auto" aspect ratio`;
|
|
3534
3605
|
adjustments.push({
|
|
3535
3606
|
field: "aspectRatio",
|
|
3536
3607
|
from: input.aspectRatio,
|
|
3537
3608
|
to: sourceRatio,
|
|
3538
|
-
reason: `${
|
|
3609
|
+
reason: `${why} \u2014 using "${sourceRatio}", the supported ratio closest to the source image's shape (${width}x${height}).`
|
|
3539
3610
|
});
|
|
3540
3611
|
out.aspectRatio = sourceRatio;
|
|
3541
3612
|
} else {
|
|
@@ -3550,6 +3621,17 @@ function normalizeModelInput(modelId, input, context = {}) {
|
|
|
3550
3621
|
out.quality = snap("quality", input.quality, m.qualities, m.defaultQuality);
|
|
3551
3622
|
out.background = snap("background", input.background, m.backgrounds);
|
|
3552
3623
|
out.duration = m.autoDuration === true && isAutoVideoDuration(input.duration) ? input.duration : snap("duration", input.duration, m.durations);
|
|
3624
|
+
const sized = resolutionAtAspectRatio(modelId, out.aspectRatio, out.resolution);
|
|
3625
|
+
if (out.resolution !== void 0 && sized !== void 0 && sized !== out.resolution) {
|
|
3626
|
+
const offered = resolutionsAtAspectRatio(modelId, out.aspectRatio) ?? [sized];
|
|
3627
|
+
adjustments.push({
|
|
3628
|
+
field: "resolution",
|
|
3629
|
+
from: out.resolution,
|
|
3630
|
+
to: sized,
|
|
3631
|
+
reason: `${m.label} only renders ${offered.join(" or ")} at the "${out.aspectRatio}" aspect ratio.`
|
|
3632
|
+
});
|
|
3633
|
+
out.resolution = sized;
|
|
3634
|
+
}
|
|
3553
3635
|
if (modelId === "gpt-image-2" || modelId === "gpt-image-2-i2i") {
|
|
3554
3636
|
if (out.aspectRatio === "auto" && out.resolution !== void 0 && out.resolution !== "1K") {
|
|
3555
3637
|
adjustments.push({
|
|
@@ -3901,9 +3983,11 @@ exports.nearestCatalogAspectRatio = nearestCatalogAspectRatio;
|
|
|
3901
3983
|
exports.normalizeModelInput = normalizeModelInput;
|
|
3902
3984
|
exports.normalizeVideoRequestParams = normalizeVideoRequestParams;
|
|
3903
3985
|
exports.qualityOptionsByKind = qualityOptionsByKind;
|
|
3986
|
+
exports.resolutionAtAspectRatio = resolutionAtAspectRatio;
|
|
3904
3987
|
exports.resolutionOptionsByKind = resolutionOptionsByKind;
|
|
3988
|
+
exports.resolutionsAtAspectRatio = resolutionsAtAspectRatio;
|
|
3905
3989
|
exports.seedanceDraftFinalizeBillableSec = seedanceDraftFinalizeBillableSec;
|
|
3906
3990
|
exports.seedanceDraftFinalizeCreditId = seedanceDraftFinalizeCreditId;
|
|
3907
3991
|
exports.validateModelInput = validateModelInput;
|
|
3908
|
-
//# sourceMappingURL=chunk-
|
|
3909
|
-
//# sourceMappingURL=chunk-
|
|
3992
|
+
//# sourceMappingURL=chunk-4ZZ6SVIQ.cjs.map
|
|
3993
|
+
//# sourceMappingURL=chunk-4ZZ6SVIQ.cjs.map
|