@nodaro/shared 3.33.0 → 3.35.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-2NQLSLSN.cjs → chunk-24ZKPE33.cjs} +5 -5
- package/dist/{chunk-2NQLSLSN.cjs.map → chunk-24ZKPE33.cjs.map} +1 -1
- package/dist/{chunk-CK3GK34R.js → chunk-2HIDE3QV.js} +9 -3
- package/dist/chunk-2HIDE3QV.js.map +1 -0
- package/dist/{chunk-WDIBOWAA.js → chunk-2HVFF5SS.js} +6 -6
- package/dist/chunk-2HVFF5SS.js.map +1 -0
- package/dist/{chunk-FT5CF6IA.js → chunk-2QWNPYDG.js} +3 -3
- package/dist/{chunk-FT5CF6IA.js.map → chunk-2QWNPYDG.js.map} +1 -1
- package/dist/{chunk-M7GQBRZU.cjs → chunk-3YG3MYDE.cjs} +153 -24
- package/dist/chunk-3YG3MYDE.cjs.map +1 -0
- package/dist/{chunk-VNQRI2RO.cjs → chunk-5VNBQ4QK.cjs} +16 -16
- package/dist/{chunk-VNQRI2RO.cjs.map → chunk-5VNBQ4QK.cjs.map} +1 -1
- package/dist/{chunk-K3LLGRK7.cjs → chunk-5ZCXWA7J.cjs} +59 -15
- package/dist/chunk-5ZCXWA7J.cjs.map +1 -0
- package/dist/{chunk-Z2OL5AJD.cjs → chunk-6F6GGX2W.cjs} +4 -3
- package/dist/chunk-6F6GGX2W.cjs.map +1 -0
- package/dist/{chunk-D26ENTN2.cjs → chunk-72IFMNJE.cjs} +80 -52
- package/dist/chunk-72IFMNJE.cjs.map +1 -0
- package/dist/{chunk-SAW5OK36.cjs → chunk-A5Z3IMSJ.cjs} +6 -6
- package/dist/{chunk-SAW5OK36.cjs.map → chunk-A5Z3IMSJ.cjs.map} +1 -1
- package/dist/{chunk-VA42637J.cjs → chunk-AGEZY4LL.cjs} +46 -41
- package/dist/chunk-AGEZY4LL.cjs.map +1 -0
- package/dist/{chunk-BG5D5CZ6.js → chunk-ANOQWAMU.js} +23 -6
- package/dist/chunk-ANOQWAMU.js.map +1 -0
- package/dist/{chunk-PRYE7AZQ.cjs → chunk-AWWOQH46.cjs} +7 -7
- package/dist/chunk-AWWOQH46.cjs.map +1 -0
- package/dist/{chunk-JFS3NWZ5.cjs → chunk-B7WJJHJS.cjs} +7 -4
- package/dist/chunk-B7WJJHJS.cjs.map +1 -0
- package/dist/{chunk-D6GNRSCV.cjs → chunk-BBLE4UTG.cjs} +23 -6
- package/dist/chunk-BBLE4UTG.cjs.map +1 -0
- package/dist/{chunk-HGC5JNVA.cjs → chunk-BVVKMQKR.cjs} +9 -2
- package/dist/chunk-BVVKMQKR.cjs.map +1 -0
- package/dist/{chunk-YYV35XOS.js → chunk-C4R7BTBQ.js} +4 -3
- package/dist/chunk-C4R7BTBQ.js.map +1 -0
- package/dist/{chunk-PXFQVLBX.js → chunk-ETXUOETU.js} +26 -36
- package/dist/chunk-ETXUOETU.js.map +1 -0
- package/dist/{chunk-HKFMXNVQ.cjs → chunk-F4ZT5X2S.cjs} +11 -11
- package/dist/{chunk-HKFMXNVQ.cjs.map → chunk-F4ZT5X2S.cjs.map} +1 -1
- package/dist/{chunk-YBPBK5KI.js → chunk-FKQJYMCO.js} +97 -23
- package/dist/chunk-FKQJYMCO.js.map +1 -0
- package/dist/{chunk-ZDFHA2EC.js → chunk-FVKCNAEQ.js} +51 -7
- package/dist/chunk-FVKCNAEQ.js.map +1 -0
- package/dist/{chunk-ZL7UM6PU.cjs → chunk-GHBXS5RT.cjs} +4 -4
- package/dist/{chunk-ZL7UM6PU.cjs.map → chunk-GHBXS5RT.cjs.map} +1 -1
- package/dist/{chunk-ZO5PBBFX.js → chunk-GKJRNIP4.js} +59 -15
- package/dist/chunk-GKJRNIP4.js.map +1 -0
- package/dist/{chunk-UCFWI6D4.js → chunk-GRIMIJJ3.js} +3 -3
- package/dist/{chunk-UCFWI6D4.js.map → chunk-GRIMIJJ3.js.map} +1 -1
- package/dist/{chunk-5RYLK3MQ.js → chunk-GVHBHUFV.js} +11 -6
- package/dist/chunk-GVHBHUFV.js.map +1 -0
- package/dist/chunk-GZH2SIOF.cjs +99 -0
- package/dist/chunk-GZH2SIOF.cjs.map +1 -0
- package/dist/{chunk-SFW3UB2P.js → chunk-IJNQYMN7.js} +4 -4
- package/dist/{chunk-SFW3UB2P.js.map → chunk-IJNQYMN7.js.map} +1 -1
- package/dist/{chunk-HC7VKIV5.cjs → chunk-IRUPCNW2.cjs} +49 -46
- package/dist/chunk-IRUPCNW2.cjs.map +1 -0
- package/dist/{chunk-JL4C5VJ7.cjs → chunk-J65CAOUV.cjs} +14 -2
- package/dist/chunk-J65CAOUV.cjs.map +1 -0
- package/dist/{chunk-23FJQTEA.js → chunk-LJMNCSDG.js} +38 -15
- package/dist/chunk-LJMNCSDG.js.map +1 -0
- package/dist/{chunk-PVJBAPYJ.js → chunk-MEN7VLQ5.js} +8 -5
- package/dist/chunk-MEN7VLQ5.js.map +1 -0
- package/dist/{chunk-PHZ23DP3.js → chunk-MUA5L25B.js} +125 -12
- package/dist/chunk-MUA5L25B.js.map +1 -0
- package/dist/{chunk-WD6HJRBG.cjs → chunk-NWXB4F6D.cjs} +21 -21
- package/dist/{chunk-WD6HJRBG.cjs.map → chunk-NWXB4F6D.cjs.map} +1 -1
- package/dist/{chunk-PQHS255G.js → chunk-OHSIVNJO.js} +3 -3
- package/dist/chunk-OHSIVNJO.js.map +1 -0
- package/dist/{chunk-XGFTL5XY.js → chunk-PVVO23LZ.js} +3 -3
- package/dist/{chunk-XGFTL5XY.js.map → chunk-PVVO23LZ.js.map} +1 -1
- package/dist/{chunk-CUH22J4D.js → chunk-Q4ZXDDWA.js} +3 -3
- package/dist/{chunk-CUH22J4D.js.map → chunk-Q4ZXDDWA.js.map} +1 -1
- package/dist/{chunk-WKOIGLQX.cjs → chunk-QIIG2QDP.cjs} +8 -8
- package/dist/{chunk-WKOIGLQX.cjs.map → chunk-QIIG2QDP.cjs.map} +1 -1
- package/dist/{chunk-QA3MVQ32.js → chunk-QXW6O56Z.js} +6 -6
- package/dist/chunk-QXW6O56Z.js.map +1 -0
- package/dist/{chunk-5PC6JBGJ.cjs → chunk-R2VF5NQG.cjs} +3 -3
- package/dist/chunk-R2VF5NQG.cjs.map +1 -0
- package/dist/{chunk-7Z5LUTGU.js → chunk-RRI5YBUK.js} +6 -3
- package/dist/{chunk-JFS3NWZ5.cjs.map → chunk-RRI5YBUK.js.map} +1 -1
- package/dist/{chunk-HUR6ZJ7S.cjs → chunk-RUKFN3LJ.cjs} +6 -6
- package/dist/{chunk-HUR6ZJ7S.cjs.map → chunk-RUKFN3LJ.cjs.map} +1 -1
- package/dist/chunk-TCBHVIMD.js +89 -0
- package/dist/chunk-TCBHVIMD.js.map +1 -0
- package/dist/{chunk-SES6GDBQ.cjs → chunk-UJJUX6NW.cjs} +59 -8
- package/dist/chunk-UJJUX6NW.cjs.map +1 -0
- package/dist/{chunk-ZRL2UFTH.cjs → chunk-V3N56Z2S.cjs} +101 -22
- package/dist/chunk-V3N56Z2S.cjs.map +1 -0
- package/dist/{chunk-6WZ2VN7V.js → chunk-W36WCZS2.js} +6 -6
- package/dist/{chunk-6WZ2VN7V.js.map → chunk-W36WCZS2.js.map} +1 -1
- package/dist/{chunk-M36G6SRP.js → chunk-WXNQMJ67.js} +14 -3
- package/dist/chunk-WXNQMJ67.js.map +1 -0
- package/dist/{chunk-VXPLKQWY.cjs → chunk-XE5PE54B.cjs} +30 -40
- package/dist/chunk-XE5PE54B.cjs.map +1 -0
- package/dist/{chunk-OZSACQ2V.js → chunk-XJOBMAWW.js} +3 -3
- package/dist/{chunk-OZSACQ2V.js.map → chunk-XJOBMAWW.js.map} +1 -1
- package/dist/{chunk-OTATNBMD.js → chunk-XS7FI4JA.js} +3 -3
- package/dist/{chunk-OTATNBMD.js.map → chunk-XS7FI4JA.js.map} +1 -1
- package/dist/{chunk-HRXEZ3SX.cjs → chunk-YD3JA36S.cjs} +4 -4
- package/dist/{chunk-HRXEZ3SX.cjs.map → chunk-YD3JA36S.cjs.map} +1 -1
- package/dist/chunk-YYODFQEU.cjs +25 -0
- package/dist/chunk-YYODFQEU.cjs.map +1 -0
- package/dist/{chunk-UTQSSKSG.js → chunk-ZXBSARZX.js} +4 -4
- package/dist/{chunk-UTQSSKSG.js.map → chunk-ZXBSARZX.js.map} +1 -1
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.d.cts +2 -2
- package/dist/entries/apps.d.ts +2 -2
- package/dist/entries/apps.js +8 -7
- package/dist/entries/catalogs.d.cts +1 -1
- package/dist/entries/catalogs.d.ts +1 -1
- package/dist/entries/credits.cjs +153 -153
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +8 -8
- package/dist/entries/edl.cjs +130 -102
- package/dist/entries/edl.d.cts +74 -3
- package/dist/entries/edl.d.ts +74 -3
- package/dist/entries/edl.js +2 -2
- package/dist/entries/entities.cjs +126 -122
- package/dist/entries/entities.d.cts +2 -2
- package/dist/entries/entities.d.ts +2 -2
- package/dist/entries/entities.js +1 -1
- package/dist/entries/i18n.cjs +11 -11
- package/dist/entries/i18n.d.cts +2 -2
- package/dist/entries/i18n.d.ts +2 -2
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/llm-models.cjs +63 -43
- package/dist/entries/llm-models.d.cts +71 -4
- package/dist/entries/llm-models.d.ts +71 -4
- package/dist/entries/llm-models.js +1 -1
- package/dist/entries/media.cjs +45 -41
- package/dist/entries/media.d.cts +39 -1
- package/dist/entries/media.d.ts +39 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +66 -66
- 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 +274 -210
- package/dist/entries/models.d.cts +3 -3
- package/dist/entries/models.d.ts +3 -3
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +222 -201
- package/dist/entries/nodes.d.cts +48 -8
- package/dist/entries/nodes.d.ts +48 -8
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +8 -4
- package/dist/entries/pipeline.d.ts +8 -4
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +174 -174
- package/dist/entries/social.d.cts +13 -5
- package/dist/entries/social.d.ts +13 -5
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +1 -1
- package/dist/entries/types.d.ts +1 -1
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +115 -115
- package/dist/entries/video.d.cts +4 -3
- package/dist/entries/video.d.ts +4 -3
- package/dist/entries/video.js +4 -4
- package/dist/entries/workflow.cjs +96 -95
- package/dist/entries/workflow.d.cts +7 -18
- package/dist/entries/workflow.d.ts +7 -18
- package/dist/entries/workflow.js +2 -1
- package/dist/index.cjs +1708 -1567
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +26 -25
- package/dist/{model-catalog-V-ZNzRSd.d.ts → model-catalog-VIHGmQL2.d.cts} +22 -0
- package/dist/{model-catalog-V-ZNzRSd.d.cts → model-catalog-VIHGmQL2.d.ts} +22 -0
- package/dist/{presentation-utils-D0kxsWf9.d.cts → presentation-utils-A4i92SYo.d.cts} +1 -1
- package/dist/{presentation-utils-pZwlEAzo.d.ts → presentation-utils-DjdPtM9k.d.ts} +1 -1
- package/dist/{scene-node-types-C3kl_zyK.d.ts → scene-node-types-Cvbtf-0a.d.cts} +147 -6
- package/dist/{scene-node-types-C3kl_zyK.d.cts → scene-node-types-Cvbtf-0a.d.ts} +147 -6
- package/dist/{types-DffyGSy5.d.cts → types-CU6SQnMS.d.cts} +0 -5
- package/dist/{types-DffyGSy5.d.ts → types-CU6SQnMS.d.ts} +0 -5
- package/dist/{types-BRlFPEru.d.ts → types-DzUBR7yr.d.cts} +8 -1
- package/dist/{types-BRlFPEru.d.cts → types-DzUBR7yr.d.ts} +8 -1
- package/package.json +1 -1
- package/src/__tests__/camera-switch-contract.test.ts +33 -1
- package/src/__tests__/character-mention-slug.test.ts +0 -8
- package/src/__tests__/effective-tier.test.ts +3 -14
- package/src/__tests__/fixtures/camera-switch-speaker-map-parity.json +178 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +21 -0
- package/src/__tests__/fixtures/speaker-map-camera-ids.json +26 -0
- package/src/__tests__/gvp-supported-providers.test.ts +1 -0
- package/src/__tests__/i18n-locale-completeness.test.ts +38 -3
- package/src/__tests__/llm-models.test.ts +200 -20
- package/src/__tests__/node-preset-extract.test.ts +10 -0
- package/src/__tests__/preview-gate-use-case.test.ts +16 -1
- package/src/__tests__/producer-types.test.ts +19 -0
- package/src/__tests__/run-continuation.test.ts +4 -1
- package/src/__tests__/speaker-map-contract.test.ts +48 -0
- package/src/__tests__/unit-contract-compose.test.ts +129 -0
- package/src/__tests__/unit-contracts.test.ts +134 -0
- package/src/__tests__/use-case-types.test.ts +33 -0
- package/src/__tests__/video-collapse-parity.test.ts +10 -0
- package/src/__tests__/video-frame-slot.test.ts +85 -0
- package/src/__tests__/video-mode-aliases.test.ts +1 -0
- package/src/__tests__/video-reference-only.test.ts +117 -0
- package/src/__tests__/vidu-q4-catalog.test.ts +230 -0
- package/src/camera-switch-contract.ts +36 -2
- package/src/credit-identifiers.ts +19 -6
- package/src/entity-asset-types.ts +13 -0
- package/src/entries/edl.ts +2 -0
- package/src/entries/llm-models.ts +5 -0
- package/src/entries/media.ts +1 -0
- package/src/entries/models.ts +25 -0
- package/src/entries/nodes.ts +5 -1
- package/src/fan-out-rows.ts +36 -3
- package/src/generate-mask.ts +40 -0
- package/src/generated/unit-contracts.ts +58 -0
- package/src/i18n/types.ts +13 -2
- package/src/json-kinds.ts +24 -4
- package/src/llm-models.ts +184 -31
- package/src/meta-ads-scrape.ts +16 -8
- package/src/model-catalog.ts +78 -13
- package/src/model-constants.ts +260 -5
- package/src/node-default-mappings.ts +3 -0
- package/src/node-preset-extract.ts +8 -0
- package/src/pipeline-types.ts +3 -0
- package/src/presentation-utils.ts +12 -12
- package/src/preview-gate.ts +4 -2
- package/src/producer-types.ts +19 -19
- package/src/run-continuation.ts +26 -4
- package/src/speaker-layouts.ts +8 -3
- package/src/speaker-map-contract.ts +77 -0
- package/src/unit-contract-compose.ts +55 -0
- package/src/use-case-types.ts +19 -0
- package/src/video-ui-defaults.ts +7 -5
- package/dist/chunk-23FJQTEA.js.map +0 -1
- package/dist/chunk-5PC6JBGJ.cjs.map +0 -1
- package/dist/chunk-5RYLK3MQ.js.map +0 -1
- package/dist/chunk-7Z5LUTGU.js.map +0 -1
- package/dist/chunk-BG5D5CZ6.js.map +0 -1
- package/dist/chunk-CK3GK34R.js.map +0 -1
- package/dist/chunk-D26ENTN2.cjs.map +0 -1
- package/dist/chunk-D6GNRSCV.cjs.map +0 -1
- package/dist/chunk-HC7VKIV5.cjs.map +0 -1
- package/dist/chunk-HGC5JNVA.cjs.map +0 -1
- package/dist/chunk-JL4C5VJ7.cjs.map +0 -1
- package/dist/chunk-K3LLGRK7.cjs.map +0 -1
- package/dist/chunk-M36G6SRP.js.map +0 -1
- package/dist/chunk-M7GQBRZU.cjs.map +0 -1
- package/dist/chunk-PHZ23DP3.js.map +0 -1
- package/dist/chunk-PQHS255G.js.map +0 -1
- package/dist/chunk-PRYE7AZQ.cjs.map +0 -1
- package/dist/chunk-PVJBAPYJ.js.map +0 -1
- package/dist/chunk-PXFQVLBX.js.map +0 -1
- package/dist/chunk-QA3MVQ32.js.map +0 -1
- package/dist/chunk-SES6GDBQ.cjs.map +0 -1
- package/dist/chunk-TU33KYKW.cjs +0 -25
- package/dist/chunk-TU33KYKW.cjs.map +0 -1
- package/dist/chunk-VA42637J.cjs.map +0 -1
- package/dist/chunk-VXPLKQWY.cjs.map +0 -1
- package/dist/chunk-WDIBOWAA.js.map +0 -1
- package/dist/chunk-YBPBK5KI.js.map +0 -1
- package/dist/chunk-YYV35XOS.js.map +0 -1
- package/dist/chunk-Z2OL5AJD.cjs.map +0 -1
- package/dist/chunk-ZDFHA2EC.js.map +0 -1
- package/dist/chunk-ZO5PBBFX.js.map +0 -1
- package/dist/chunk-ZRL2UFTH.cjs.map +0 -1
- package/src/__tests__/__snapshots__/prompt-builder-segments.test.ts.snap +0 -65
package/src/model-catalog.ts
CHANGED
|
@@ -179,6 +179,7 @@ export const MODEL_MAKERS = {
|
|
|
179
179
|
openai: { name: "OpenAI" },
|
|
180
180
|
recraft: { name: "Recraft" },
|
|
181
181
|
runway: { name: "Runway" },
|
|
182
|
+
shengshu: { name: "ShengShu" },
|
|
182
183
|
suno: { name: "Suno" },
|
|
183
184
|
"sync-labs": { name: "Sync Labs" },
|
|
184
185
|
"topaz-labs": { name: "Topaz Labs" },
|
|
@@ -263,8 +264,27 @@ export interface ModelCatalogEntry {
|
|
|
263
264
|
* auto-determined duration and flat per-generation pricing (see
|
|
264
265
|
* `runGeminiOmni` in `backend/src/providers/kie/video.ts`) — a different
|
|
265
266
|
* transport, not a continuation reference.
|
|
267
|
+
*
|
|
268
|
+
* `"reference-to-video"` (video models only) means the model's provider
|
|
269
|
+
* endpoint RUNS FROM REFERENCE IMAGES ALONE — no start frame. Declared only
|
|
270
|
+
* where the provider's own contract accepts a call with reference images and
|
|
271
|
+
* no frame (KIE spec evidence per model). It is what lets a references-only
|
|
272
|
+
* run reach a model on every surface (editor gate, browser DAG, orchestrator,
|
|
273
|
+
* API): `resolveVideoModeForInputs` routes such a run to the image-to-video
|
|
274
|
+
* lane for a model with no text-to-video mode, instead of the text-to-video
|
|
275
|
+
* lane, whose "image required" gate would refuse it. Requires
|
|
276
|
+
* `"reference-image"` (guarded by `video-reference-only.test.ts`).
|
|
266
277
|
*/
|
|
267
278
|
features?: readonly string[]
|
|
279
|
+
/**
|
|
280
|
+
* How this video model's provider addresses its images in the prompt, by
|
|
281
|
+
* array order — the syntax its frame / identity binding sentences are written
|
|
282
|
+
* in (`videoProviderReferenceSyntax`). Absent ⇒ the platform's `@image_N`.
|
|
283
|
+
* Declared only where the provider documents its own form: Grok Imagine's
|
|
284
|
+
* `@image(n)` (docs.kie.ai/market/grok-imagine/image-to-video) and
|
|
285
|
+
* HappyHorse's `[Image N]` (docs.kie.ai/market/happyhorse-1-1/reference-to-video).
|
|
286
|
+
*/
|
|
287
|
+
referenceSyntax?: "@image(n)" | "[Image N]"
|
|
268
288
|
aspectRatios?: readonly string[]
|
|
269
289
|
resolutions?: readonly string[]
|
|
270
290
|
/**
|
|
@@ -435,6 +455,10 @@ const VIDEO_RATIOS_HAPPYHORSE_11 = ["16:9", "9:16", "1:1", "4:3", "3:4", "4:5",
|
|
|
435
455
|
// so VIDEO_RATIOS_SEEDANCE_2 must NOT be reused here
|
|
436
456
|
// (docs.kie.ai/market/wan/3-0-video and /3-0-video-prime — identical schemas).
|
|
437
457
|
const VIDEO_RATIOS_WAN_3 = ["adaptive", "16:9", "4:3", "1:1", "3:4", "9:16"] as const
|
|
458
|
+
// Vidu Q4 — the reference-to-video enum (docs.kie.ai/market/vidu-q4/reference-to-video,
|
|
459
|
+
// default 16:9). The image-to-video endpoint takes NO aspect ratio: its output
|
|
460
|
+
// inherits the start frame's shape, so these apply to reference runs only.
|
|
461
|
+
const VIDEO_RATIOS_VIDU_Q4 = ["16:9", "9:16", "1:1", "4:3", "3:4"] as const
|
|
438
462
|
|
|
439
463
|
// =============================================================================
|
|
440
464
|
// IMAGE MODELS
|
|
@@ -1420,7 +1444,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1420
1444
|
series: "Hailuo",
|
|
1421
1445
|
description: "MiniMax H3 — premium multimodal tier: first/last frame + image/video/audio references, native audio, 2K (default) or 768P output, 4-15s per-second pricing.",
|
|
1422
1446
|
useCases: ["premium", "narrative"],
|
|
1423
|
-
features: ["end-frame", "audio", "reference-image", "video-reference"],
|
|
1447
|
+
features: ["end-frame", "audio", "reference-image", "video-reference", "reference-to-video"],
|
|
1424
1448
|
aspectRatios: VIDEO_RATIOS_SEEDANCE_2,
|
|
1425
1449
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1426
1450
|
defaultDuration: 6,
|
|
@@ -1541,7 +1565,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1541
1565
|
series: "VEO",
|
|
1542
1566
|
description: "VEO 3.1 Fast — cheaper VEO 3.1 tier, 4/6/8s with audio. Good balance for most uses. Flat per-generation pricing across durations.",
|
|
1543
1567
|
useCases: ["cinematic", "fast", "general"],
|
|
1544
|
-
features: ["end-frame", "audio", "reference-image"],
|
|
1568
|
+
features: ["end-frame", "audio", "reference-image", "reference-to-video"],
|
|
1545
1569
|
durations: [4, 6, 8],
|
|
1546
1570
|
defaultDuration: 8,
|
|
1547
1571
|
aspectRatios: VIDEO_RATIOS_HV,
|
|
@@ -1563,7 +1587,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1563
1587
|
series: "VEO",
|
|
1564
1588
|
description: "VEO 3.1 Lite — most cost-effective VEO tier for high-volume generation. 4/6/8s with audio, supports first+last frame.",
|
|
1565
1589
|
useCases: ["cinematic", "cheap", "high-volume"],
|
|
1566
|
-
features: ["end-frame", "audio", "reference-image"],
|
|
1590
|
+
features: ["end-frame", "audio", "reference-image", "reference-to-video"],
|
|
1567
1591
|
durations: [4, 6, 8],
|
|
1568
1592
|
defaultDuration: 8,
|
|
1569
1593
|
aspectRatios: VIDEO_RATIOS_HV,
|
|
@@ -1585,7 +1609,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1585
1609
|
series: "Gemini",
|
|
1586
1610
|
description: "Google multimodal video with native audio; text/image-to-video + video-edit.",
|
|
1587
1611
|
useCases: ["cinematic", "narrative"],
|
|
1588
|
-
features: ["audio", "reference-image"],
|
|
1612
|
+
features: ["audio", "reference-image", "reference-to-video"],
|
|
1589
1613
|
aspectRatios: VIDEO_RATIOS_HV,
|
|
1590
1614
|
resolutions: ["720p", "1080p", "4k"],
|
|
1591
1615
|
durations: [4, 6, 8, 10],
|
|
@@ -1622,7 +1646,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1622
1646
|
series: "Gemini",
|
|
1623
1647
|
description: "Google Gemini Omni Flash — faster/cheaper Omni tier: multimodal video with native audio, text/image-to-video + video-edit.",
|
|
1624
1648
|
useCases: ["cinematic", "fast"],
|
|
1625
|
-
features: ["audio", "reference-image"],
|
|
1649
|
+
features: ["audio", "reference-image", "reference-to-video"],
|
|
1626
1650
|
aspectRatios: VIDEO_RATIOS_HV,
|
|
1627
1651
|
resolutions: ["720p", "1080p", "4k"],
|
|
1628
1652
|
durations: [4, 6, 8, 10],
|
|
@@ -1755,7 +1779,8 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1755
1779
|
id: "grok-i2v",
|
|
1756
1780
|
kind: "video",
|
|
1757
1781
|
modes: ["i2v"] as const,
|
|
1758
|
-
features: ["reference-image"],
|
|
1782
|
+
features: ["reference-image", "reference-to-video"],
|
|
1783
|
+
referenceSyntax: "@image(n)",
|
|
1759
1784
|
family: "xAI",
|
|
1760
1785
|
maker: "xai",
|
|
1761
1786
|
label: "Grok Imagine (I2V)",
|
|
@@ -1837,7 +1862,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1837
1862
|
series: "Seedance",
|
|
1838
1863
|
description: "Seedance 2 — premium tier with native audio. Per-second pricing by resolution.",
|
|
1839
1864
|
useCases: ["premium", "narrative"],
|
|
1840
|
-
features: ["end-frame", "audio", "reference-image", "video-reference"],
|
|
1865
|
+
features: ["end-frame", "audio", "reference-image", "video-reference", "reference-to-video"],
|
|
1841
1866
|
aspectRatios: VIDEO_RATIOS_SEEDANCE_2,
|
|
1842
1867
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1843
1868
|
defaultDuration: 8,
|
|
@@ -1865,7 +1890,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1865
1890
|
series: "Seedance",
|
|
1866
1891
|
description: "Cheaper / quicker Seedance 2 tier.",
|
|
1867
1892
|
useCases: ["fast", "motion"],
|
|
1868
|
-
features: ["end-frame", "audio", "reference-image", "video-reference"],
|
|
1893
|
+
features: ["end-frame", "audio", "reference-image", "video-reference", "reference-to-video"],
|
|
1869
1894
|
aspectRatios: VIDEO_RATIOS_SEEDANCE_2,
|
|
1870
1895
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1871
1896
|
defaultDuration: 8,
|
|
@@ -1889,7 +1914,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1889
1914
|
series: "Seedance",
|
|
1890
1915
|
description: "Budget Seedance 2 tier — 480p/720p only, per-second pricing by resolution.",
|
|
1891
1916
|
useCases: ["fast", "motion"],
|
|
1892
|
-
features: ["end-frame", "audio", "reference-image", "video-reference"],
|
|
1917
|
+
features: ["end-frame", "audio", "reference-image", "video-reference", "reference-to-video"],
|
|
1893
1918
|
aspectRatios: VIDEO_RATIOS_SEEDANCE_2,
|
|
1894
1919
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1895
1920
|
defaultDuration: 8,
|
|
@@ -1919,7 +1944,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1919
1944
|
series: "Seedance",
|
|
1920
1945
|
description: "Seedance 2.5 — up to 30s in one shot, native audio, wide multimodal references. 480p/720p/1080p.",
|
|
1921
1946
|
useCases: ["premium", "narrative", "long-form"],
|
|
1922
|
-
features: ["end-frame", "audio", "reference-image", "video-reference"],
|
|
1947
|
+
features: ["end-frame", "audio", "reference-image", "video-reference", "reference-to-video"],
|
|
1923
1948
|
aspectRatios: VIDEO_RATIOS_SEEDANCE_2,
|
|
1924
1949
|
durations: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
|
|
1925
1950
|
defaultDuration: 8,
|
|
@@ -1965,7 +1990,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1965
1990
|
series: "Wan",
|
|
1966
1991
|
description: "Wan 3.0 — multimodal: first/last frame or image/video/audio references, native audio, 2-30s at 480p/720p/1080p.",
|
|
1967
1992
|
useCases: ["motion", "narrative", "long-form"],
|
|
1968
|
-
features: ["end-frame", "audio", "reference-image"],
|
|
1993
|
+
features: ["end-frame", "audio", "reference-image", "reference-to-video"],
|
|
1969
1994
|
aspectRatios: VIDEO_RATIOS_WAN_3,
|
|
1970
1995
|
durations: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
|
|
1971
1996
|
defaultDuration: 5,
|
|
@@ -1992,7 +2017,7 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1992
2017
|
series: "Wan",
|
|
1993
2018
|
description: "Wan 3.0 Prime — Alibaba's high-speed Wan 3.0 tier: same multimodal surface and 2-30s range, faster turnaround at a higher per-second rate.",
|
|
1994
2019
|
useCases: ["fast", "motion", "narrative"],
|
|
1995
|
-
features: ["end-frame", "audio", "reference-image"],
|
|
2020
|
+
features: ["end-frame", "audio", "reference-image", "reference-to-video"],
|
|
1996
2021
|
aspectRatios: VIDEO_RATIOS_WAN_3,
|
|
1997
2022
|
durations: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
|
|
1998
2023
|
defaultDuration: 5,
|
|
@@ -2295,7 +2320,8 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2295
2320
|
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
2296
2321
|
defaultDuration: 5,
|
|
2297
2322
|
resolutions: ["720p", "1080p"],
|
|
2298
|
-
features: ["reference-image"],
|
|
2323
|
+
features: ["reference-image", "reference-to-video"],
|
|
2324
|
+
referenceSyntax: "[Image N]",
|
|
2299
2325
|
noSeed: true, // HappyHorse 1.1 dropped `seed` from its schema
|
|
2300
2326
|
pricing: [
|
|
2301
2327
|
{ identifier: "happyhorse-ref2v", credits: 282, note: "5s 720p default — per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" },
|
|
@@ -2316,6 +2342,45 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2316
2342
|
{ identifier: "happyhorse-edit", credits: 350, note: "720p default (5s-equivalent flat rate)" },
|
|
2317
2343
|
],
|
|
2318
2344
|
},
|
|
2345
|
+
// ── Vidu (ShengShu Technology) ──
|
|
2346
|
+
// Vidu Q4 — ONE id over two KIE endpoints, chosen by what is wired:
|
|
2347
|
+
// image-to-video (a start frame, no references; the output inherits the
|
|
2348
|
+
// frame's shape) and reference-to-video (1-15 reference images + up to 3
|
|
2349
|
+
// MP3 reference audio clips; a wired start frame joins the reference images).
|
|
2350
|
+
// KIE has NO text-to-video and NO start/end mode for Q4, so `modes` is i2v
|
|
2351
|
+
// only — VIDEO_PROVIDERS_REQUIRING_IMAGE derives the friendly "image
|
|
2352
|
+
// required" 400 from that — and there is no "end-frame" feature. Native audio
|
|
2353
|
+
// behind a boolean `audio` lever, 3-16s, 540p-4k. `resolutions` is ascending
|
|
2354
|
+
// (repo convention); the DEFAULT tier (720p) is declared explicitly in
|
|
2355
|
+
// PRICING_DEFAULT_RESOLUTION, never by array position.
|
|
2356
|
+
"vidu-q4": {
|
|
2357
|
+
id: "vidu-q4",
|
|
2358
|
+
unlistedResolutionRendersAs: "720p",
|
|
2359
|
+
kind: "video",
|
|
2360
|
+
modes: ["i2v"] as const,
|
|
2361
|
+
family: "Vidu",
|
|
2362
|
+
maker: "shengshu",
|
|
2363
|
+
label: "Vidu Q4",
|
|
2364
|
+
series: "Vidu",
|
|
2365
|
+
description: "Vidu Q4 — start-frame or reference-driven video (up to 15 reference images + 3 MP3 voice/sound clips), native audio, 3-16s at 540p to 4K.",
|
|
2366
|
+
useCases: ["motion", "reference"],
|
|
2367
|
+
features: ["audio", "reference-image", "reference-to-video"],
|
|
2368
|
+
aspectRatios: VIDEO_RATIOS_VIDU_Q4,
|
|
2369
|
+
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
|
2370
|
+
defaultDuration: 5,
|
|
2371
|
+
resolutions: ["540p", "720p", "1080p", "2k", "4k"],
|
|
2372
|
+
noSeed: true, // neither Q4 schema has a `seed` (additionalProperties: false)
|
|
2373
|
+
pricing: [
|
|
2374
|
+
{ identifier: "vidu-q4", credits: 190, note: "default 5s 720p — see :Ns:res variants for exact" },
|
|
2375
|
+
{ identifier: "vidu-q4:5s:720p", credits: 190, note: "5s 720p (the default tier)" },
|
|
2376
|
+
{ identifier: "vidu-q4:5s:540p", credits: 90, note: "5s 540p" },
|
|
2377
|
+
{ identifier: "vidu-q4:5s:1080p", credits: 240, note: "5s 1080p" },
|
|
2378
|
+
{ identifier: "vidu-q4:5s:2k", credits: 380, note: "5s 2K" },
|
|
2379
|
+
{ identifier: "vidu-q4:5s:4k", credits: 780, note: "5s 4K" },
|
|
2380
|
+
{ identifier: "vidu-q4:3s:540p", credits: 60, note: "3s 540p (min)" },
|
|
2381
|
+
{ identifier: "vidu-q4:16s:4k", credits: 2500, note: "16s 4K (max)" },
|
|
2382
|
+
],
|
|
2383
|
+
},
|
|
2319
2384
|
// ── Bytedance video lite/pro ──
|
|
2320
2385
|
"bytedance-lite": {
|
|
2321
2386
|
id: "bytedance-lite",
|
package/src/model-constants.ts
CHANGED
|
@@ -53,6 +53,28 @@ export const IMAGE_ASPECT_RATIO_VALUES = [
|
|
|
53
53
|
/** A ratio string the image routes accept (pre-snap vocabulary, not a per-model guarantee). */
|
|
54
54
|
export type ImageAspectRatio = typeof IMAGE_ASPECT_RATIO_VALUES[number]
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The `resolution` vocabulary `/v1/generate-image` and `/v1/image-to-image`
|
|
58
|
+
* accept: the K tiers (`1K`/`2K`/`4K`) and the Flux 2 megapixel tiers. Like
|
|
59
|
+
* {@link IMAGE_ASPECT_RATIO_VALUES} it is a vocabulary bound, not a per-model
|
|
60
|
+
* gate — the catalog snap corrects a value the chosen model does not declare.
|
|
61
|
+
* One tuple for the route Zod enums and the SDK's `ImageResolution`.
|
|
62
|
+
*/
|
|
63
|
+
export const IMAGE_RESOLUTION_VALUES = ["1K", "2K", "4K", "0.5 MP", "1 MP", "2 MP", "4 MP"] as const
|
|
64
|
+
export type ImageResolution = typeof IMAGE_RESOLUTION_VALUES[number]
|
|
65
|
+
|
|
66
|
+
/** The `quality` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
|
|
67
|
+
export const IMAGE_QUALITY_VALUES = ["medium", "high", "basic"] as const
|
|
68
|
+
export type ImageQuality = typeof IMAGE_QUALITY_VALUES[number]
|
|
69
|
+
|
|
70
|
+
/** The `renderingSpeed` vocabulary (Ideogram's speed tiers — see {@link RENDERING_SPEED_SUPPORT}). */
|
|
71
|
+
export const IMAGE_RENDERING_SPEED_VALUES = ["TURBO", "BALANCED", "QUALITY"] as const
|
|
72
|
+
export type ImageRenderingSpeed = typeof IMAGE_RENDERING_SPEED_VALUES[number]
|
|
73
|
+
|
|
74
|
+
/** `/v1/edit-image`'s `targetResolution` (the upscalers' output tier; topaz maps it to a factor). */
|
|
75
|
+
export const IMAGE_EDIT_TARGET_RESOLUTION_VALUES = ["2K", "4K", "8K"] as const
|
|
76
|
+
export type ImageEditTargetResolution = typeof IMAGE_EDIT_TARGET_RESOLUTION_VALUES[number]
|
|
77
|
+
|
|
56
78
|
/**
|
|
57
79
|
* Per-provider maximum ASSEMBLED image-prompt length (chars), VERIFIED against
|
|
58
80
|
* each model's official docs.kie.ai schema (2026-06). Providers absent here use
|
|
@@ -222,6 +244,9 @@ export const MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER: Record<string, number> = {
|
|
|
222
244
|
// (docs.kie.ai/market/wan/3-0-video and /3-0-video-prime).
|
|
223
245
|
"wan-3": 20000,
|
|
224
246
|
"wan-3-prime": 20000,
|
|
247
|
+
// Vidu Q4 — 20000 chars on both endpoints
|
|
248
|
+
// (docs.kie.ai/market/vidu-q4/image-to-video and /reference-to-video).
|
|
249
|
+
"vidu-q4": 20000,
|
|
225
250
|
"bytedance-lite": 10000,
|
|
226
251
|
"bytedance-pro": 10000,
|
|
227
252
|
"bytedance-pro-fast": 10000,
|
|
@@ -816,12 +841,17 @@ export const IMAGE_EDIT_PROVIDERS = [
|
|
|
816
841
|
* (`imageParam: "task_id"`) places it in the request body. Membership here
|
|
817
842
|
* must match the KIE configs with `imageParam: "task_id"` — guarded by
|
|
818
843
|
* backend/src/routes/__tests__/edit-image.test.ts.
|
|
844
|
+
*
|
|
845
|
+
* The ids as a tuple ({@link TaskChainedEditProvider} is its type); the Set is
|
|
846
|
+
* built from it, so the two cannot disagree.
|
|
819
847
|
*/
|
|
820
|
-
export const
|
|
848
|
+
export const TASK_CHAINED_EDIT_PROVIDER_IDS = [
|
|
821
849
|
"grok-upscale",
|
|
822
850
|
"grok-2-edit",
|
|
823
851
|
"grok-2-segment",
|
|
824
|
-
])
|
|
852
|
+
] as const satisfies readonly (typeof IMAGE_EDIT_PROVIDERS)[number][]
|
|
853
|
+
export type TaskChainedEditProvider = typeof TASK_CHAINED_EDIT_PROVIDER_IDS[number]
|
|
854
|
+
export const TASK_CHAINED_EDIT_PROVIDERS: ReadonlySet<string> = new Set(TASK_CHAINED_EDIT_PROVIDER_IDS)
|
|
825
855
|
|
|
826
856
|
/** Modify image providers (I2I + edit-with-prompt) */
|
|
827
857
|
export const MODIFY_IMAGE_PROVIDERS = [
|
|
@@ -878,6 +908,10 @@ export const IMAGE_TO_VIDEO_PROVIDERS = [
|
|
|
878
908
|
// so each id is listed in this array AND in TEXT_TO_VIDEO_PROVIDERS.
|
|
879
909
|
"wan-3",
|
|
880
910
|
"wan-3-prime",
|
|
911
|
+
// Vidu Q4 — one id over KIE's image-to-video and reference-to-video
|
|
912
|
+
// endpoints. No text-to-video mode: also listed in TEXT_TO_VIDEO_PROVIDERS's
|
|
913
|
+
// image-required section so the t2v route answers with the friendly 400.
|
|
914
|
+
"vidu-q4",
|
|
881
915
|
"ltx-2.3-pro",
|
|
882
916
|
"ltx-2.3-fast",
|
|
883
917
|
// xAI Grok Imagine Video 1.5 — KIE i2v (image_urls required). Also listed in
|
|
@@ -939,6 +973,7 @@ export const TEXT_TO_VIDEO_PROVIDERS = [
|
|
|
939
973
|
"hailuo-2.3-pro",
|
|
940
974
|
"bytedance-pro-fast",
|
|
941
975
|
"happyhorse-ref2v",
|
|
976
|
+
"vidu-q4",
|
|
942
977
|
// Replicate disabled
|
|
943
978
|
// "runway",
|
|
944
979
|
// "pika",
|
|
@@ -1024,8 +1059,16 @@ export function resolveVideoProviderForMode(
|
|
|
1024
1059
|
* `grok` → silently dropped (#861). When refs are present and ONLY the i2v
|
|
1025
1060
|
* twin can carry them, the run is image-to-video with the refs as its images.
|
|
1026
1061
|
* Derived from VIDEO_REF_LIMITS_BY_PROVIDER (= the catalog's `reference-image`
|
|
1027
|
-
* feature), never from a provider name
|
|
1028
|
-
*
|
|
1062
|
+
* feature), never from a provider name.
|
|
1063
|
+
*
|
|
1064
|
+
* A SINGLE-id model with no text-to-video mode is the other nuance: its t2v
|
|
1065
|
+
* lane is image-gated (VIDEO_PROVIDERS_REQUIRING_IMAGE), so a references-only
|
|
1066
|
+
* run sent there was refused even when the provider runs happily from
|
|
1067
|
+
* references alone (Vidu Q4, HappyHorse Ref2V). When the catalog declares the
|
|
1068
|
+
* `reference-to-video` capability ({@link videoProviderRunsFromReferences}),
|
|
1069
|
+
* such a run takes the image-to-video lane with the refs as its images —
|
|
1070
|
+
* exactly what `/v1/generate-video` already did for the direct API. A single-id
|
|
1071
|
+
* model WITH a text-to-video mode keeps the t2v lane, which carries its refs.
|
|
1029
1072
|
*/
|
|
1030
1073
|
export function resolveVideoModeForInputs(
|
|
1031
1074
|
provider: string | undefined,
|
|
@@ -1035,11 +1078,85 @@ export function resolveVideoModeForInputs(
|
|
|
1035
1078
|
if (!provider || !inputs.hasImageRefs) return "text-to-video"
|
|
1036
1079
|
const i2v = resolveVideoProviderForMode(provider, "image-to-video")
|
|
1037
1080
|
const t2v = resolveVideoProviderForMode(provider, "text-to-video")
|
|
1038
|
-
if (i2v === t2v)
|
|
1081
|
+
if (i2v === t2v) {
|
|
1082
|
+
const entry = MODEL_CATALOG[i2v]
|
|
1083
|
+
const noTextMode = !!entry && !(entry.modes as readonly string[]).includes("t2v")
|
|
1084
|
+
return noTextMode && videoProviderRunsFromReferences(i2v) ? "image-to-video" : "text-to-video"
|
|
1085
|
+
}
|
|
1039
1086
|
const carriesImageRefs = (id: string) => (VIDEO_REF_LIMITS_BY_PROVIDER[id]?.images ?? 0) > 0
|
|
1040
1087
|
return carriesImageRefs(i2v) && !carriesImageRefs(t2v) ? "image-to-video" : "text-to-video"
|
|
1041
1088
|
}
|
|
1042
1089
|
|
|
1090
|
+
/** The prompt syntax a video provider addresses its images in, by array order. */
|
|
1091
|
+
export type VideoReferenceSyntax = "@image_N" | "@image(n)" | "[Image N]"
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* The syntax this video model's frame / identity binding sentences are written
|
|
1095
|
+
* in — the catalog's `referenceSyntax`, else the platform's `@image_N`. One
|
|
1096
|
+
* descriptor for the app's resolvers and for a client (the cloud plugins) that
|
|
1097
|
+
* cites references by ordinal.
|
|
1098
|
+
*/
|
|
1099
|
+
export function videoProviderReferenceSyntax(provider: string | undefined): VideoReferenceSyntax {
|
|
1100
|
+
return (provider ? MODEL_CATALOG[provider]?.referenceSyntax : undefined) ?? "@image_N"
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Reference-capable video models whose start/end frames ride a channel of
|
|
1105
|
+
* their OWN (separate frame parameters next to the reference list), so a frame
|
|
1106
|
+
* never occupies a reference seat. `kling-3-omni` (Replicate `start_image` /
|
|
1107
|
+
* `end_image`) is the only one — and it has no dispatch path today.
|
|
1108
|
+
*/
|
|
1109
|
+
export const VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL: ReadonlySet<string> = new Set([
|
|
1110
|
+
"kling-3-omni",
|
|
1111
|
+
])
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* True when this video model puts a start (and end) frame AFTER the caller's
|
|
1115
|
+
* own reference images in ONE shared image list, bound in the prompt as the
|
|
1116
|
+
* opening / closing frame in its own syntax — the platform convention, so the
|
|
1117
|
+
* caller's image token N always means their Nth reference. At the image cap
|
|
1118
|
+
* the frames are kept and trailing caller references are dropped.
|
|
1119
|
+
*
|
|
1120
|
+
* Every reference-capable video model, except one whose frames ride a separate
|
|
1121
|
+
* channel ({@link VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL}).
|
|
1122
|
+
*/
|
|
1123
|
+
export function videoProviderAppendsFrames(provider: string | undefined): boolean {
|
|
1124
|
+
if (!provider) return false
|
|
1125
|
+
const entry = MODEL_CATALOG[provider]
|
|
1126
|
+
return !!entry && entry.kind === "video" &&
|
|
1127
|
+
entry.features?.includes("reference-image") === true &&
|
|
1128
|
+
!VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL.has(provider)
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* How many of a reference run's image seats the wired frames take on this
|
|
1133
|
+
* model: the start frame, plus the end frame where the model takes one (the
|
|
1134
|
+
* catalog `end-frame` feature). 0 on a model whose frames do not share its
|
|
1135
|
+
* reference list. A caller budgeting its own references subtracts this from
|
|
1136
|
+
* the provider's image cap so no reference of its is dropped.
|
|
1137
|
+
*/
|
|
1138
|
+
export function videoProviderRefModeFrameSeats(
|
|
1139
|
+
provider: string | undefined,
|
|
1140
|
+
frames: { readonly hasStartFrame: boolean; readonly hasEndFrame: boolean },
|
|
1141
|
+
): number {
|
|
1142
|
+
if (!provider) return 0
|
|
1143
|
+
if (!videoProviderAppendsFrames(provider)) return 0
|
|
1144
|
+
const start = frames.hasStartFrame ? 1 : 0
|
|
1145
|
+
const end = frames.hasEndFrame && MODEL_CATALOG[provider]?.features?.includes("end-frame") === true ? 1 : 0
|
|
1146
|
+
return start + end
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* True when the model's provider endpoint runs from reference images ALONE —
|
|
1151
|
+
* no start frame (the catalog's `reference-to-video` feature, declared only on
|
|
1152
|
+
* provider-spec evidence). The single capability every surface reads to decide
|
|
1153
|
+
* whether wired references satisfy "needs an image": the mode resolver above,
|
|
1154
|
+
* and through it the editor gate, the browser DAG and the orchestrator.
|
|
1155
|
+
*/
|
|
1156
|
+
export function videoProviderRunsFromReferences(provider: string | undefined): boolean {
|
|
1157
|
+
return !!provider && MODEL_CATALOG[provider]?.features?.includes("reference-to-video") === true
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1043
1160
|
/**
|
|
1044
1161
|
* t2v twin ids hidden from the unified Generate Video picker — the i2v/base
|
|
1045
1162
|
* entry already represents both modes (execution remaps by image presence).
|
|
@@ -1631,6 +1748,9 @@ export const DURATION_PRICED_PROVIDERS = new Set([
|
|
|
1631
1748
|
// this gate is consulted.
|
|
1632
1749
|
"wan-3",
|
|
1633
1750
|
"wan-3-prime",
|
|
1751
|
+
// Vidu Q4 — per-second billing at five resolution rates, identical on both
|
|
1752
|
+
// endpoints and with audio on or off.
|
|
1753
|
+
"vidu-q4",
|
|
1634
1754
|
])
|
|
1635
1755
|
|
|
1636
1756
|
/**
|
|
@@ -1736,6 +1856,45 @@ export function normalizeWan3Resolution(resolution: string | undefined): "480P"
|
|
|
1736
1856
|
}
|
|
1737
1857
|
}
|
|
1738
1858
|
|
|
1859
|
+
/**
|
|
1860
|
+
* Vidu Q4 family — the KIE "vidu-q4" market model. One Nodaro id covers two KIE
|
|
1861
|
+
* endpoints (image-to-video / reference-to-video); the provider layer picks the
|
|
1862
|
+
* endpoint by which inputs are wired. Exact-membership set, like the other
|
|
1863
|
+
* family predicates.
|
|
1864
|
+
*/
|
|
1865
|
+
export const VIDU_Q4_PROVIDERS = new Set<string>([
|
|
1866
|
+
"vidu-q4",
|
|
1867
|
+
])
|
|
1868
|
+
|
|
1869
|
+
export function isViduQ4Provider(provider: string | undefined): boolean {
|
|
1870
|
+
return !!provider && VIDU_Q4_PROVIDERS.has(provider)
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
/** Vidu Q4 resolution the platform renders when the param is omitted or
|
|
1874
|
+
* unknown — the tier the bare credit identifier prices (also KIE's own
|
|
1875
|
+
* default). Never `resolutions[0]`, which is the cheaper 540p. */
|
|
1876
|
+
export const VIDU_Q4_DEFAULT_RESOLUTION = "720p"
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* SINGLE normalization for the Vidu Q4 resolution lever. The KIE wire enum is
|
|
1880
|
+
* LOWERCASE ("540p" | "720p" | "1080p" | "2k" | "4k") — the same spelling as
|
|
1881
|
+
* the catalog and every credit identifier — so this only folds case and
|
|
1882
|
+
* collapses anything else (undefined, garbage, a stale "480p") to
|
|
1883
|
+
* {@link VIDU_Q4_DEFAULT_RESOLUTION}. The provider layer sends what this
|
|
1884
|
+
* returns and the credit identifier bills what this returns, so the two can
|
|
1885
|
+
* never disagree.
|
|
1886
|
+
*/
|
|
1887
|
+
export function normalizeViduQ4Resolution(resolution: string | undefined): "540p" | "720p" | "1080p" | "2k" | "4k" {
|
|
1888
|
+
switch (resolution?.trim().toLowerCase()) {
|
|
1889
|
+
case "540p": return "540p"
|
|
1890
|
+
case "1080p": return "1080p"
|
|
1891
|
+
case "2k": return "2k"
|
|
1892
|
+
case "4k": return "4k"
|
|
1893
|
+
case "720p": return "720p"
|
|
1894
|
+
default: return VIDU_Q4_DEFAULT_RESOLUTION
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1739
1898
|
/**
|
|
1740
1899
|
* Google Gemini Omni family — the KIE "gemini-omni-video" market model and its
|
|
1741
1900
|
* faster/cheaper "google/gemini-omni-flash-1-1" sibling. Both take the SAME
|
|
@@ -2148,6 +2307,70 @@ export function findSeedance2AudioOverLimit(
|
|
|
2148
2307
|
return null
|
|
2149
2308
|
}
|
|
2150
2309
|
|
|
2310
|
+
/** A provider's documented contract for each REFERENCE AUDIO clip. */
|
|
2311
|
+
export interface RefAudioRule {
|
|
2312
|
+
/** Accepted containers, as ffprobe's `format_name` spells them ("mp3"). */
|
|
2313
|
+
formats?: readonly string[]
|
|
2314
|
+
minSec?: number
|
|
2315
|
+
maxSec?: number
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Reference-audio rules that apply on EVERY lane — the video routes' preHandler
|
|
2320
|
+
* and the DAG's `executeWorkerNode` both run `checkRefAudioRules` before any
|
|
2321
|
+
* reservation, so a clip the provider would refuse never costs a run.
|
|
2322
|
+
*
|
|
2323
|
+
* Data-driven like VIDEO_REF_VIDEO_DURATION_LIMITS: only providers with a
|
|
2324
|
+
* DOCUMENTED rule are listed. (The older max-only
|
|
2325
|
+
* SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER above is checked by the routes
|
|
2326
|
+
* alone.)
|
|
2327
|
+
*
|
|
2328
|
+
* Vidu Q4: "MP3 only, each 3-12 seconds and up to 50 MB"
|
|
2329
|
+
* (docs.kie.ai/market/vidu-q4/reference-to-video). Nothing converts a clip for
|
|
2330
|
+
* it, so a WAV / M4A from the audio tray is refused with a clear message rather
|
|
2331
|
+
* than failing at the provider.
|
|
2332
|
+
*/
|
|
2333
|
+
export const VIDEO_REF_AUDIO_RULES: Record<string, RefAudioRule | undefined> = {
|
|
2334
|
+
"vidu-q4": { formats: ["mp3"], minSec: 3, maxSec: 12 },
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
/** One probed reference-audio clip. A field the probe could not read is absent. */
|
|
2338
|
+
export interface RefAudioProbe {
|
|
2339
|
+
/** ffprobe `format_name`, split on commas ("mp3", "wav", "mov,mp4,m4a,…"). */
|
|
2340
|
+
formatNames?: readonly string[]
|
|
2341
|
+
durationSec?: number
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
export type RefAudioCheck =
|
|
2345
|
+
| { ok: true }
|
|
2346
|
+
| { ok: false; code: "audio_format_unsupported" | "audio_too_short" | "audio_too_long"; message: string }
|
|
2347
|
+
|
|
2348
|
+
/**
|
|
2349
|
+
* Check probed reference-audio clips against {@link VIDEO_REF_AUDIO_RULES}.
|
|
2350
|
+
* An unreadable field is IGNORED, never rejected — a probe blip must not block
|
|
2351
|
+
* a legal run (the provider still has the final say).
|
|
2352
|
+
*/
|
|
2353
|
+
export function checkRefAudioRules(provider: string | undefined, probes: readonly RefAudioProbe[]): RefAudioCheck {
|
|
2354
|
+
const rule = provider ? VIDEO_REF_AUDIO_RULES[provider] : undefined
|
|
2355
|
+
if (!rule) return { ok: true }
|
|
2356
|
+
for (const [i, p] of probes.entries()) {
|
|
2357
|
+
const n = i + 1
|
|
2358
|
+
if (rule.formats && p.formatNames && p.formatNames.length > 0 && !p.formatNames.some((f) => rule.formats!.includes(f))) {
|
|
2359
|
+
const want = rule.formats.map((f) => f.toUpperCase()).join(" or ")
|
|
2360
|
+
return { ok: false, code: "audio_format_unsupported", message: `Reference audio ${n} must be ${want} for this model. Convert the clip to ${want} and try again.` }
|
|
2361
|
+
}
|
|
2362
|
+
const d = p.durationSec
|
|
2363
|
+
if (d === undefined || !Number.isFinite(d) || d <= 0) continue
|
|
2364
|
+
if (rule.minSec !== undefined && d < rule.minSec) {
|
|
2365
|
+
return { ok: false, code: "audio_too_short", message: `Reference audio ${n} is too short for this model: ${d.toFixed(1)}s is under the ${rule.minSec}s minimum.` }
|
|
2366
|
+
}
|
|
2367
|
+
if (rule.maxSec !== undefined && d > rule.maxSec) {
|
|
2368
|
+
return { ok: false, code: "audio_too_long", message: `Reference audio ${n} is too long for this model: ${d.toFixed(1)}s exceeds the ${rule.maxSec}s limit. Please use a shorter audio clip.` }
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
return { ok: true }
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2151
2374
|
/**
|
|
2152
2375
|
* Per-provider connection caps for the typed reference handles on Generate Video
|
|
2153
2376
|
* AND the cap for the server-side `connectedReferences` assembly (`imageCap`).
|
|
@@ -2182,6 +2405,10 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
2182
2405
|
// provider (docs.kie.ai/market/wan/3-0-video).
|
|
2183
2406
|
"wan-3": { images: 10, videos: 5, audio: 5 },
|
|
2184
2407
|
"wan-3-prime": { images: 10, videos: 5, audio: 5 },
|
|
2408
|
+
// Vidu Q4 — reference-to-video takes 1-15 reference images and up to 3
|
|
2409
|
+
// reference audio clips (MP3 only, each 3-12s — VIDEO_REF_AUDIO_RULES), and
|
|
2410
|
+
// no reference videos (docs.kie.ai/market/vidu-q4/reference-to-video).
|
|
2411
|
+
"vidu-q4": { images: 15, audio: 3 },
|
|
2185
2412
|
// Multi-image reference providers.
|
|
2186
2413
|
// `characters` = the dedicated identity input (KIE `character_ids`, max 3).
|
|
2187
2414
|
// It is NOT an image-reference lane: it draws from the SAME 7-unit budget as
|
|
@@ -2336,6 +2563,11 @@ export const RESOLUTION_DURATION_PRICING: Record<string, readonly string[]> = {
|
|
|
2336
2563
|
// the provider layer pins the same 720P so render == billed.
|
|
2337
2564
|
"wan-3": ["480p", "720p", "1080p"],
|
|
2338
2565
|
"wan-3-prime": ["480p", "720p", "1080p"],
|
|
2566
|
+
// Vidu Q4 — per-second billing at five resolution rates, one ladder for both
|
|
2567
|
+
// endpoints. Ascending; the billed default (720p) is declared in
|
|
2568
|
+
// PRICING_DEFAULT_RESOLUTION, and normalizeViduQ4Resolution pins the same
|
|
2569
|
+
// 720p at the wire.
|
|
2570
|
+
"vidu-q4": ["540p", "720p", "1080p", "2k", "4k"],
|
|
2339
2571
|
}
|
|
2340
2572
|
|
|
2341
2573
|
/**
|
|
@@ -2558,6 +2790,12 @@ export const VIDEO_AUDIO_CAPABILITY: Record<string, VideoAudioCapability> = {
|
|
|
2558
2790
|
// per-second rate, so NOT cost-affecting (no `:audio` composite).
|
|
2559
2791
|
"wan-3": { mode: "ambient", field: "audio", defaultOn: true },
|
|
2560
2792
|
"wan-3-prime": { mode: "ambient", field: "audio", defaultOn: true },
|
|
2793
|
+
// Vidu Q4 — the same boolean `audio` lever (KIE default true). The schema
|
|
2794
|
+
// says "dialogue and sound effects", but classified "ambient" on the Wan 3.0
|
|
2795
|
+
// rule: no live probe has verified lip-synced speech, and `native_speech` /
|
|
2796
|
+
// `audio_driven` would reroute the Story→Video dialogue pipeline. Audio is
|
|
2797
|
+
// priced into the uniform per-second rate (no `:audio` composite).
|
|
2798
|
+
"vidu-q4": { mode: "ambient", field: "audio", defaultOn: true },
|
|
2561
2799
|
// Gemini Omni (both SKUs — the pro `gemini-omni-video` and the faster
|
|
2562
2800
|
// `gemini-omni-flash`; one model at two speeds, so their rows are identical
|
|
2563
2801
|
// and a test pins that). Settled 2026-09-03 from Google's own documentation
|
|
@@ -2723,6 +2961,9 @@ export const VIDEO_VARIABLE_PRICING: Record<string, "duration" | "duration+audio
|
|
|
2723
2961
|
// entry, mirroring gemini-omni-video which has none either.
|
|
2724
2962
|
"wan-3": "duration+resolution",
|
|
2725
2963
|
"wan-3-prime": "duration+resolution",
|
|
2964
|
+
// Vidu Q4 — per-second billing at five resolution rates; no reference or
|
|
2965
|
+
// audio dimension.
|
|
2966
|
+
"vidu-q4": "duration+resolution",
|
|
2726
2967
|
}
|
|
2727
2968
|
|
|
2728
2969
|
/**
|
|
@@ -2835,6 +3076,9 @@ export const PRICING_DEFAULT_RESOLUTION: Record<string, string> = {
|
|
|
2835
3076
|
// first tier, so the catalog can stay ascending without repricing anything.
|
|
2836
3077
|
"wan-3": "720p",
|
|
2837
3078
|
"wan-3-prime": "720p",
|
|
3079
|
+
// Vidu Q4 — KIE renders 720p when `resolution` is omitted, and
|
|
3080
|
+
// normalizeViduQ4Resolution pins the same tier for anything unknown.
|
|
3081
|
+
"vidu-q4": "720p",
|
|
2838
3082
|
}
|
|
2839
3083
|
|
|
2840
3084
|
/** HappyHorse 1.1 per-second tiers — one per allowed duration (3–15s), shared
|
|
@@ -2874,6 +3118,16 @@ const WAN_3_DURATION_TIERS: Array<{ maxSeconds: number; suffix: string }> = Arra
|
|
|
2874
3118
|
(_, i) => ({ maxSeconds: i + 2, suffix: `${i + 2}s` }),
|
|
2875
3119
|
)
|
|
2876
3120
|
|
|
3121
|
+
/**
|
|
3122
|
+
* Vidu Q4 per-second tiers — one per allowed duration (3-16s). Per-second for
|
|
3123
|
+
* the same reason as Wan 3.0: a coarse ladder would snap a long render down to
|
|
3124
|
+
* a shorter tier's price, which `commit_credits` can never collect afterwards.
|
|
3125
|
+
*/
|
|
3126
|
+
const VIDU_Q4_DURATION_TIERS: Array<{ maxSeconds: number; suffix: string }> = Array.from(
|
|
3127
|
+
{ length: 14 },
|
|
3128
|
+
(_, i) => ({ maxSeconds: i + 3, suffix: `${i + 3}s` }),
|
|
3129
|
+
)
|
|
3130
|
+
|
|
2877
3131
|
/**
|
|
2878
3132
|
* Duration tier breakpoints for variable-priced video models.
|
|
2879
3133
|
* Maps provider → array of { maxSeconds, suffix } in ascending order.
|
|
@@ -2956,6 +3210,7 @@ export const VIDEO_DURATION_TIERS: Record<string, Array<{ maxSeconds: number; su
|
|
|
2956
3210
|
"seedance-2-5": SEEDANCE_2_5_DURATION_TIERS,
|
|
2957
3211
|
"wan-3": WAN_3_DURATION_TIERS,
|
|
2958
3212
|
"wan-3-prime": WAN_3_DURATION_TIERS,
|
|
3213
|
+
"vidu-q4": VIDU_Q4_DURATION_TIERS,
|
|
2959
3214
|
// MiniMax Hailuo 3 — true per-second billing (KIE 36.5 cr/s @2K, 22.5 cr/s
|
|
2960
3215
|
// @768P). One tier per allowed second (4-15s) so the composite identifier
|
|
2961
3216
|
// maps 1:1 to the seeded price — no rounding/overcharge for any on-menu
|
|
@@ -199,6 +199,9 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
199
199
|
// uppercase KIE wire form is produced only by normalizeWan3Resolution).
|
|
200
200
|
"wan-3": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
|
201
201
|
"wan-3-prime": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
|
202
|
+
// Vidu Q4 — five tiers; the quality rungs stop at 1080p so "high" never
|
|
203
|
+
// lands on the 2k/4k ladder (4k is closed to the free tier).
|
|
204
|
+
"vidu-q4": { field: "resolution", values: { low: "540p", mid: "720p", high: "1080p" } },
|
|
202
205
|
"wan-2.7-i2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
203
206
|
"wan-2.7-t2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
204
207
|
"happyhorse": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
@@ -134,6 +134,12 @@ export function presetLeverClearKeys(
|
|
|
134
134
|
* - `__promptFinalView`: field keys currently showing the final-prompt view (Edit ⇄ Final
|
|
135
135
|
* per-field toggle). Node-local UI state, never part of a preset's own config.
|
|
136
136
|
*
|
|
137
|
+
* Editor-only memory:
|
|
138
|
+
* - `settingsBeforeAudio`: the picture settings an audio recording turned off on a use-case node
|
|
139
|
+
* (Tighten Episode, Clip Pack), kept to give back when a video is wired again. It belongs to
|
|
140
|
+
* THIS node's wiring, never a reusable configuration — a preset applied elsewhere would hand
|
|
141
|
+
* another node values to restore on its next video wire.
|
|
142
|
+
*
|
|
137
143
|
* NOTE: manual reference image urls (`referenceImageUrl` / `referenceImageUrls`) are deliberately
|
|
138
144
|
* KEPT — they are self-contained R2 urls a user set as input, and portable across nodes.
|
|
139
145
|
*
|
|
@@ -157,6 +163,8 @@ export const PRESET_EXCLUDED_KEYS: ReadonlySet<string> = new Set([
|
|
|
157
163
|
"suppressedCanonicalLocationIds",
|
|
158
164
|
"identityMeta",
|
|
159
165
|
"extraRefs",
|
|
166
|
+
// editor-only memory of the node's own wiring (an audio recording's lock)
|
|
167
|
+
"settingsBeforeAudio",
|
|
160
168
|
// structural identifiers
|
|
161
169
|
"routes",
|
|
162
170
|
"routeId",
|
package/src/pipeline-types.ts
CHANGED
|
@@ -96,6 +96,9 @@ export type PipelinePinnableVideoModel = (typeof PIPELINE_PINNABLE_VIDEO_MODELS)
|
|
|
96
96
|
// through `lib/llm-client.ts` first; until then, keep this list tight.
|
|
97
97
|
export const PIPELINE_PINNABLE_SCRIPT_LLMS = [
|
|
98
98
|
"claude-haiku-5-5",
|
|
99
|
+
// The pipeline's own default (Auto) since 2026-10-16; callLLM asks it with
|
|
100
|
+
// tool_choice auto, as it refuses a forced tool choice.
|
|
101
|
+
"claude-sonnet-5-5",
|
|
99
102
|
"claude-sonnet-4-6",
|
|
100
103
|
"claude-opus-4-7",
|
|
101
104
|
"claude-opus-5",
|