@nodaro/shared 3.65.0 → 3.66.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-GJ3D5X4X.cjs → chunk-23IKLMRL.cjs} +41 -41
- package/dist/{chunk-GJ3D5X4X.cjs.map → chunk-23IKLMRL.cjs.map} +1 -1
- package/dist/{chunk-E66HSC2E.cjs → chunk-37ZSFS6A.cjs} +9 -9
- package/dist/{chunk-E66HSC2E.cjs.map → chunk-37ZSFS6A.cjs.map} +1 -1
- package/dist/{chunk-K6RIN3LW.cjs → chunk-3L7GMQ4M.cjs} +47 -47
- package/dist/chunk-3L7GMQ4M.cjs.map +1 -0
- package/dist/{chunk-YMZUE2IX.js → chunk-3QJ3UR5Z.js} +9 -9
- package/dist/{chunk-YMZUE2IX.js.map → chunk-3QJ3UR5Z.js.map} +1 -1
- package/dist/{chunk-Q4YOLT4M.js → chunk-3YWZ5SOZ.js} +5 -5
- package/dist/{chunk-Q4YOLT4M.js.map → chunk-3YWZ5SOZ.js.map} +1 -1
- package/dist/{chunk-2NKF476Z.js → chunk-5GG4CG4Y.js} +3 -3
- package/dist/{chunk-2NKF476Z.js.map → chunk-5GG4CG4Y.js.map} +1 -1
- package/dist/{chunk-ZSRXY5YT.js → chunk-5IZHECUP.js} +3 -3
- package/dist/{chunk-ZSRXY5YT.js.map → chunk-5IZHECUP.js.map} +1 -1
- package/dist/{chunk-D5Y3EYRM.js → chunk-5J2LIQYU.js} +5 -5
- package/dist/{chunk-D5Y3EYRM.js.map → chunk-5J2LIQYU.js.map} +1 -1
- package/dist/{chunk-BSTAAGLY.js → chunk-5LWYX4GV.js} +3 -3
- package/dist/{chunk-BSTAAGLY.js.map → chunk-5LWYX4GV.js.map} +1 -1
- package/dist/{chunk-JYU5EIRM.cjs → chunk-66QSUUB4.cjs} +12 -12
- package/dist/{chunk-JYU5EIRM.cjs.map → chunk-66QSUUB4.cjs.map} +1 -1
- package/dist/{chunk-7BN4EDIC.cjs → chunk-BMDOPJBP.cjs} +17 -17
- package/dist/{chunk-7BN4EDIC.cjs.map → chunk-BMDOPJBP.cjs.map} +1 -1
- package/dist/{chunk-222QM7CO.js → chunk-BNR5FKL5.js} +3 -3
- package/dist/{chunk-222QM7CO.js.map → chunk-BNR5FKL5.js.map} +1 -1
- package/dist/{chunk-FI3HJZWM.cjs → chunk-E62W5I6A.cjs} +6 -2
- package/dist/chunk-E62W5I6A.cjs.map +1 -0
- package/dist/{chunk-MIT2USTS.cjs → chunk-EFYWV2V5.cjs} +61 -61
- package/dist/{chunk-MIT2USTS.cjs.map → chunk-EFYWV2V5.cjs.map} +1 -1
- package/dist/{chunk-RP4KQUNU.cjs → chunk-F6XIH3TZ.cjs} +9 -9
- package/dist/{chunk-RP4KQUNU.cjs.map → chunk-F6XIH3TZ.cjs.map} +1 -1
- package/dist/{chunk-KTCEKGBJ.cjs → chunk-G2G7XGFU.cjs} +7 -7
- package/dist/{chunk-KTCEKGBJ.cjs.map → chunk-G2G7XGFU.cjs.map} +1 -1
- package/dist/{chunk-HAH2F7LT.js → chunk-GF7ZA26H.js} +4 -4
- package/dist/{chunk-HAH2F7LT.js.map → chunk-GF7ZA26H.js.map} +1 -1
- package/dist/{chunk-FJZTQTF4.cjs → chunk-GNLA5NTT.cjs} +4 -4
- package/dist/{chunk-FJZTQTF4.cjs.map → chunk-GNLA5NTT.cjs.map} +1 -1
- package/dist/{chunk-ST7OBB5J.js → chunk-GTBW2KAY.js} +4 -4
- package/dist/{chunk-ST7OBB5J.js.map → chunk-GTBW2KAY.js.map} +1 -1
- package/dist/{chunk-R5ILCNCC.cjs → chunk-HTDKEYMY.cjs} +75 -75
- package/dist/{chunk-R5ILCNCC.cjs.map → chunk-HTDKEYMY.cjs.map} +1 -1
- package/dist/{chunk-DQ2PARNH.cjs → chunk-IWUW3YPM.cjs} +5 -5
- package/dist/{chunk-DQ2PARNH.cjs.map → chunk-IWUW3YPM.cjs.map} +1 -1
- package/dist/{chunk-6OSIOVF7.cjs → chunk-JTYCJ5OL.cjs} +16 -16
- package/dist/{chunk-6OSIOVF7.cjs.map → chunk-JTYCJ5OL.cjs.map} +1 -1
- package/dist/{chunk-JQMFJAYU.cjs → chunk-M5QY464F.cjs} +21 -21
- package/dist/{chunk-JQMFJAYU.cjs.map → chunk-M5QY464F.cjs.map} +1 -1
- package/dist/{chunk-CW6MMQNO.js → chunk-MVXZP6VB.js} +6 -2
- package/dist/chunk-MVXZP6VB.js.map +1 -0
- package/dist/{chunk-H745DQ6V.js → chunk-OFQ6CU6S.js} +3 -3
- package/dist/{chunk-H745DQ6V.js.map → chunk-OFQ6CU6S.js.map} +1 -1
- package/dist/{chunk-XJANKTIL.js → chunk-OXBU5AGH.js} +3 -3
- package/dist/{chunk-XJANKTIL.js.map → chunk-OXBU5AGH.js.map} +1 -1
- package/dist/{chunk-SPU7MUWE.cjs → chunk-OXTF4Y3P.cjs} +6 -6
- package/dist/{chunk-SPU7MUWE.cjs.map → chunk-OXTF4Y3P.cjs.map} +1 -1
- package/dist/{chunk-5SSMPYE5.js → chunk-PAUWEWTY.js} +5 -5
- package/dist/chunk-PAUWEWTY.js.map +1 -0
- package/dist/{chunk-KWYS4IIM.cjs → chunk-PJAJCFLP.cjs} +49 -38
- package/dist/chunk-PJAJCFLP.cjs.map +1 -0
- package/dist/{chunk-7OWXHW7Z.js → chunk-RVQW623D.js} +6 -6
- package/dist/{chunk-7OWXHW7Z.js.map → chunk-RVQW623D.js.map} +1 -1
- package/dist/{chunk-V5NLQ4L5.js → chunk-SCDE676D.js} +5 -5
- package/dist/{chunk-V5NLQ4L5.js.map → chunk-SCDE676D.js.map} +1 -1
- package/dist/{chunk-3AU52TSW.js → chunk-SW5ZD7BO.js} +3 -3
- package/dist/{chunk-3AU52TSW.js.map → chunk-SW5ZD7BO.js.map} +1 -1
- package/dist/{chunk-WQMPIURW.cjs → chunk-T4GIHHXY.cjs} +6 -6
- package/dist/{chunk-WQMPIURW.cjs.map → chunk-T4GIHHXY.cjs.map} +1 -1
- package/dist/{chunk-PL7AQQV7.js → chunk-VBP4DH37.js} +18 -10
- package/dist/chunk-VBP4DH37.js.map +1 -0
- package/dist/{chunk-YD4XY74W.cjs → chunk-X2YHKP4D.cjs} +8 -8
- package/dist/{chunk-YD4XY74W.cjs.map → chunk-X2YHKP4D.cjs.map} +1 -1
- package/dist/{chunk-6X5PBAC4.js → chunk-XEPKONJC.js} +3 -3
- package/dist/{chunk-6X5PBAC4.js.map → chunk-XEPKONJC.js.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +217 -217
- package/dist/entries/credits.d.cts +2 -2
- package/dist/entries/credits.d.ts +2 -2
- package/dist/entries/credits.js +9 -9
- package/dist/entries/llm-models.d.cts +2 -2
- package/dist/entries/llm-models.d.ts +2 -2
- package/dist/entries/model-catalog.cjs +133 -133
- package/dist/entries/model-catalog.d.cts +3 -3
- package/dist/entries/model-catalog.d.ts +3 -3
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +403 -391
- package/dist/entries/models.d.cts +5 -5
- package/dist/entries/models.d.ts +5 -5
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +212 -212
- 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 +153 -153
- package/dist/entries/pipeline.d.cts +2 -2
- package/dist/entries/pipeline.d.ts +2 -2
- 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 +152 -152
- package/dist/entries/video.d.cts +15 -10
- package/dist/entries/video.d.ts +15 -10
- package/dist/entries/video.js +6 -6
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/index.cjs +1355 -1343
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -18
- package/dist/{model-catalog-BoUKGFNl.d.cts → model-catalog-B-aQnUS8.d.cts} +19 -1
- package/dist/{model-catalog-BoUKGFNl.d.ts → model-catalog-B-aQnUS8.d.ts} +19 -1
- package/dist/{model-constants-CpQz1bGa.d.cts → model-constants-BstsUup6.d.cts} +52 -2
- package/dist/{model-constants-BElS3AeE.d.ts → model-constants-DZ3tPGFO.d.ts} +52 -2
- package/dist/{tts-capabilities-BtnDWK9K.d.ts → tts-capabilities-BJ4N8MIB.d.ts} +1 -1
- package/dist/{tts-capabilities-C52UccTI.d.cts → tts-capabilities-Cf_4nu1Z.d.cts} +1 -1
- package/package.json +1 -1
- package/src/__tests__/flux-3-klein.test.ts +51 -3
- package/src/__tests__/image-run-limit.test.ts +96 -0
- package/src/__tests__/kling4-catalog.test.ts +1 -1
- package/src/__tests__/seedream-5-5.test.ts +17 -0
- package/src/__tests__/video-subjects.test.ts +33 -16
- package/src/entries/models.ts +4 -0
- package/src/model-catalog.ts +24 -2
- package/src/model-constants.ts +72 -6
- package/src/video-character-refs.ts +15 -10
- package/dist/chunk-5SSMPYE5.js.map +0 -1
- package/dist/chunk-CW6MMQNO.js.map +0 -1
- package/dist/chunk-FI3HJZWM.cjs.map +0 -1
- package/dist/chunk-K6RIN3LW.cjs.map +0 -1
- package/dist/chunk-KWYS4IIM.cjs.map +0 -1
- package/dist/chunk-PL7AQQV7.js.map +0 -1
package/src/model-catalog.ts
CHANGED
|
@@ -34,7 +34,7 @@ import { MINIMAX_H3_IMAGE_DEFAULT_RESOLUTION, MINIMAX_H3_IMAGE_RESOLUTIONS } fro
|
|
|
34
34
|
import { isAutoVideoDuration } from "./video-duration-auto.js"
|
|
35
35
|
import type { DeclaredSeedanceTaskType } from "./seedance-task-type.js"
|
|
36
36
|
import { SEEDREAM_5_5_DEFAULT_RESOLUTION, SEEDREAM_5_5_RESOLUTIONS } from "./seedream-5-5.js"
|
|
37
|
-
import { FLUX_3_KLEIN_RESOLUTIONS } from "./flux-3-klein.js"
|
|
37
|
+
import { FLUX_3_KLEIN_DEFAULT_RESOLUTION, FLUX_3_KLEIN_RESOLUTIONS } from "./flux-3-klein.js"
|
|
38
38
|
import {
|
|
39
39
|
GEMINI_3_1_DEFAULT_VOICE,
|
|
40
40
|
GEMINI_3_1_TTS_ACCENTS,
|
|
@@ -416,6 +416,23 @@ export interface ModelCatalogEntryFields {
|
|
|
416
416
|
* `audio_to_video` task). The node's Audio Refs input then takes one clip.
|
|
417
417
|
*/
|
|
418
418
|
features?: readonly string[]
|
|
419
|
+
/**
|
|
420
|
+
* A WORKFLOW run that would send this image model more input images than
|
|
421
|
+
* `requestImageLimit` allows, the source or base image counted, is refused
|
|
422
|
+
* before anything is reserved, with a message saying how many to remove
|
|
423
|
+
* (`refusesImagesOverLimit`), as a request is. Nothing trims it first: the
|
|
424
|
+
* prompt assembler sends every image a run attaches, so the count refused
|
|
425
|
+
* is the count the run would send. Set on FLUX 3 Klein, text to image and
|
|
426
|
+
* edit alike (decided 2026-11-12: an 11th image is refused, never left out).
|
|
427
|
+
*
|
|
428
|
+
* Without it, a model with a request image limit of its own (Seedream 5.5,
|
|
429
|
+
* GPT Image 2.6 Flare and Sunburst, MiniMax H3 Image) refuses a request
|
|
430
|
+
* over its limit but a workflow run sends its first images up to it
|
|
431
|
+
* (`refusesImagesOverLimitOn`, decided 2026-11-14), and every other model
|
|
432
|
+
* has its structured references trimmed past its reference limit, as it
|
|
433
|
+
* always has.
|
|
434
|
+
*/
|
|
435
|
+
refusesImagesOverLimit?: true
|
|
419
436
|
/**
|
|
420
437
|
* How this video model's provider addresses its images in the prompt, by
|
|
421
438
|
* array order — the syntax its frame / identity binding sentences are written
|
|
@@ -485,7 +502,8 @@ export interface ModelCatalogEntryFields {
|
|
|
485
502
|
*/
|
|
486
503
|
resolutionsByAspectRatio?: Readonly<Record<string, readonly string[]>>
|
|
487
504
|
/** The resolution a caller who names none lands on when it is not the
|
|
488
|
-
* cheapest entry (see `defaultResolutionFor`).
|
|
505
|
+
* cheapest entry (see `defaultResolutionFor`). `GET /v1/models` and MCP
|
|
506
|
+
* `list_models` serve it as declared, on the models that declare it. */
|
|
489
507
|
defaultResolution?: string
|
|
490
508
|
/**
|
|
491
509
|
* What this model actually RENDERS for a resolution outside `resolutions`.
|
|
@@ -1104,9 +1122,11 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1104
1122
|
description: "FLUX 3 Klein - the light model of FLUX 3: fast and low cost, at 1K by default, 2K or 4K, in nine shapes, PNG or JPEG. Add images and it edits from up to 10 references, at the same price.",
|
|
1105
1123
|
useCases: ["fast", "drafts", "iteration", "realistic"],
|
|
1106
1124
|
features: ["reference-image"],
|
|
1125
|
+
refusesImagesOverLimit: true,
|
|
1107
1126
|
aspectRatios: FLUX_3_KLEIN_RATIOS,
|
|
1108
1127
|
strictAspectRatios: true,
|
|
1109
1128
|
resolutions: FLUX_3_KLEIN_RESOLUTIONS,
|
|
1129
|
+
defaultResolution: FLUX_3_KLEIN_DEFAULT_RESOLUTION,
|
|
1110
1130
|
outputFormats: FLUX_3_KLEIN_FORMATS,
|
|
1111
1131
|
pricing: [
|
|
1112
1132
|
{ identifier: "flux-3-klein", credits: 4, note: "1K default" },
|
|
@@ -1126,9 +1146,11 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
1126
1146
|
description: "FLUX 3 Klein edits - fast, low-cost changes from 1 to 10 reference images, which cost nothing extra. 1K by default, 2K or 4K, PNG or JPEG; auto keeps the first image's shape.",
|
|
1127
1147
|
useCases: ["edit", "iteration", "multi-reference", "fast"],
|
|
1128
1148
|
features: ["reference-image"],
|
|
1149
|
+
refusesImagesOverLimit: true,
|
|
1129
1150
|
aspectRatios: FLUX_3_KLEIN_I2I_RATIOS,
|
|
1130
1151
|
strictAspectRatios: true,
|
|
1131
1152
|
resolutions: FLUX_3_KLEIN_RESOLUTIONS,
|
|
1153
|
+
defaultResolution: FLUX_3_KLEIN_DEFAULT_RESOLUTION,
|
|
1132
1154
|
outputFormats: FLUX_3_KLEIN_FORMATS,
|
|
1133
1155
|
pricing: [
|
|
1134
1156
|
{ identifier: "flux-3-klein-i2i", credits: 4, note: "1K default" },
|
package/src/model-constants.ts
CHANGED
|
@@ -854,6 +854,13 @@ export const DEFAULT_REQUEST_IMAGE_LIMIT = 14
|
|
|
854
854
|
* 2.6 takes more; a model whose provider takes fewer (Seedream 5.5 and FLUX 3
|
|
855
855
|
* Klein: 10) is held to its own, so a request is refused before it is
|
|
856
856
|
* reserved instead of failing at the provider.
|
|
857
|
+
*
|
|
858
|
+
* A row here is also what makes a request over the limit refused rather than
|
|
859
|
+
* trimmed ({@link hasOwnRequestImageLimit}, decided 2026-11-14): the routes,
|
|
860
|
+
* MCP and the editor's Run send every image such a request names, and the
|
|
861
|
+
* route says how many to remove. A workflow run on such a model still sends
|
|
862
|
+
* its first images up to the limit, unless its catalog entry also refuses
|
|
863
|
+
* there ({@link refusesImagesOverLimit}).
|
|
857
864
|
*/
|
|
858
865
|
const REQUEST_IMAGE_LIMITS: Record<string, number> = {
|
|
859
866
|
"gpt-image-2-6-flare-i2i": 16,
|
|
@@ -875,6 +882,62 @@ export function requestImageLimit(provider: string | undefined): number {
|
|
|
875
882
|
return (effective !== undefined ? REQUEST_IMAGE_LIMITS[effective] : undefined) ?? DEFAULT_REQUEST_IMAGE_LIMIT
|
|
876
883
|
}
|
|
877
884
|
|
|
885
|
+
/**
|
|
886
|
+
* True for a model with a request image limit of its own: a row in the table
|
|
887
|
+
* above, read through a text-to-image id's edit sibling as
|
|
888
|
+
* {@link requestImageLimit} reads it (GPT Image 2.6 Flare and Sunburst,
|
|
889
|
+
* MiniMax H3 Image, Seedream 5.5, FLUX 3 Klein). False for a model held to
|
|
890
|
+
* {@link DEFAULT_REQUEST_IMAGE_LIMIT}.
|
|
891
|
+
*/
|
|
892
|
+
export function hasOwnRequestImageLimit(provider: string | undefined): boolean {
|
|
893
|
+
if (provider === undefined) return false
|
|
894
|
+
return Object.hasOwn(REQUEST_IMAGE_LIMITS, T2I_TO_I2I_VARIANT[provider] ?? provider)
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* True for a model that refuses a WORKFLOW run sending more input images than
|
|
899
|
+
* {@link requestImageLimit} allows, the source or base image counted, instead
|
|
900
|
+
* of having some left out (its catalog entry's `refusesImagesOverLimit`:
|
|
901
|
+
* FLUX 3 Klein). A request is refused on more models
|
|
902
|
+
* ({@link refusesImagesOverLimitOn}). The prompt assembler never trims such a
|
|
903
|
+
* model's references, so every place that refuses counts the images the run
|
|
904
|
+
* would really send. False for every other model, whose workflow runs still
|
|
905
|
+
* trim structured references to its reference limit
|
|
906
|
+
* ({@link imageReferenceLimit}).
|
|
907
|
+
*/
|
|
908
|
+
export function refusesImagesOverLimit(provider: string | undefined): boolean {
|
|
909
|
+
return provider !== undefined && MODEL_CATALOG[provider]?.refusesImagesOverLimit === true
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* How a run was asked for, which decides what happens to images past a
|
|
914
|
+
* model's limit: `"request"` is one call to a route (the API, an MCP tool,
|
|
915
|
+
* the editor's Run of one node), `"workflow"` a node of a workflow run.
|
|
916
|
+
*/
|
|
917
|
+
export type ImageRunKind = "request" | "workflow"
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* True when a run of this kind that would send `provider` more input images
|
|
921
|
+
* than {@link requestImageLimit} allows is refused before anything is
|
|
922
|
+
* reserved, saying how many to remove, rather than having the images past the
|
|
923
|
+
* limit left out (decided 2026-11-14):
|
|
924
|
+
*
|
|
925
|
+
* - a request, on every model with a request image limit of its own
|
|
926
|
+
* ({@link hasOwnRequestImageLimit}): nothing trims it first, so the count
|
|
927
|
+
* refused is the count the request names;
|
|
928
|
+
* - a workflow run, only on a model whose catalog entry carries
|
|
929
|
+
* `refusesImagesOverLimit` (FLUX 3 Klein). Every other model's workflow run
|
|
930
|
+
* keeps its rule: its first images up to the limit are sent, so a saved
|
|
931
|
+
* graph keeps running.
|
|
932
|
+
*
|
|
933
|
+
* False on a model held to {@link DEFAULT_REQUEST_IMAGE_LIMIT} (Nano Banana
|
|
934
|
+
* Pro, Flux 2 Pro): its structured references are trimmed to its reference
|
|
935
|
+
* limit on every kind of run, as before.
|
|
936
|
+
*/
|
|
937
|
+
export function refusesImagesOverLimitOn(provider: string | undefined, run: ImageRunKind): boolean {
|
|
938
|
+
return refusesImagesOverLimit(provider) || (run === "request" && hasOwnRequestImageLimit(provider))
|
|
939
|
+
}
|
|
940
|
+
|
|
878
941
|
// Variable pricing: which setting type affects cost per provider
|
|
879
942
|
export const VARIABLE_PRICING_MODELS: Record<string, "quality" | "resolution" | "rendering-speed"> = {
|
|
880
943
|
"gpt-image": "quality",
|
|
@@ -3217,6 +3280,11 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3217
3280
|
* and does not move the run onto the reference-video rate (its clip still
|
|
3218
3281
|
* counts toward the `videos` cap and the reference videos' total length).
|
|
3219
3282
|
* Read through `videoCharacterClipsBilledAsReferenceVideo`.
|
|
3283
|
+
*
|
|
3284
|
+
* No model sets it today: Kling 4.0 and Kling 4.0 Flash, both measured,
|
|
3285
|
+
* bill a video subject like an image subject (decided 2026-11-14). It stays
|
|
3286
|
+
* for a model whose provider bills the clip, so that model declares it here
|
|
3287
|
+
* and every price path follows.
|
|
3220
3288
|
*/
|
|
3221
3289
|
videoCharactersBillAsReferenceVideo?: true
|
|
3222
3290
|
} | undefined
|
|
@@ -3265,10 +3333,9 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3265
3333
|
// preset personas, which Kling does not take.
|
|
3266
3334
|
// Of the 7 subjects, at most 3 may be video subjects (a 3-8 s clip each), and
|
|
3267
3335
|
// reference videos plus video subjects are at most 5. A video subject is
|
|
3268
|
-
//
|
|
3269
|
-
//
|
|
3270
|
-
|
|
3271
|
-
"kling-4": { images: 10, videos: 5, audio: 3, characters: 7, materials: 15, videoCharacters: 3, videoCharactersBillAsReferenceVideo: true },
|
|
3336
|
+
// billed like an image subject (measured, decided 2026-11-14), as on Flash:
|
|
3337
|
+
// no `videoCharactersBillAsReferenceVideo`.
|
|
3338
|
+
"kling-4": { images: 10, videos: 5, audio: 3, characters: 7, materials: 15, videoCharacters: 3 },
|
|
3272
3339
|
// Kling 4.0 Keyframes — the Image References are the in-between frames
|
|
3273
3340
|
// (`keyframe_urls`, max 8; the clip's duration lowers the cap, see
|
|
3274
3341
|
// kling4KeyframeFrameCap). No reference videos or audio.
|
|
@@ -3279,8 +3346,7 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
3279
3346
|
// (`voice_url`) when that character is a subject (2-4 images), so at most one
|
|
3280
3347
|
// per character (7) and none takes a material seat. A wired start frame takes one of the 10 image slots when it
|
|
3281
3348
|
// runs on this endpoint. A video subject is billed like an image subject
|
|
3282
|
-
// (measured
|
|
3283
|
-
// `videoCharactersBillAsReferenceVideo`.
|
|
3349
|
+
// (measured, decided 2026-11-14): no `videoCharactersBillAsReferenceVideo`.
|
|
3284
3350
|
"kling-4-flash": { images: 10, videos: 5, audio: 7, characters: 7, materials: 15, audioBindsToCharacters: true, videoCharacters: 3 },
|
|
3285
3351
|
"grok-i2v": { images: 7 }, // backend kie/models.ts maxRefImages: 7
|
|
3286
3352
|
"happyhorse-ref2v": { images: 9 }, // backend kie/models.ts maxRefImages: 9
|
|
@@ -53,9 +53,10 @@ export interface VideoCharacterReference {
|
|
|
53
53
|
* positive `videoCharacters` cap (Kling 4.0, Kling 4.0 Flash) the character
|
|
54
54
|
* becomes a VIDEO subject made from this clip instead of an image subject.
|
|
55
55
|
* The clip rides as one more reference video ({@link seatCharacterVideos}),
|
|
56
|
-
* so it is measured
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* so it is measured and capped as a reference video is; its own length must
|
|
57
|
+
* fit `VIDEO_CHARACTER_CLIP_DURATION_LIMITS`. It is priced like an image
|
|
58
|
+
* subject unless the model bills it as reference video
|
|
59
|
+
* ({@link pricedReferenceVideoUrls}). Any other model refuses it.
|
|
59
60
|
*/
|
|
60
61
|
videoUrl?: string
|
|
61
62
|
}
|
|
@@ -109,9 +110,10 @@ export function characterVideoUrls(
|
|
|
109
110
|
|
|
110
111
|
/**
|
|
111
112
|
* Whether the provider bills a character's video subject as reference-video
|
|
112
|
-
* seconds (`videoCharactersBillAsReferenceVideo
|
|
113
|
-
*
|
|
114
|
-
* 2026-11-14)
|
|
113
|
+
* seconds (`videoCharactersBillAsReferenceVideo`). False on every model today:
|
|
114
|
+
* Kling 4.0 and Kling 4.0 Flash, both measured, price a video subject like an
|
|
115
|
+
* image subject (decided 2026-11-14). A model that bills the clip declares the
|
|
116
|
+
* flag on its `VIDEO_REF_LIMITS_BY_PROVIDER` row.
|
|
115
117
|
*/
|
|
116
118
|
export function videoCharacterClipsBilledAsReferenceVideo(provider: string | undefined): boolean {
|
|
117
119
|
return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.videoCharactersBillAsReferenceVideo === true : false
|
|
@@ -148,10 +150,13 @@ export interface CharacterVideoSeatProblem {
|
|
|
148
150
|
* The reference-video list a run sends once its characters' clips are seated
|
|
149
151
|
* in it — the ONE rule both video routes (a precheck, before the duration
|
|
150
152
|
* check, the quote and any reservation) and the workflow run (the payload
|
|
151
|
-
* builder) apply, so a video subject's clip is measured
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
153
|
+
* builder) apply, so a video subject's clip is measured and capped exactly as
|
|
154
|
+
* a reference video is (the provider counts both in one cap and one total
|
|
155
|
+
* length). The price reads the seated list through
|
|
156
|
+
* {@link pricedReferenceVideoUrls}, which leaves the clip out on a model that
|
|
157
|
+
* bills a video subject like an image subject. The provider runner then takes
|
|
158
|
+
* the seat back out of the reference videos and sends it as the character's
|
|
159
|
+
* subject.
|
|
155
160
|
*
|
|
156
161
|
* - No clip: the list as it came (the same value).
|
|
157
162
|
* - A clip already in the list (also wired as a plain reference video) keeps
|