@nodaro/shared 3.55.0 → 3.56.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-3CHOZ573.js → chunk-2AR3OXAA.js} +276 -17
- package/dist/chunk-2AR3OXAA.js.map +1 -0
- package/dist/{chunk-ZKHQSG76.js → chunk-2J6NTA5I.js} +4 -4
- package/dist/{chunk-ZKHQSG76.js.map → chunk-2J6NTA5I.js.map} +1 -1
- package/dist/{chunk-AGTCHDG5.cjs → chunk-33P5FI2U.cjs} +6 -6
- package/dist/{chunk-AGTCHDG5.cjs.map → chunk-33P5FI2U.cjs.map} +1 -1
- package/dist/{chunk-HG3KKCJJ.js → chunk-4JODLC2N.js} +3 -3
- package/dist/{chunk-HG3KKCJJ.js.map → chunk-4JODLC2N.js.map} +1 -1
- package/dist/{chunk-N3WL6IOJ.js → chunk-4O5STV7N.js} +55 -5
- package/dist/chunk-4O5STV7N.js.map +1 -0
- package/dist/chunk-4ONS6QRT.js +42 -0
- package/dist/chunk-4ONS6QRT.js.map +1 -0
- package/dist/{chunk-E4YES25K.js → chunk-55FQBILM.js} +4 -4
- package/dist/{chunk-E4YES25K.js.map → chunk-55FQBILM.js.map} +1 -1
- package/dist/{chunk-ZWB3NG4M.js → chunk-62ZQQA7L.js} +3 -3
- package/dist/{chunk-ZWB3NG4M.js.map → chunk-62ZQQA7L.js.map} +1 -1
- package/dist/{chunk-HEF4BIMA.js → chunk-6GGHM33Z.js} +4 -4
- package/dist/{chunk-HEF4BIMA.js.map → chunk-6GGHM33Z.js.map} +1 -1
- package/dist/{chunk-KMSEU6FK.js → chunk-7DGJDISO.js} +3 -3
- package/dist/{chunk-KMSEU6FK.js.map → chunk-7DGJDISO.js.map} +1 -1
- package/dist/{chunk-2OYV6K7D.cjs → chunk-7JM5EZF3.cjs} +13 -13
- package/dist/{chunk-2OYV6K7D.cjs.map → chunk-7JM5EZF3.cjs.map} +1 -1
- package/dist/chunk-AKDJKMAL.cjs +48 -0
- package/dist/chunk-AKDJKMAL.cjs.map +1 -0
- package/dist/{chunk-HZL7QMXK.js → chunk-AWS4BWEC.js} +7 -3
- package/dist/chunk-AWS4BWEC.js.map +1 -0
- package/dist/{chunk-5DVDHL7Y.js → chunk-AZDVL7IM.js} +20 -6
- package/dist/chunk-AZDVL7IM.js.map +1 -0
- package/dist/{chunk-2R74OU76.cjs → chunk-CGZLENU4.cjs} +276 -16
- package/dist/chunk-CGZLENU4.cjs.map +1 -0
- package/dist/{chunk-G7IUQKRU.cjs → chunk-CLKU3ZIU.cjs} +51 -51
- package/dist/{chunk-G7IUQKRU.cjs.map → chunk-CLKU3ZIU.cjs.map} +1 -1
- package/dist/{chunk-MCIBQ5BF.js → chunk-DURFRWAW.js} +9 -9
- package/dist/{chunk-MCIBQ5BF.js.map → chunk-DURFRWAW.js.map} +1 -1
- package/dist/{chunk-C5S75476.js → chunk-EAKO7PGC.js} +8 -4
- package/dist/{chunk-C5S75476.js.map → chunk-EAKO7PGC.js.map} +1 -1
- package/dist/{chunk-IPCWYKX5.cjs → chunk-EWARI452.cjs} +60 -46
- package/dist/chunk-EWARI452.cjs.map +1 -0
- package/dist/{chunk-C6IQCKJT.cjs → chunk-FCQYMPUQ.cjs} +4 -4
- package/dist/{chunk-C6IQCKJT.cjs.map → chunk-FCQYMPUQ.cjs.map} +1 -1
- package/dist/{chunk-WVACGZYV.cjs → chunk-H7VMJBNZ.cjs} +8 -8
- package/dist/{chunk-WVACGZYV.cjs.map → chunk-H7VMJBNZ.cjs.map} +1 -1
- package/dist/{chunk-SEEQ3H22.cjs → chunk-HWJE4FNS.cjs} +59 -6
- package/dist/chunk-HWJE4FNS.cjs.map +1 -0
- package/dist/{chunk-3633VD2M.cjs → chunk-IKP4GOWZ.cjs} +8 -8
- package/dist/{chunk-3633VD2M.cjs.map → chunk-IKP4GOWZ.cjs.map} +1 -1
- package/dist/{chunk-5R6LTKE5.cjs → chunk-ILMHITHK.cjs} +5 -5
- package/dist/{chunk-5R6LTKE5.cjs.map → chunk-ILMHITHK.cjs.map} +1 -1
- package/dist/chunk-IOET54EV.js +39 -0
- package/dist/chunk-IOET54EV.js.map +1 -0
- package/dist/{chunk-ZAK276QF.js → chunk-JHTYULY2.js} +4 -4
- package/dist/{chunk-ZAK276QF.js.map → chunk-JHTYULY2.js.map} +1 -1
- package/dist/{chunk-OVIIJVXH.cjs → chunk-JO3XSUO2.cjs} +21 -21
- package/dist/{chunk-OVIIJVXH.cjs.map → chunk-JO3XSUO2.cjs.map} +1 -1
- package/dist/{chunk-UWMXMLMV.js → chunk-MROKQP4U.js} +3 -3
- package/dist/{chunk-UWMXMLMV.js.map → chunk-MROKQP4U.js.map} +1 -1
- package/dist/{chunk-J4CVGAAV.cjs → chunk-NZRG5CXQ.cjs} +7 -2
- package/dist/chunk-NZRG5CXQ.cjs.map +1 -0
- package/dist/{chunk-KM35K2M5.cjs → chunk-O7DXNX5J.cjs} +92 -25
- package/dist/chunk-O7DXNX5J.cjs.map +1 -0
- package/dist/chunk-OWNPYQSH.cjs +283 -0
- package/dist/chunk-OWNPYQSH.cjs.map +1 -0
- package/dist/{chunk-FIYVKW7F.cjs → chunk-PFXPAWPQ.cjs} +12 -12
- package/dist/{chunk-FIYVKW7F.cjs.map → chunk-PFXPAWPQ.cjs.map} +1 -1
- package/dist/chunk-QSWUSXRL.cjs +53 -0
- package/dist/chunk-QSWUSXRL.cjs.map +1 -0
- package/dist/{chunk-MGJR5OXO.js → chunk-RX7WII6I.js} +5 -5
- package/dist/{chunk-MGJR5OXO.js.map → chunk-RX7WII6I.js.map} +1 -1
- package/dist/chunk-S7FCFQ6X.js +255 -0
- package/dist/chunk-S7FCFQ6X.js.map +1 -0
- package/dist/{chunk-YBZQXZ6A.js → chunk-ST4WQ6ND.js} +68 -8
- package/dist/chunk-ST4WQ6ND.js.map +1 -0
- package/dist/{chunk-LKCPFD5X.js → chunk-SWVGHAYO.js} +5 -3
- package/dist/chunk-SWVGHAYO.js.map +1 -0
- package/dist/{chunk-MTUNORQB.cjs → chunk-TSKYEREJ.cjs} +11 -11
- package/dist/{chunk-MTUNORQB.cjs.map → chunk-TSKYEREJ.cjs.map} +1 -1
- package/dist/{chunk-LYWJAXPT.js → chunk-UMPZR56R.js} +3 -3
- package/dist/{chunk-LYWJAXPT.js.map → chunk-UMPZR56R.js.map} +1 -1
- package/dist/{chunk-6HUWQLF2.cjs → chunk-WKCFTWLO.cjs} +6 -6
- package/dist/{chunk-6HUWQLF2.cjs.map → chunk-WKCFTWLO.cjs.map} +1 -1
- package/dist/chunk-XPUGMYAJ.cjs +27 -0
- package/dist/{chunk-HD45Y7QU.cjs.map → chunk-XPUGMYAJ.cjs.map} +1 -1
- package/dist/{chunk-G5NTNQ7W.cjs → chunk-XROE3CAS.cjs} +5 -3
- package/dist/chunk-XROE3CAS.cjs.map +1 -0
- package/dist/{chunk-SZUDEFX2.cjs → chunk-ZXDH3L3P.cjs} +43 -39
- package/dist/{chunk-SZUDEFX2.cjs.map → chunk-ZXDH3L3P.cjs.map} +1 -1
- package/dist/{chunk-25KAGSPT.js → chunk-ZYITB47P.js} +3 -3
- package/dist/{chunk-25KAGSPT.js.map → chunk-ZYITB47P.js.map} +1 -1
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.js +8 -7
- package/dist/entries/credits.cjs +151 -150
- package/dist/entries/credits.d.cts +4 -1
- package/dist/entries/credits.d.ts +4 -1
- package/dist/entries/credits.js +8 -7
- package/dist/entries/entities.cjs +125 -125
- package/dist/entries/entities.d.cts +1 -1
- package/dist/entries/entities.d.ts +1 -1
- package/dist/entries/entities.js +1 -1
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/model-catalog.cjs +127 -66
- package/dist/entries/model-catalog.d.cts +61 -9
- package/dist/entries/model-catalog.d.ts +61 -9
- package/dist/entries/model-catalog.js +5 -4
- package/dist/entries/models.cjs +304 -276
- 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 +208 -207
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +161 -149
- package/dist/entries/pipeline.d.cts +165 -26
- package/dist/entries/pipeline.d.ts +165 -26
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/runtime-config.cjs +116 -0
- package/dist/entries/runtime-config.cjs.map +1 -0
- package/dist/entries/runtime-config.d.cts +308 -0
- package/dist/entries/runtime-config.d.ts +308 -0
- package/dist/entries/runtime-config.js +3 -0
- package/dist/entries/runtime-config.js.map +1 -0
- 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/entries/workflow.cjs +150 -146
- package/dist/entries/workflow.d.cts +8 -1
- package/dist/entries/workflow.d.ts +8 -1
- package/dist/entries/workflow.js +2 -2
- package/dist/index.cjs +3156 -2942
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +23 -21
- package/dist/{model-catalog-Dm2UiwUe.d.ts → model-catalog-vQ3NWn24.d.cts} +33 -2
- package/dist/{model-catalog-Dm2UiwUe.d.cts → model-catalog-vQ3NWn24.d.ts} +33 -2
- package/dist/{model-constants-DZUGVDOw.d.ts → model-constants-QZVHZX25.d.cts} +35 -6
- package/dist/{model-constants-DZUGVDOw.d.cts → model-constants-QZVHZX25.d.ts} +35 -6
- package/package.json +6 -1
- package/src/__tests__/fixtures/root-exports.baseline.json +2 -0
- package/src/__tests__/gpt-image-2-6.test.ts +277 -0
- package/src/__tests__/image-model-roles.test.ts +28 -9
- package/src/__tests__/runtime-config.test.ts +398 -0
- package/src/__tests__/voice-library-values.test.ts +24 -0
- package/src/credit-identifiers.ts +42 -0
- package/src/entries/model-catalog.ts +17 -0
- package/src/entries/models.ts +9 -0
- package/src/entries/runtime-config.ts +51 -0
- package/src/entries/workflow.ts +1 -1
- package/src/gpt-image-2-6.ts +104 -0
- package/src/image-model-roles.ts +31 -10
- package/src/index.ts +1 -0
- package/src/model-catalog.ts +302 -14
- package/src/model-constants.ts +84 -3
- package/src/node-default-mappings.ts +4 -0
- package/src/node-refs.ts +11 -0
- package/src/pipeline-types.ts +2 -0
- package/src/reference-board-templates.ts +2 -0
- package/src/runtime-config/contract.ts +492 -0
- package/src/runtime-config/worlds.ts +77 -0
- package/src/voices.ts +175 -2
- package/dist/chunk-2R74OU76.cjs.map +0 -1
- package/dist/chunk-3CHOZ573.js.map +0 -1
- package/dist/chunk-5DVDHL7Y.js.map +0 -1
- package/dist/chunk-ATWLKUAI.cjs +0 -34
- package/dist/chunk-ATWLKUAI.cjs.map +0 -1
- package/dist/chunk-DUL5ZLTJ.js +0 -29
- package/dist/chunk-DUL5ZLTJ.js.map +0 -1
- package/dist/chunk-G5NTNQ7W.cjs.map +0 -1
- package/dist/chunk-HD45Y7QU.cjs +0 -27
- package/dist/chunk-HZL7QMXK.js.map +0 -1
- package/dist/chunk-IPCWYKX5.cjs.map +0 -1
- package/dist/chunk-J4CVGAAV.cjs.map +0 -1
- package/dist/chunk-KM35K2M5.cjs.map +0 -1
- package/dist/chunk-LKCPFD5X.js.map +0 -1
- package/dist/chunk-N3WL6IOJ.js.map +0 -1
- package/dist/chunk-SEEQ3H22.cjs.map +0 -1
- package/dist/chunk-YBZQXZ6A.js.map +0 -1
|
@@ -35,7 +35,7 @@ declare const IMAGE_PROMPT_MAX = 5000;
|
|
|
35
35
|
* "native"); it lives here for the same reason as the rest — the snap drops or
|
|
36
36
|
* replaces it for models that do not declare it.
|
|
37
37
|
*/
|
|
38
|
-
declare const IMAGE_ASPECT_RATIO_VALUES: readonly ["auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "21:9", "4:1", "1:4", "8:1", "1:8", "27:16", "16:27", "9:8", "8:9"];
|
|
38
|
+
declare const IMAGE_ASPECT_RATIO_VALUES: readonly ["auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "21:9", "4:1", "1:4", "8:1", "1:8", "27:16", "16:27", "9:8", "8:9", "2:1", "1:2", "9:21", "3:1", "1:3"];
|
|
39
39
|
/** A ratio string the image routes accept (pre-snap vocabulary, not a per-model guarantee). */
|
|
40
40
|
type ImageAspectRatio = typeof IMAGE_ASPECT_RATIO_VALUES[number];
|
|
41
41
|
/**
|
|
@@ -48,8 +48,11 @@ type ImageAspectRatio = typeof IMAGE_ASPECT_RATIO_VALUES[number];
|
|
|
48
48
|
declare const IMAGE_RESOLUTION_VALUES: readonly ["1K", "2K", "4K", "0.5 MP", "1 MP", "2 MP", "4 MP"];
|
|
49
49
|
type ImageResolution = typeof IMAGE_RESOLUTION_VALUES[number];
|
|
50
50
|
/** The `quality` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
|
|
51
|
-
declare const IMAGE_QUALITY_VALUES: readonly ["medium", "high", "basic"];
|
|
51
|
+
declare const IMAGE_QUALITY_VALUES: readonly ["auto", "low", "medium", "high", "xhigh", "max", "basic"];
|
|
52
52
|
type ImageQuality = typeof IMAGE_QUALITY_VALUES[number];
|
|
53
|
+
/** The `background` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
|
|
54
|
+
declare const IMAGE_BACKGROUND_VALUES: readonly ["auto", "opaque", "transparent"];
|
|
55
|
+
type ImageBackground = typeof IMAGE_BACKGROUND_VALUES[number];
|
|
53
56
|
/** The `renderingSpeed` vocabulary (Ideogram's speed tiers — see {@link RENDERING_SPEED_SUPPORT}). */
|
|
54
57
|
declare const IMAGE_RENDERING_SPEED_VALUES: readonly ["TURBO", "BALANCED", "QUALITY"];
|
|
55
58
|
type ImageRenderingSpeed = typeof IMAGE_RENDERING_SPEED_VALUES[number];
|
|
@@ -317,14 +320,23 @@ declare const DEFAULT_REF_IMAGE_MAX = 4;
|
|
|
317
320
|
* reader reads this map verbatim — do NOT "fix" these to the schema maxima.
|
|
318
321
|
*/
|
|
319
322
|
declare function imageReferenceLimit(provider: string | undefined): number;
|
|
323
|
+
/** The most input images one request may carry, on a model with no row below. */
|
|
324
|
+
declare const DEFAULT_REQUEST_IMAGE_LIMIT = 14;
|
|
325
|
+
/** The largest per-model limit: the outer bound of the routes' array schemas. */
|
|
326
|
+
declare const MAX_REQUEST_IMAGE_LIMIT: number;
|
|
327
|
+
/**
|
|
328
|
+
* The most input images one request may carry for `provider` (a text-to-image
|
|
329
|
+
* id reads its edit sibling's row, the model that consumes them).
|
|
330
|
+
*/
|
|
331
|
+
declare function requestImageLimit(provider: string | undefined): number;
|
|
320
332
|
declare const VARIABLE_PRICING_MODELS: Record<string, "quality" | "resolution" | "rendering-speed">;
|
|
321
333
|
declare const HIGH_QUALITY_PROVIDERS: Set<string>;
|
|
322
334
|
declare const TWO_K_RESOLUTION_PROVIDERS: Set<string>;
|
|
323
335
|
declare const IDEOGRAM_PROVIDERS: Set<string>;
|
|
324
336
|
/** Text-to-image providers (no input image required) */
|
|
325
|
-
declare const IMAGE_GEN_PROVIDERS: readonly ["nano-banana", "flux", "nano-banana-pro", "nano-banana-2", "nano-banana-2-lite", "nano-banana-2-1", "grok", "grok-2", "gpt-image", "gpt-image-2", "gpt-image-2-5-flare", "gpt-image-2-5-sunburst", "imagen4", "imagen4-fast", "imagen4-ultra", "ideogram-v3", "qwen", "seedream", "seedream-5-lite", "seedream-5-pro", "seedream-5-flash", "flux-flex", "flux-kontext", "flux-kontext-max", "z-image", "wan-2.7", "wan-2.7-pro", "flux-2-klein", "flux-2-pro", "flux-2-max"];
|
|
337
|
+
declare const IMAGE_GEN_PROVIDERS: readonly ["nano-banana", "flux", "nano-banana-pro", "nano-banana-2", "nano-banana-2-lite", "nano-banana-2-1", "grok", "grok-2", "gpt-image", "gpt-image-2", "gpt-image-2-5-flare", "gpt-image-2-5-sunburst", "gpt-image-2-6-flare", "gpt-image-2-6-sunburst", "gpt-image-2-6-economy", "imagen4", "imagen4-fast", "imagen4-ultra", "ideogram-v3", "qwen", "seedream", "seedream-5-lite", "seedream-5-pro", "seedream-5-flash", "flux-flex", "flux-kontext", "flux-kontext-max", "z-image", "wan-2.7", "wan-2.7-pro", "flux-2-klein", "flux-2-pro", "flux-2-max"];
|
|
326
338
|
/** Image-to-image providers (require input image) */
|
|
327
|
-
declare const IMAGE_I2I_PROVIDERS: readonly ["nano-banana", "nano-banana-2", "nano-banana-2-lite", "nano-banana-2-1", "nano-banana-pro", "grok-i2i", "flux-i2i", "flux-pro-i2i", "gpt-image-i2i", "gpt-image-2-i2i", "gpt-image-2-5-flare-i2i", "gpt-image-2-5-sunburst-i2i", "grok-2-i2i", "ideogram-edit", "ideogram-remix", "qwen-i2i", "qwen-edit", "seedream-edit", "seedream-5-lite-i2i", "seedream-5-pro-i2i", "seedream-5-flash-i2i", "flux-kontext", "flux-kontext-max", "kontext-multi", "flux-2-pro", "flux-fill", "flux-2-max", "flux-fill"];
|
|
339
|
+
declare const IMAGE_I2I_PROVIDERS: readonly ["nano-banana", "nano-banana-2", "nano-banana-2-lite", "nano-banana-2-1", "nano-banana-pro", "grok-i2i", "flux-i2i", "flux-pro-i2i", "gpt-image-i2i", "gpt-image-2-i2i", "gpt-image-2-5-flare-i2i", "gpt-image-2-5-sunburst-i2i", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst-i2i", "gpt-image-2-6-economy-i2i", "grok-2-i2i", "ideogram-edit", "ideogram-remix", "qwen-i2i", "qwen-edit", "seedream-edit", "seedream-5-lite-i2i", "seedream-5-pro-i2i", "seedream-5-flash-i2i", "flux-kontext", "flux-kontext-max", "kontext-multi", "flux-2-pro", "flux-fill", "flux-2-max", "flux-fill"];
|
|
328
340
|
/**
|
|
329
341
|
* Image editing providers (upscale, remove bg, etc.)
|
|
330
342
|
*
|
|
@@ -353,7 +365,7 @@ declare const TASK_CHAINED_EDIT_PROVIDER_IDS: readonly ["grok-2-edit", "grok-2-s
|
|
|
353
365
|
type TaskChainedEditProvider = typeof TASK_CHAINED_EDIT_PROVIDER_IDS[number];
|
|
354
366
|
declare const TASK_CHAINED_EDIT_PROVIDERS: ReadonlySet<string>;
|
|
355
367
|
/** Modify image providers (I2I + edit-with-prompt) */
|
|
356
|
-
declare const MODIFY_IMAGE_PROVIDERS: readonly ["nano-banana", "nano-banana-2", "nano-banana-2-lite", "nano-banana-2-1", "nano-banana-pro", "grok-i2i", "flux-i2i", "flux-pro-i2i", "gpt-image-i2i", "gpt-image-2-i2i", "gpt-image-2-5-flare-i2i", "gpt-image-2-5-sunburst-i2i", "grok-2-i2i", "ideogram-edit", "ideogram-remix", "qwen-i2i", "qwen-edit", "seedream-edit", "seedream-5-lite-i2i", "seedream-5-pro-i2i", "seedream-5-flash-i2i", "flux-kontext", "flux-kontext-max", "kontext-multi", "flux-2-pro", "flux-fill", "flux-2-max", "flux-fill", "nano-banana-edit"];
|
|
368
|
+
declare const MODIFY_IMAGE_PROVIDERS: readonly ["nano-banana", "nano-banana-2", "nano-banana-2-lite", "nano-banana-2-1", "nano-banana-pro", "grok-i2i", "flux-i2i", "flux-pro-i2i", "gpt-image-i2i", "gpt-image-2-i2i", "gpt-image-2-5-flare-i2i", "gpt-image-2-5-sunburst-i2i", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst-i2i", "gpt-image-2-6-economy-i2i", "grok-2-i2i", "ideogram-edit", "ideogram-remix", "qwen-i2i", "qwen-edit", "seedream-edit", "seedream-5-lite-i2i", "seedream-5-pro-i2i", "seedream-5-flash-i2i", "flux-kontext", "flux-kontext-max", "kontext-multi", "flux-2-pro", "flux-fill", "flux-2-max", "flux-fill", "nano-banana-edit"];
|
|
357
369
|
type ModifyImageProvider = typeof MODIFY_IMAGE_PROVIDERS[number];
|
|
358
370
|
/** Image upscale providers */
|
|
359
371
|
declare const UPSCALE_IMAGE_PROVIDERS: readonly ["recraft-upscale", "topaz-image-upscale"];
|
|
@@ -575,6 +587,23 @@ type MotionTransferProviderType = typeof MOTION_TRANSFER_PROVIDERS[number];
|
|
|
575
587
|
/** Text-to-speech providers */
|
|
576
588
|
declare const TTS_PROVIDERS: readonly ["elevenlabs-v3", "elevenlabs-v4", "elevenlabs-v4-turbo", "elevenlabs-turbo", "elevenlabs-multilingual", "elevenlabs"];
|
|
577
589
|
type TtsProvider = typeof TTS_PROVIDERS[number];
|
|
590
|
+
/**
|
|
591
|
+
* The file a speech request can ask for (`outputFormat` on `/v1/text-to-speech`
|
|
592
|
+
* and the `text-to-speech` node run), named as the vendor names its formats:
|
|
593
|
+
* `codec_samplerate_bitrate`. Omitted ⇒ the first, which is exactly what every
|
|
594
|
+
* request delivered before the field existed. The list is deliberately short:
|
|
595
|
+
* the three the hosted deployment's vendor account serves (measured 2026-11-08);
|
|
596
|
+
* a self-hosted install's account must serve them too, or a run asking for one
|
|
597
|
+
* fails with the vendor's own message.
|
|
598
|
+
*/
|
|
599
|
+
declare const TTS_OUTPUT_FORMATS: readonly ["mp3_44100_128", "mp3_44100_192", "wav_24000"];
|
|
600
|
+
type TtsOutputFormat = typeof TTS_OUTPUT_FORMATS[number];
|
|
601
|
+
declare const DEFAULT_TTS_OUTPUT_FORMAT: TtsOutputFormat;
|
|
602
|
+
/** How each format is stored and served: the file extension and the MIME type. */
|
|
603
|
+
declare const TTS_OUTPUT_FORMAT_FILES: Readonly<Record<TtsOutputFormat, {
|
|
604
|
+
readonly ext: "mp3" | "wav";
|
|
605
|
+
readonly mime: "audio/mpeg" | "audio/wav";
|
|
606
|
+
}>>;
|
|
578
607
|
/**
|
|
579
608
|
* Text-to-dialogue models (the `provider` of `/v1/text-to-dialogue` and of the
|
|
580
609
|
* Text to Dialogue node). Each IS its catalog id and its credit identifier.
|
|
@@ -1673,4 +1702,4 @@ declare function applyDefaultVideoSelection<D>(input: {
|
|
|
1673
1702
|
duration: D | number | undefined;
|
|
1674
1703
|
};
|
|
1675
1704
|
|
|
1676
|
-
export {
|
|
1705
|
+
export { IMAGE_QUALITY_VALUES as $, AI_WRITER_PROVIDERS as A, type FaceSwapProvider as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_PROVIDERS as G, GUIDANCE_SCALE_SUPPORT as H, GVP_ANCHOR_CHOICES as I, GVP_DEFAULT_PROVIDER as J, GVP_END_FRAME_PROVIDERS as K, GVP_EXTEND_PROVIDERS as L, GVP_SUPPORTED_PROVIDERS as M, type GvpAnchorChoice as N, type GvpAnchorWireMode as O, HIGH_QUALITY_PROVIDERS as P, I2I_MASK_SUPPORT as Q, I2I_STRENGTH_SUPPORT as R, IDEOGRAM_PROVIDERS as S, IMAGE_ASPECT_RATIO_VALUES as T, IMAGE_BACKGROUND_VALUES as U, IMAGE_EDIT_PROVIDERS as V, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as W, IMAGE_GEN_PROVIDERS as X, IMAGE_I2I_PROVIDERS as Y, IMAGE_MASK_MODE as Z, IMAGE_PROMPT_MAX as _, ASPECT_RATIO_DIMENSIONS as a, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as a$, IMAGE_RENDERING_SPEED_VALUES as a0, IMAGE_RESOLUTION_VALUES as a1, IMAGE_TO_VIDEO_PROVIDERS as a2, type ImageAspectRatio as a3, type ImageBackground as a4, type ImageEditProvider as a5, type ImageEditTargetResolution as a6, type ImageGenProvider as a7, type ImageI2IProvider as a8, type ImageMaskMode as a9, type ModifyImageProvider as aA, type MotionTransferProviderType as aB, type MusicProvider as aC, NATIVE_ADAPTIVE_ASPECT as aD, NATIVE_NEGATIVE_PROMPT_MODELS as aE, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aF, NEGATIVE_PROMPT_MAX as aG, OBJECT_MOTION_PROVIDERS as aH, type ObjectMotionProvider as aI, PRICING_DEFAULT_DURATION_SEC as aJ, PRICING_DEFAULT_RESOLUTION as aK, PROMPT_HARD_CEILING as aL, QA_CHECK_PROVIDERS as aM, type QaCheckProvider as aN, REF_IMAGE_MAX_LIMITS as aO, RENDERING_SPEED_SUPPORT as aP, REPLICATE_LIP_SYNC_PROVIDERS as aQ, RETIRED_VIDEO_PROVIDERS as aR, type RefAudioCheck as aS, type RefAudioProbe as aT, type RefAudioRule as aU, type RefVideoDurationLimit as aV, SCRIPT_PROVIDERS as aW, SEEDANCE_2_5_REF_LIMITS as aX, SEEDANCE_2_CONTINUATION_REF_SEC as aY, SEEDANCE_2_EXTEND_STITCH as aZ, SEEDANCE_2_PROVIDERS as a_, type ImageQuality as aa, type ImageRenderingSpeed as ab, type ImageResolution as ac, type ImageToVideoProvider as ad, KLING_4_DEFAULT_RESOLUTION as ae, KLING_4_MAX_MIDDLE_FRAMES as af, KLING_4_PROVIDERS as ag, LIP_SYNC_PROVIDERS as ah, LLM_TEXT_INPUT_MAX as ai, LOCATION_ATMOSPHERE_PROVIDERS as aj, type LipSyncProvider as ak, type LocationAtmosphereProvider as al, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as am, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as an, MAX_REQUEST_IMAGE_LIMIT as ao, MAX_TTS_CHARS_BY_PROVIDER as ap, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as aq, MINIMAX_H3_DEFAULT_RESOLUTION as ar, MINIMAX_H3_PROVIDERS as as, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as at, MODIFY_IMAGE_PROVIDERS as au, MOTION_TRANSFER_PROVIDERS as av, MUSIC_CREDIT_ID as aw, MUSIC_PROVIDERS as ax, MUSIC_PROVIDER_LABELS as ay, type ModelPromptingStyle as az, AUDIO_ADDON_PROVIDERS as b, VIDU_Q4_DEFAULT_RESOLUTION as b$, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as b0, SEEDANCE_2_REF_LIMITS as b1, SEEDANCE_LIP_SYNC_PROVIDERS as b2, SEEDANCE_VIDEO_EDIT_PROVIDERS as b3, SEEDANCE_VIDEO_EDIT_SHAPE as b4, SEED_SUPPORT as b5, SUNO_ACTIVE_MODELS as b6, SUNO_ADD_TRACK_MODELS as b7, SUNO_DURATION_MODELS as b8, SUNO_HARD_CEILING as b9, type TranscribeLane as bA, type TranscribeProvider as bB, type TtsOutputFormat as bC, type TtsProvider as bD, UPSCALE_IMAGE_PROVIDERS as bE, type UpscaleImageProvider as bF, VARIABLE_PRICING_MODELS as bG, VEO_PROVIDERS as bH, VIDEO_AUDIO_CAPABILITY as bI, VIDEO_DURATION_TIERS as bJ, VIDEO_GEN_COLLAPSED_T2V_IDS as bK, VIDEO_GEN_PROVIDERS as bL, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bM, VIDEO_MODEL_CAPS as bN, VIDEO_MODE_ALIASES as bO, VIDEO_PROMPT_MAX as bP, VIDEO_PROVIDERS_REQUIRING_IMAGE as bQ, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bR, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bS, VIDEO_REF_AUDIO_RULES as bT, VIDEO_REF_LIMITS_BY_PROVIDER as bU, VIDEO_REF_RATE_PROVIDERS as bV, VIDEO_REF_VIDEO_DURATION_LIMITS as bW, VIDEO_TO_VIDEO_NODE_PROVIDERS as bX, VIDEO_TO_VIDEO_PROVIDERS as bY, VIDEO_UPSCALE_PROVIDERS as bZ, VIDEO_VARIABLE_PRICING as b_, SUNO_LEGACY_MODELS as ba, SUNO_MODELS as bb, SUNO_TEXT_MAX as bc, SUNO_TITLE_MAX as bd, type SceneInputMode as be, SceneInputModeSchema as bf, type ScriptProvider as bg, type SeedanceVideoEditProvider as bh, type SunoAddTrackModel as bi, type SunoModel as bj, T2I_TO_I2I_VARIANT as bk, TASK_CHAINED_EDIT_PROVIDERS as bl, TASK_CHAINED_EDIT_PROVIDER_IDS as bm, TEXT_TO_AUDIO_PROVIDERS as bn, TEXT_TO_VIDEO_PROVIDERS as bo, TRANSCRIBE_LANES as bp, TRANSCRIBE_PROVIDERS as bq, TRANSCRIBE_PROVIDER_CAPABILITIES as br, TTS_OUTPUT_FORMATS as bs, TTS_OUTPUT_FORMAT_FILES as bt, TTS_PROVIDERS as bu, TTS_TEXT_MAX as bv, TWO_K_RESOLUTION_PROVIDERS as bw, type TaskChainedEditProvider as bx, type TextToAudioProvider as by, type TextToVideoProvider as bz, type AiWriterProvider as c, supportsAutoVideoDuration as c$, VIDU_Q4_PROVIDERS as c0, VOICE_DESIGN_MODELS as c1, type VideoAudioCapability as c2, type VideoAudioMode as c3, type VideoGenProvider as c4, type VideoModeAlias as c5, type VideoModelCapabilities as c6, type VideoReferenceSyntax as c7, type VideoToVideoNodeProvider as c8, type VideoToVideoProvider as c9, isMinimaxH3Provider as cA, isSeedance2Provider as cB, isSeedanceVideoEditProvider as cC, isVeoProvider as cD, isViduQ4Provider as cE, isWan3Provider as cF, kling4KeyframeFrameCap as cG, maxSegmentSecFor as cH, maxSegmentsFor as cI, maxVideoDurationSec as cJ, minSegmentSecFor as cK, modelsForInputMode as cL, normalizeKling4Resolution as cM, normalizeMinimaxH3Resolution as cN, normalizeViduQ4Resolution as cO, normalizeWan3Resolution as cP, preferredInputModeForModel as cQ, pricedOutputDurationSec as cR, requestImageLimit as cS, resolveGvpAnchorWire as cT, resolveMusicProvider as cU, resolveVideoModeForInputs as cV, resolveVideoProviderForMode as cW, seedance2AudioLimitSec as cX, segmentDurationsFor as cY, snapToNearestDuration as cZ, sunoModelHonoursDuration as c_, type VideoUpscaleProvider as ca, type VoiceDesignModel as cb, WAN_3_DEFAULT_RESOLUTION as cc, WAN_3_PROVIDERS as cd, applyDefaultVideoSelection as ce, applyVideoAudioToggle as cf, applyVideoNegativePrompt as cg, billsReferenceVideoSeconds as ch, canonicalVideoProvider as ci, checkRefAudioRules as cj, checkRefVideoDurations as ck, defaultVideoAspectRatio as cl, findSeedance2AudioOverLimit as cm, getMaxImagePromptChars as cn, getMaxNegativePromptChars as co, getMaxSunoPromptChars as cp, getMaxSunoStyleChars as cq, getMaxTtsChars as cr, getMaxVideoPromptChars as cs, getVideoAudioCapability as ct, hasContiguousSegmentDurations as cu, imageReferenceLimit as cv, isGeminiOmniProvider as cw, isGvpSupportedProvider as cx, isKling4Provider as cy, isLegacySunoModel as cz, COMPOSER_PLAN_FIELDS as d, supportsEndAnchor as d0, supportsExtendRender as d1, transcribeLaneSupportsWordTimestamps as d2, transcribeProvidersWithWordTimestamps as d3, videoDefaultDurationSec as d4, videoModelCanSpeakDialogue as d5, videoModelSupportsAudio as d6, videoNegativeSuffix as d7, videoProviderAppendsFrames as d8, videoProviderFoldsLoneEndFrame as d9, videoProviderRefModeFrameSeats as da, videoProviderReferenceSyntax as db, videoProviderRequiresImage as dc, videoProviderRunsFromReferences as dd, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_REQUEST_IMAGE_LIMIT as j, DEFAULT_SUNO_MODEL as k, DEFAULT_TEXT_TO_AUDIO_PROVIDER as l, DEFAULT_TRANSCRIBE_NODE_PROVIDER as m, DEFAULT_TRANSCRIBE_PROVIDER as n, DEFAULT_TTS_OUTPUT_FORMAT as o, DEFAULT_TTS_PROVIDER as p, DEFAULT_VIDEO_DURATION_SEC as q, DEFAULT_VIDEO_PROVIDER as r, DEFAULT_VOICE_DESIGN_MODEL as s, DIALOGUE_PROVIDERS as t, DURATION_PRICED_PROVIDERS as u, type DialogueProvider as v, type ExtendVideoProvider as w, FAL_LIP_SYNC_PROVIDERS as x, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as y, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodaro/shared",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.0",
|
|
4
4
|
"description": "Shared types, model catalog, wire contracts, and structural vocabularies for the Nodaro platform and SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -90,6 +90,11 @@
|
|
|
90
90
|
"import": "./dist/entries/pipeline.js",
|
|
91
91
|
"require": "./dist/entries/pipeline.cjs"
|
|
92
92
|
},
|
|
93
|
+
"./runtime-config": {
|
|
94
|
+
"types": "./dist/entries/runtime-config.d.ts",
|
|
95
|
+
"import": "./dist/entries/runtime-config.js",
|
|
96
|
+
"require": "./dist/entries/runtime-config.cjs"
|
|
97
|
+
},
|
|
93
98
|
"./scene3d": {
|
|
94
99
|
"types": "./dist/entries/scene3d.d.ts",
|
|
95
100
|
"import": "./dist/entries/scene3d.js",
|
|
@@ -1917,6 +1917,7 @@
|
|
|
1917
1917
|
"defaultCarriedFraction",
|
|
1918
1918
|
"defaultEdgeOutputMode",
|
|
1919
1919
|
"defaultImageModel",
|
|
1920
|
+
"defaultImageModelForNode",
|
|
1920
1921
|
"defaultReasoningEffort",
|
|
1921
1922
|
"defaultResolutionFor",
|
|
1922
1923
|
"defaultRoleForSource",
|
|
@@ -3823,6 +3824,7 @@
|
|
|
3823
3824
|
"defaultCarriedFraction",
|
|
3824
3825
|
"defaultEdgeOutputMode",
|
|
3825
3826
|
"defaultImageModel",
|
|
3827
|
+
"defaultImageModelForNode",
|
|
3826
3828
|
"defaultReasoningEffort",
|
|
3827
3829
|
"defaultResolutionFor",
|
|
3828
3830
|
"defaultRoleForSource",
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { buildCreditModelIdentifier, resolveNormalizedImageGen } from "../credit-identifiers.js"
|
|
3
|
+
import { MODEL_CATALOG, modelIdsByKindMode, normalizeModelInput } from "../model-catalog.js"
|
|
4
|
+
import { GPT_IMAGE_2_6_TIERED_I2I, GPT_IMAGE_2_6_TIERED_T2I, gptImage26EstimatedImages, gptImage26SentImages, isGptImage26AutoRun } from "../gpt-image-2-6.js"
|
|
5
|
+
import { countImageInputEdges } from "../node-refs.js"
|
|
6
|
+
import { DEFAULT_REQUEST_IMAGE_LIMIT, IMAGE_I2I_PROVIDERS, IMAGE_GEN_PROVIDERS, MAX_REQUEST_IMAGE_LIMIT, requestImageLimit, T2I_TO_I2I_VARIANT } from "../model-constants.js"
|
|
7
|
+
|
|
8
|
+
const ALL = [
|
|
9
|
+
"gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i",
|
|
10
|
+
"gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i",
|
|
11
|
+
"gpt-image-2-6-economy", "gpt-image-2-6-economy-i2i",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
describe("GPT Image 2.6 price ids", () => {
|
|
15
|
+
it("a text-to-image run is priced on quality and size", () => {
|
|
16
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-flare", "low", "2K")).toBe("gpt-image-2-6-flare:low:2K")
|
|
17
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-sunburst", "high", "4K", undefined, undefined, 0)).toBe("gpt-image-2-6-sunburst:high:4K")
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it("no setting is the default, medium at 1K", () => {
|
|
21
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-flare")).toBe("gpt-image-2-6-flare:medium:1K")
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it("an edit is priced on its input images too, from one to sixteen", () => {
|
|
25
|
+
const id = "gpt-image-2-6-flare-i2i"
|
|
26
|
+
expect(buildCreditModelIdentifier(id, "medium", "1K", undefined, undefined, 3)).toBe(`${id}:medium:1K:3ref`)
|
|
27
|
+
expect(buildCreditModelIdentifier(id, "medium", "1K", undefined, undefined, 0)).toBe(`${id}:medium:1K:1ref`)
|
|
28
|
+
expect(buildCreditModelIdentifier(id, "medium", "1K", undefined, undefined, 40)).toBe(`${id}:medium:1K:16ref`)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it("a text-to-image id sent images is priced as the edit it runs as", () => {
|
|
32
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-sunburst", "low", "1K", undefined, undefined, 2))
|
|
33
|
+
.toBe("gpt-image-2-6-sunburst-i2i:low:1K:2ref")
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it("a value off the grid lands on the default, never an id no row answers", () => {
|
|
37
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-flare", "basic", "2 MP")).toBe("gpt-image-2-6-flare:medium:1K")
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it("Economy is one flat id, whatever is sent", () => {
|
|
41
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-economy", "high", "4K")).toBe("gpt-image-2-6-economy")
|
|
42
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-economy-i2i", undefined, undefined, undefined, undefined, 5)).toBe("gpt-image-2-6-economy-i2i")
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it("the route's resolver swaps to the edit model and prices its images", () => {
|
|
46
|
+
const n = resolveNormalizedImageGen({ provider: "gpt-image-2-6-flare", quality: "high", resolution: "2K", refCount: 4, swapToI2i: true })
|
|
47
|
+
expect(n.modelId).toBe("gpt-image-2-6-flare-i2i")
|
|
48
|
+
expect(n.identifier).toBe("gpt-image-2-6-flare-i2i:high:2K:4ref")
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
describe("GPT Image 2.6 catalog", () => {
|
|
53
|
+
it.each(ALL)("%s is offered and is OpenAI's", (id) => {
|
|
54
|
+
expect(MODEL_CATALOG[id]?.maker).toBe("openai")
|
|
55
|
+
expect(MODEL_CATALOG[id]?.series).toBe("GPT Image")
|
|
56
|
+
expect([...IMAGE_GEN_PROVIDERS, ...IMAGE_I2I_PROVIDERS] as string[]).toContain(id)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it("Flare and Sunburst take six qualities at 1K, 2K and 4K, medium by default", () => {
|
|
60
|
+
for (const id of [...GPT_IMAGE_2_6_TIERED_T2I, ...GPT_IMAGE_2_6_TIERED_I2I]) {
|
|
61
|
+
expect(MODEL_CATALOG[id]?.qualities).toEqual(["auto", "low", "medium", "high", "xhigh", "max"])
|
|
62
|
+
expect(MODEL_CATALOG[id]?.defaultQuality).toBe("medium")
|
|
63
|
+
expect(MODEL_CATALOG[id]?.resolutions).toEqual(["1K", "2K", "4K"])
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it("every quality has its own price id, Auto included", () => {
|
|
68
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-flare", "auto", "2K")).toBe("gpt-image-2-6-flare:auto:2K")
|
|
69
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-flare", "xhigh", "1K")).toBe("gpt-image-2-6-flare:xhigh:1K")
|
|
70
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-sunburst-i2i", "max", "4K", undefined, undefined, 16)).toBe("gpt-image-2-6-sunburst-i2i:max:4K:16ref")
|
|
71
|
+
expect(buildCreditModelIdentifier("gpt-image-2-6-flare-i2i", "auto", "1K", undefined, undefined, 2)).toBe("gpt-image-2-6-flare-i2i:auto:1K:2ref")
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it("only Flare and Sunburst at Auto settle on KIE's bill", () => {
|
|
75
|
+
expect(isGptImage26AutoRun("gpt-image-2-6-flare", "auto")).toBe(true)
|
|
76
|
+
expect(isGptImage26AutoRun("gpt-image-2-6-sunburst-i2i", "auto")).toBe(true)
|
|
77
|
+
expect(isGptImage26AutoRun("gpt-image-2-6-flare", "max")).toBe(false)
|
|
78
|
+
expect(isGptImage26AutoRun("gpt-image-2-6-economy", "auto")).toBe(false)
|
|
79
|
+
expect(isGptImage26AutoRun("gpt-image-2-5-flare", "auto")).toBe(false)
|
|
80
|
+
expect(isGptImage26AutoRun(undefined, "auto")).toBe(false)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it.each(["auto", "xhigh", "max"])("a model without %s drops it", (quality) => {
|
|
84
|
+
expect(normalizeModelInput("gpt-image-2-5-flare", { quality }).quality).toBeUndefined()
|
|
85
|
+
expect(normalizeModelInput("gpt-image-2-6-economy", { quality }).quality).toBeUndefined()
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it("KIE refused 2.5's extra ratios on 2.6, so none of the six offers them", () => {
|
|
89
|
+
for (const id of ALL) {
|
|
90
|
+
for (const ratio of ["27:16", "16:27", "9:8", "8:9"]) {
|
|
91
|
+
expect(MODEL_CATALOG[id]?.aspectRatios, `${id} ${ratio}`).not.toContain(ratio)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it("Economy is left out of the docs and the MCP model lists while it is withheld", () => {
|
|
97
|
+
expect(MODEL_CATALOG["gpt-image-2-6-economy"]?.docsHidden).toBe(true)
|
|
98
|
+
expect(MODEL_CATALOG["gpt-image-2-6-economy-i2i"]?.docsHidden).toBe(true)
|
|
99
|
+
const listed = modelIdsByKindMode("image", ["t2i", "i2i", "edit"], { includeHidden: true })
|
|
100
|
+
expect(listed).not.toContain("gpt-image-2-6-economy")
|
|
101
|
+
expect(listed).not.toContain("gpt-image-2-6-economy-i2i")
|
|
102
|
+
expect(listed).toContain("gpt-image-2-6-flare")
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it("Economy has no quality or size setting", () => {
|
|
106
|
+
expect(normalizeModelInput("gpt-image-2-6-economy", { quality: "high", resolution: "4K" }))
|
|
107
|
+
.toMatchObject({ quality: undefined, resolution: undefined })
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it("each text-to-image id has its edit sibling", () => {
|
|
111
|
+
for (const flavour of ["flare", "sunburst", "economy"]) {
|
|
112
|
+
expect(T2I_TO_I2I_VARIANT[`gpt-image-2-6-${flavour}`]).toBe(`gpt-image-2-6-${flavour}-i2i`)
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
describe("the background setting", () => {
|
|
118
|
+
const WITH_BACKGROUND = [...ALL, "gpt-image-2-5-flare", "gpt-image-2-5-flare-i2i", "gpt-image-2-5-sunburst", "gpt-image-2-5-sunburst-i2i"]
|
|
119
|
+
|
|
120
|
+
it.each(WITH_BACKGROUND)("%s offers auto, opaque and transparent", (id) => {
|
|
121
|
+
expect(MODEL_CATALOG[id]?.backgrounds).toEqual(["auto", "opaque", "transparent"])
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it.each(["gpt-image-2", "gpt-image-2-i2i"])("%s has no background setting: KIE failed it live, so a value sent is dropped", (id) => {
|
|
125
|
+
expect(MODEL_CATALOG[id]?.backgrounds).toBeUndefined()
|
|
126
|
+
const out = normalizeModelInput(id, { background: "transparent", resolution: "2K" })
|
|
127
|
+
expect(out.background).toBeUndefined()
|
|
128
|
+
expect(out.resolution).toBe("2K")
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
it("a model without the setting drops the value and says so", () => {
|
|
132
|
+
const out = normalizeModelInput("nano-banana-pro", { background: "transparent" })
|
|
133
|
+
expect(out.background).toBeUndefined()
|
|
134
|
+
expect(out.adjustments).toEqual([expect.objectContaining({ field: "background", from: "transparent", to: undefined })])
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it.each(["gpt-image-2-6-flare", "gpt-image-2-5-sunburst"])("%s: transparent moves the size to 1K and says so", (id) => {
|
|
138
|
+
const out = normalizeModelInput(id, { background: "transparent", resolution: "4K" })
|
|
139
|
+
expect(out).toMatchObject({ background: "transparent", resolution: "1K" })
|
|
140
|
+
expect(out.adjustments).toEqual([expect.objectContaining({ field: "resolution", from: "4K", to: "1K" })])
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
it("an opaque background keeps the size", () => {
|
|
144
|
+
expect(normalizeModelInput("gpt-image-2-6-flare", { background: "opaque", resolution: "4K" }))
|
|
145
|
+
.toMatchObject({ background: "opaque", resolution: "4K", adjustments: [] })
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
it("transparent with no size stays with no size (the model's 1K default)", () => {
|
|
149
|
+
expect(normalizeModelInput("gpt-image-2-6-flare", { background: "transparent" }).resolution).toBeUndefined()
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it("the price follows the size a transparent run renders at", () => {
|
|
153
|
+
const n = resolveNormalizedImageGen({ provider: "gpt-image-2-6-flare", resolution: "4K", quality: "high", background: "transparent", refCount: 0 })
|
|
154
|
+
expect(n.identifier).toBe("gpt-image-2-6-flare:high:1K")
|
|
155
|
+
expect(n.background).toBe("transparent")
|
|
156
|
+
const old = resolveNormalizedImageGen({ provider: "gpt-image-2-5-flare", resolution: "4K", background: "transparent", refCount: 0 })
|
|
157
|
+
expect(old.identifier).toBe("gpt-image-2-5-flare")
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
describe("the most input images one request may carry", () => {
|
|
162
|
+
it.each(["gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"])("%s takes 16", (id) => {
|
|
163
|
+
expect(requestImageLimit(id)).toBe(16)
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
it.each(["gpt-image-2-6-economy-i2i", "gpt-image-2-5-flare-i2i", "gpt-image-2-i2i", "nano-banana-pro", "seedream-edit", undefined])("%s keeps the default", (id) => {
|
|
167
|
+
expect(requestImageLimit(id)).toBe(DEFAULT_REQUEST_IMAGE_LIMIT)
|
|
168
|
+
expect(DEFAULT_REQUEST_IMAGE_LIMIT).toBe(14)
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
it("the routes' outer bound is the largest limit", () => {
|
|
172
|
+
expect(MAX_REQUEST_IMAGE_LIMIT).toBe(16)
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
describe("GPT Image 2.6: the images a run sends", () => {
|
|
177
|
+
const A = "https://a.png"
|
|
178
|
+
const B = "https://b.png"
|
|
179
|
+
|
|
180
|
+
it("a base image is one more image", () => {
|
|
181
|
+
expect(gptImage26SentImages("gpt-image-2-6-flare", [], A)).toBe(1)
|
|
182
|
+
expect(gptImage26SentImages("gpt-image-2-6-flare", [B], A)).toBe(2)
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
it("a base already among the references is not counted twice", () => {
|
|
186
|
+
expect(gptImage26SentImages("gpt-image-2-6-flare", [A, B], A)).toBe(2)
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
it("no base, and any other model, is the references alone", () => {
|
|
190
|
+
expect(gptImage26SentImages("gpt-image-2-6-flare", [A], undefined)).toBe(1)
|
|
191
|
+
expect(gptImage26SentImages("flux-2-pro", [B], A)).toBe(1)
|
|
192
|
+
expect(gptImage26SentImages(undefined, [B], A)).toBe(1)
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
it("an estimate counts every source of an image", () => {
|
|
196
|
+
const data = { referenceImageUrls: [A], characterDefinitionIds: ["c1", "c2"], baseImageUrl: B }
|
|
197
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", data, 1)).toBe(5)
|
|
198
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare-i2i", {}, 0)).toBe(1)
|
|
199
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", { sourceImageUrl: A }, 0)).toBe(1)
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it("an edit's estimate counts every image it sends", () => {
|
|
203
|
+
const edit = "gpt-image-2-6-flare-i2i"
|
|
204
|
+
const fourWired = Array.from({ length: 4 }, () => ({ target: "n", targetHandle: "image" }))
|
|
205
|
+
expect(gptImage26EstimatedImages(edit, {}, countImageInputEdges(fourWired, "n"))).toBe(4)
|
|
206
|
+
expect(gptImage26EstimatedImages(edit, {}, countImageInputEdges(fourWired.slice(0, 1), "n"))).toBe(1)
|
|
207
|
+
expect(gptImage26EstimatedImages(edit, { extraRefs: [{ url: A }, { url: B }] }, 0)).toBe(3)
|
|
208
|
+
expect(gptImage26EstimatedImages(edit, { referenceImageUrl: A }, 0)).toBe(2)
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
it("wires count reference images, identity nodes and every image wire after the source, for this node only", () => {
|
|
212
|
+
const edges = [
|
|
213
|
+
{ target: "n", targetHandle: "references" },
|
|
214
|
+
{ target: "n", targetHandle: "assets" },
|
|
215
|
+
{ target: "n", targetHandle: "image" },
|
|
216
|
+
{ target: "n", targetHandle: "image" },
|
|
217
|
+
{ target: "n", targetHandle: "prompt" },
|
|
218
|
+
{ target: "other", targetHandle: "assets" },
|
|
219
|
+
]
|
|
220
|
+
expect(countImageInputEdges(edges, "n")).toBe(3)
|
|
221
|
+
})
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
describe("the background setting's size rule", () => {
|
|
225
|
+
it("GPT Image 2.5: transparent above 1K moves to 1K", () => {
|
|
226
|
+
for (const id of ["gpt-image-2-5-flare", "gpt-image-2-5-sunburst-i2i"]) {
|
|
227
|
+
const r = normalizeModelInput(id, { resolution: "2K", background: "transparent" })
|
|
228
|
+
expect(r.resolution, id).toBe("1K")
|
|
229
|
+
expect(r.background, id).toBe("transparent")
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
it("GPT Image 2.5: opaque above 1K is not sent, and says so", () => {
|
|
234
|
+
const r = normalizeModelInput("gpt-image-2-5-flare", { resolution: "4K", background: "opaque" })
|
|
235
|
+
expect(r.resolution).toBe("4K")
|
|
236
|
+
expect(r.background).toBeUndefined()
|
|
237
|
+
expect(r.adjustments.map((a) => a.field)).toContain("background")
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
it("GPT Image 2.5: auto above 1K is not sent, with nothing to say", () => {
|
|
241
|
+
const r = normalizeModelInput("gpt-image-2-5-flare", { resolution: "2K", background: "auto" })
|
|
242
|
+
expect(r.background).toBeUndefined()
|
|
243
|
+
expect(r.adjustments).toEqual([])
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
it("GPT Image 2.5: any value at 1K is sent", () => {
|
|
247
|
+
expect(normalizeModelInput("gpt-image-2-5-flare", { resolution: "1K", background: "opaque" }).background).toBe("opaque")
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
it("GPT Image 2.6: opaque and auto stay at any size, transparent moves to 1K", () => {
|
|
251
|
+
expect(normalizeModelInput("gpt-image-2-6-flare", { resolution: "4K", background: "opaque" }).background).toBe("opaque")
|
|
252
|
+
const r = normalizeModelInput("gpt-image-2-6-flare", { resolution: "4K", background: "transparent" })
|
|
253
|
+
expect(r.resolution).toBe("1K")
|
|
254
|
+
expect(r.background).toBe("transparent")
|
|
255
|
+
})
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
describe("GPT Image 2.6 estimates and a moodboard", () => {
|
|
259
|
+
it("counts the most pictures a moodboard can add, so a quote is never below the run", () => {
|
|
260
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", { direction: { style: "moodboard:abc" } }, 0)).toBe(12)
|
|
261
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", { direction: { style: ["moodboard:abc"] } }, 1)).toBe(13)
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
it("a catalog style or a palette adds no image", () => {
|
|
265
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", { direction: { style: "noir" } }, 0)).toBe(0)
|
|
266
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", { direction: { colorLook: "palette:abc" } }, 0)).toBe(0)
|
|
267
|
+
expect(gptImage26EstimatedImages("gpt-image-2-6-flare", { direction: "moodboard:abc" }, 0)).toBe(0)
|
|
268
|
+
})
|
|
269
|
+
})
|
|
270
|
+
|
|
271
|
+
describe("GPT Image 2.6 keeps Auto a choice", () => {
|
|
272
|
+
it("a run with no quality renders at the default, and a value it does not take snaps there", () => {
|
|
273
|
+
expect(MODEL_CATALOG["gpt-image-2-6-flare"]?.qualities?.[0]).toBe("auto")
|
|
274
|
+
expect(normalizeModelInput("gpt-image-2-6-flare", { quality: "basic" }).quality).toBe("medium")
|
|
275
|
+
expect(normalizeModelInput("gpt-image-2-6-sunburst", { quality: "turbo" }).quality).toBe("medium")
|
|
276
|
+
})
|
|
277
|
+
})
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
IMAGE_MODEL_ROLE_DEFAULTS,
|
|
5
5
|
IMAGE_MODEL_RATIO_FALLBACKS,
|
|
6
6
|
defaultImageModel,
|
|
7
|
+
defaultImageModelForNode,
|
|
7
8
|
imageModelDrawsRatio,
|
|
8
9
|
} from "../image-model-roles.js"
|
|
9
10
|
|
|
@@ -13,7 +14,7 @@ describe("image model role defaults (decided 2026-10-08)", () => {
|
|
|
13
14
|
character: "gpt-image-2",
|
|
14
15
|
general: "gpt-image-2",
|
|
15
16
|
anchor: "gpt-image-2",
|
|
16
|
-
edit: "gpt-image-2-
|
|
17
|
+
edit: "gpt-image-2-6-flare-i2i",
|
|
17
18
|
})
|
|
18
19
|
})
|
|
19
20
|
|
|
@@ -32,24 +33,42 @@ describe("image model role defaults (decided 2026-10-08)", () => {
|
|
|
32
33
|
for (const r of [undefined, null, "", "auto", "1:1", "16:9", "9:16", "4:3", "3:4"]) {
|
|
33
34
|
expect(defaultImageModel("general", r)).toBe("gpt-image-2")
|
|
34
35
|
}
|
|
35
|
-
expect(defaultImageModel("edit", "16:9")).toBe("gpt-image-2-
|
|
36
|
+
expect(defaultImageModel("edit", "16:9")).toBe("gpt-image-2-6-flare-i2i")
|
|
36
37
|
})
|
|
37
38
|
|
|
38
|
-
it("moves wide and in-between ratios to Sunburst
|
|
39
|
-
for (const r of ["21:9", "3:2", "2:3", "
|
|
40
|
-
expect(defaultImageModel("character", r)).toBe("gpt-image-2-
|
|
41
|
-
expect(defaultImageModel("anchor", r)).toBe("gpt-image-2-
|
|
39
|
+
it("moves wide and in-between ratios to 2.6 Sunburst", () => {
|
|
40
|
+
for (const r of ["21:9", "3:2", "2:3", "4:5", "5:4"]) {
|
|
41
|
+
expect(defaultImageModel("character", r)).toBe("gpt-image-2-6-sunburst")
|
|
42
|
+
expect(defaultImageModel("anchor", r)).toBe("gpt-image-2-6-sunburst")
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
expect(defaultImageModel("general", "4:5")).toBe("gpt-image-2-6-sunburst")
|
|
45
|
+
expect(defaultImageModel("edit", "4:5")).toBe("gpt-image-2-6-flare-i2i")
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it("keeps 2.5 Sunburst behind 2.6 for a ratio only 2.5 draws, and Nano Banana Pro last", () => {
|
|
49
|
+
for (const role of ["character", "general", "anchor"] as const) {
|
|
50
|
+
expect(IMAGE_MODEL_RATIO_FALLBACKS[role]).toEqual(["gpt-image-2-6-sunburst", "gpt-image-2-5-sunburst", "nano-banana-pro"])
|
|
46
51
|
}
|
|
52
|
+
expect(IMAGE_MODEL_RATIO_FALLBACKS.edit).toEqual(["gpt-image-2-6-sunburst-i2i", "gpt-image-2-5-sunburst-i2i", "nano-banana-pro"])
|
|
53
|
+
const only25 = (MODEL_CATALOG["gpt-image-2-5-sunburst"]!.aspectRatios ?? []).filter(
|
|
54
|
+
(r) => !imageModelDrawsRatio("gpt-image-2-6-sunburst", r) && !imageModelDrawsRatio("gpt-image-2", r),
|
|
55
|
+
)
|
|
56
|
+
for (const r of only25) expect(defaultImageModel("general", r)).toBe("gpt-image-2-5-sunburst")
|
|
47
57
|
})
|
|
48
58
|
|
|
49
59
|
it("falls back to the role model when nothing draws the ratio", () => {
|
|
50
60
|
expect(defaultImageModel("general", "7:1")).toBe("gpt-image-2")
|
|
51
61
|
})
|
|
52
62
|
|
|
63
|
+
it("names each image node's default the way its route does", () => {
|
|
64
|
+
expect(defaultImageModelForNode("generate-image", "1:1")).toBe("gpt-image-2")
|
|
65
|
+
expect(defaultImageModelForNode("generate-image", "21:9")).toBe("gpt-image-2-6-sunburst")
|
|
66
|
+
expect(defaultImageModelForNode("image-to-image")).toBe("gpt-image-2-6-flare-i2i")
|
|
67
|
+
expect(defaultImageModelForNode("modify-image")).toBe("gpt-image-2-6-flare-i2i")
|
|
68
|
+
expect(defaultImageModelForNode("reference-board", "2:3")).toBe("gpt-image-2-6-sunburst")
|
|
69
|
+
expect(defaultImageModelForNode("text-to-speech")).toBeUndefined()
|
|
70
|
+
})
|
|
71
|
+
|
|
53
72
|
it("reads ratios from the catalog", () => {
|
|
54
73
|
expect(imageModelDrawsRatio("gpt-image-2", "21:9")).toBe(false)
|
|
55
74
|
expect(imageModelDrawsRatio("gpt-image-2-5-sunburst", "21:9")).toBe(true)
|