@nodaro/shared 3.59.0 → 3.60.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-QE7W4YIK.cjs → chunk-5G23AJBU.cjs} +6 -6
- package/dist/{chunk-QE7W4YIK.cjs.map → chunk-5G23AJBU.cjs.map} +1 -1
- package/dist/{chunk-DKZGLIFW.cjs → chunk-5HK5Z5OB.cjs} +4 -4
- package/dist/{chunk-DKZGLIFW.cjs.map → chunk-5HK5Z5OB.cjs.map} +1 -1
- package/dist/{chunk-RSXQOFM7.cjs → chunk-5Y42RIGY.cjs} +8 -8
- package/dist/{chunk-RSXQOFM7.cjs.map → chunk-5Y42RIGY.cjs.map} +1 -1
- package/dist/{chunk-FHCMYGBV.js → chunk-6AJOTEVC.js} +3 -3
- package/dist/{chunk-FHCMYGBV.js.map → chunk-6AJOTEVC.js.map} +1 -1
- package/dist/{chunk-ZVUVSD5X.js → chunk-6Q6SI7AG.js} +3 -3
- package/dist/{chunk-ZVUVSD5X.js.map → chunk-6Q6SI7AG.js.map} +1 -1
- package/dist/{chunk-V3NONYLA.cjs → chunk-A6HRY3WF.cjs} +269 -18
- package/dist/chunk-A6HRY3WF.cjs.map +1 -0
- package/dist/{chunk-D574HZ35.cjs → chunk-AXT7YNOR.cjs} +51 -51
- package/dist/{chunk-D574HZ35.cjs.map → chunk-AXT7YNOR.cjs.map} +1 -1
- package/dist/{chunk-TA7ODVYJ.js → chunk-AZGONXWV.js} +4 -4
- package/dist/{chunk-TA7ODVYJ.js.map → chunk-AZGONXWV.js.map} +1 -1
- package/dist/{chunk-OFL4UH6L.cjs → chunk-BDXXOEBZ.cjs} +80 -57
- package/dist/chunk-BDXXOEBZ.cjs.map +1 -0
- package/dist/{chunk-NSZTHJZJ.cjs → chunk-BGIJO5V4.cjs} +39 -39
- package/dist/{chunk-NSZTHJZJ.cjs.map → chunk-BGIJO5V4.cjs.map} +1 -1
- package/dist/{chunk-NZRG5CXQ.cjs → chunk-BLJUCPMV.cjs} +5 -2
- package/dist/chunk-BLJUCPMV.cjs.map +1 -0
- package/dist/{chunk-NHZWVKGV.cjs → chunk-BXNPO3PL.cjs} +8 -8
- package/dist/{chunk-NHZWVKGV.cjs.map → chunk-BXNPO3PL.cjs.map} +1 -1
- package/dist/{chunk-UPD7W2KJ.cjs → chunk-CIOXUPCJ.cjs} +12 -12
- package/dist/{chunk-UPD7W2KJ.cjs.map → chunk-CIOXUPCJ.cjs.map} +1 -1
- package/dist/{chunk-YE4EDT57.cjs → chunk-DQIJPDHC.cjs} +11 -11
- package/dist/{chunk-YE4EDT57.cjs.map → chunk-DQIJPDHC.cjs.map} +1 -1
- package/dist/{chunk-UMPZR56R.js → chunk-DS2TOM32.js} +3 -3
- package/dist/{chunk-UMPZR56R.js.map → chunk-DS2TOM32.js.map} +1 -1
- package/dist/{chunk-YSEJOJNQ.js → chunk-EN2YI5TV.js} +3 -3
- package/dist/{chunk-YSEJOJNQ.js.map → chunk-EN2YI5TV.js.map} +1 -1
- package/dist/{chunk-ZU56AMFK.js → chunk-G6GMY5BC.js} +20 -4
- package/dist/chunk-G6GMY5BC.js.map +1 -0
- package/dist/chunk-G7ZYZQKO.cjs +27 -0
- package/dist/{chunk-6VXDW2U3.cjs.map → chunk-G7ZYZQKO.cjs.map} +1 -1
- package/dist/{chunk-PEATSEAD.cjs → chunk-GNPJ2JLE.cjs} +6 -6
- package/dist/{chunk-PEATSEAD.cjs.map → chunk-GNPJ2JLE.cjs.map} +1 -1
- package/dist/{chunk-VLQW4CVW.cjs → chunk-GWBQ3GPO.cjs} +41 -21
- package/dist/chunk-GWBQ3GPO.cjs.map +1 -0
- package/dist/{chunk-P7KSB5T6.cjs → chunk-HDHLZK7C.cjs} +5 -5
- package/dist/{chunk-P7KSB5T6.cjs.map → chunk-HDHLZK7C.cjs.map} +1 -1
- package/dist/{chunk-QLLR7GUY.cjs → chunk-HNEF2N5C.cjs} +5 -5
- package/dist/{chunk-QLLR7GUY.cjs.map → chunk-HNEF2N5C.cjs.map} +1 -1
- package/dist/{chunk-7JM5EZF3.cjs → chunk-HOKWJXHA.cjs} +13 -13
- package/dist/{chunk-7JM5EZF3.cjs.map → chunk-HOKWJXHA.cjs.map} +1 -1
- package/dist/{chunk-RGBNOCIO.js → chunk-ICDLYU4I.js} +9 -9
- package/dist/{chunk-RGBNOCIO.js.map → chunk-ICDLYU4I.js.map} +1 -1
- package/dist/{chunk-FJCRWDU5.js → chunk-IV6IDECY.js} +4 -4
- package/dist/{chunk-FJCRWDU5.js.map → chunk-IV6IDECY.js.map} +1 -1
- package/dist/{chunk-PIX4OCCQ.js → chunk-JKZVRKN3.js} +36 -14
- package/dist/chunk-JKZVRKN3.js.map +1 -0
- package/dist/{chunk-MTXVODG3.js → chunk-KJZVQIN4.js} +3 -3
- package/dist/{chunk-MTXVODG3.js.map → chunk-KJZVQIN4.js.map} +1 -1
- package/dist/{chunk-2VQHPILW.js → chunk-KOLC7AF2.js} +262 -19
- package/dist/chunk-KOLC7AF2.js.map +1 -0
- package/dist/{chunk-IP7QOHWQ.js → chunk-LN3EVFRS.js} +5 -5
- package/dist/{chunk-IP7QOHWQ.js.map → chunk-LN3EVFRS.js.map} +1 -1
- package/dist/{chunk-EO4W4MA3.js → chunk-MHY47BLL.js} +4 -4
- package/dist/{chunk-EO4W4MA3.js.map → chunk-MHY47BLL.js.map} +1 -1
- package/dist/{chunk-AWS4BWEC.js → chunk-Q6IES3U2.js} +5 -2
- package/dist/chunk-Q6IES3U2.js.map +1 -0
- package/dist/{chunk-62RC6K62.cjs → chunk-RRPPXZ36.cjs} +4 -4
- package/dist/{chunk-62RC6K62.cjs.map → chunk-RRPPXZ36.cjs.map} +1 -1
- package/dist/{chunk-3R2KVYXN.js → chunk-SCYBGTX6.js} +3 -3
- package/dist/{chunk-3R2KVYXN.js.map → chunk-SCYBGTX6.js.map} +1 -1
- package/dist/{chunk-K4L4G76I.cjs → chunk-SKFJIFEV.cjs} +21 -21
- package/dist/{chunk-K4L4G76I.cjs.map → chunk-SKFJIFEV.cjs.map} +1 -1
- package/dist/{chunk-2S7YYCRT.js → chunk-TZ42IVSF.js} +4 -4
- package/dist/{chunk-2S7YYCRT.js.map → chunk-TZ42IVSF.js.map} +1 -1
- package/dist/{chunk-PIEMWFSJ.js → chunk-URLDVK67.js} +3 -3
- package/dist/{chunk-PIEMWFSJ.js.map → chunk-URLDVK67.js.map} +1 -1
- package/dist/{chunk-IOET54EV.js → chunk-VB2ARGQ6.js} +35 -3
- package/dist/chunk-VB2ARGQ6.js.map +1 -0
- package/dist/{chunk-VOZI5F7V.js → chunk-VYQ25YQF.js} +3 -3
- package/dist/{chunk-VOZI5F7V.js.map → chunk-VYQ25YQF.js.map} +1 -1
- package/dist/{chunk-QSWUSXRL.cjs → chunk-WGKAOUEQ.cjs} +41 -2
- package/dist/chunk-WGKAOUEQ.cjs.map +1 -0
- package/dist/{chunk-ORJ5HQAB.js → chunk-YHVEZVAO.js} +4 -4
- package/dist/{chunk-ORJ5HQAB.js.map → chunk-YHVEZVAO.js.map} +1 -1
- package/dist/entries/apps.cjs +43 -43
- package/dist/entries/apps.js +8 -8
- package/dist/entries/credits.cjs +155 -151
- package/dist/entries/credits.d.cts +32 -3
- package/dist/entries/credits.d.ts +32 -3
- package/dist/entries/credits.js +8 -8
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/model-catalog.cjs +144 -84
- package/dist/entries/model-catalog.d.cts +4 -47
- package/dist/entries/model-catalog.d.ts +4 -47
- package/dist/entries/model-catalog.js +5 -5
- package/dist/entries/models.cjs +305 -289
- 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 -208
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +10 -10
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +1 -1
- package/dist/entries/pipeline.d.ts +1 -1
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +117 -117
- package/dist/entries/video.js +4 -4
- package/dist/entries/workflow.cjs +147 -147
- package/dist/entries/workflow.d.cts +8 -0
- package/dist/entries/workflow.d.ts +8 -0
- package/dist/entries/workflow.js +2 -2
- package/dist/gpt-image-2-6-BeZdT-pW.d.cts +98 -0
- package/dist/gpt-image-2-6-BeZdT-pW.d.ts +98 -0
- package/dist/index.cjs +1314 -1234
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +20 -20
- package/dist/{model-catalog-QJ_AO9l0.d.cts → model-catalog-D6Es7VG-.d.cts} +56 -2
- package/dist/{model-catalog-QJ_AO9l0.d.ts → model-catalog-D6Es7VG-.d.ts} +56 -2
- package/dist/{model-constants-BwBdh6Rn.d.ts → model-constants-22k3fjp1.d.cts} +16 -1
- package/dist/{model-constants-BwBdh6Rn.d.cts → model-constants-22k3fjp1.d.ts} +16 -1
- package/package.json +1 -1
- package/src/__tests__/gpt-image-2-6-formats.test.ts +171 -0
- package/src/credit-identifiers.ts +63 -3
- package/src/entries/credits.ts +1 -0
- package/src/entries/model-catalog.ts +17 -0
- package/src/entries/models.ts +6 -0
- package/src/gpt-image-2-6.ts +72 -0
- package/src/model-catalog.ts +336 -13
- package/src/model-constants.ts +33 -0
- package/src/node-execution-state.ts +8 -0
- package/src/node-runtime-keys.ts +3 -0
- package/dist/chunk-2VQHPILW.js.map +0 -1
- package/dist/chunk-6VXDW2U3.cjs +0 -27
- package/dist/chunk-AWS4BWEC.js.map +0 -1
- package/dist/chunk-IOET54EV.js.map +0 -1
- package/dist/chunk-NZRG5CXQ.cjs.map +0 -1
- package/dist/chunk-OFL4UH6L.cjs.map +0 -1
- package/dist/chunk-PIX4OCCQ.js.map +0 -1
- package/dist/chunk-QSWUSXRL.cjs.map +0 -1
- package/dist/chunk-V3NONYLA.cjs.map +0 -1
- package/dist/chunk-VLQW4CVW.cjs.map +0 -1
- package/dist/chunk-ZU56AMFK.js.map +0 -1
|
@@ -362,6 +362,35 @@ interface ModelCatalogEntry {
|
|
|
362
362
|
* `transparentResolution`. Above it nothing is sent.
|
|
363
363
|
*/
|
|
364
364
|
backgroundOnlyAtTransparentResolution?: true;
|
|
365
|
+
/**
|
|
366
|
+
* The files this image model can write (`png`, `jpeg`, `webp`, `gif`, `svg`),
|
|
367
|
+
* the first being what it writes when none is named. Absent: a single format,
|
|
368
|
+
* not a setting, and a value sent is dropped. With `gif` the aspect ratio and
|
|
369
|
+
* size do not apply (a GIF is square, `IMAGE_GIF_FRAME_SIZE` a frame), and a
|
|
370
|
+
* transparent background is only kept with `png` and `webp`
|
|
371
|
+
* (`TRANSPARENT_OUTPUT_FORMATS`); `normalizeModelInput` says what it moved.
|
|
372
|
+
*/
|
|
373
|
+
outputFormats?: readonly string[];
|
|
374
|
+
/**
|
|
375
|
+
* How many frames a GIF of this model can have: a whole number from `min` to
|
|
376
|
+
* `max`, or one of `values` when the provider takes only some. Read only when
|
|
377
|
+
* `outputFormats` lists `gif`.
|
|
378
|
+
*/
|
|
379
|
+
gifFrames?: {
|
|
380
|
+
readonly min: number;
|
|
381
|
+
readonly max: number;
|
|
382
|
+
readonly default: number;
|
|
383
|
+
readonly values?: readonly number[];
|
|
384
|
+
};
|
|
385
|
+
/** How long each frame of a GIF shows, in ms: `min` to `max` in steps of `step`. */
|
|
386
|
+
gifFrameDurationMs?: {
|
|
387
|
+
readonly min: number;
|
|
388
|
+
readonly max: number;
|
|
389
|
+
readonly step: number;
|
|
390
|
+
readonly default: number;
|
|
391
|
+
};
|
|
392
|
+
/** The levels of detail an SVG of this model is drawn at (`standard`, `detailed`, `max`), the first the default. Read only when `outputFormats` lists `svg`. */
|
|
393
|
+
svgLevels?: readonly string[];
|
|
365
394
|
durations?: readonly number[];
|
|
366
395
|
/**
|
|
367
396
|
* The length (seconds) this model renders when the request names no duration
|
|
@@ -519,9 +548,18 @@ declare function validateModelInput(modelId: string, input: {
|
|
|
519
548
|
* `options[0]` normally).
|
|
520
549
|
*/
|
|
521
550
|
declare function defaultResolutionFor(modelId: string): string | undefined;
|
|
551
|
+
/** Every lever `normalizeModelInput` can correct, as an adjustment names it. */
|
|
552
|
+
declare const MODEL_INPUT_ADJUSTMENT_FIELDS: readonly ["aspectRatio", "resolution", "quality", "duration", "background", "outputFormat", "gifFrames", "gifFrameDurationMs", "svgLevel"];
|
|
553
|
+
type ModelInputAdjustmentField = (typeof MODEL_INPUT_ADJUSTMENT_FIELDS)[number];
|
|
554
|
+
/** The pixel size of every frame of a GIF the platform asks for: a GIF is square. */
|
|
555
|
+
declare const IMAGE_GIF_FRAME_SIZE = 512;
|
|
556
|
+
/** The output formats that take no inpainting mask: the image routes refuse a mask with them (a 400). */
|
|
557
|
+
declare const MASKLESS_OUTPUT_FORMATS: readonly string[];
|
|
558
|
+
/** The output formats that keep a transparent background; with any other a transparent one becomes `auto`. */
|
|
559
|
+
declare const TRANSPARENT_OUTPUT_FORMATS: readonly string[];
|
|
522
560
|
/** One correction `normalizeModelInput` made, for disclosure to the user. */
|
|
523
561
|
interface ModelInputAdjustment {
|
|
524
|
-
field:
|
|
562
|
+
field: ModelInputAdjustmentField;
|
|
525
563
|
/** The value that was asked for. */
|
|
526
564
|
from: string | number;
|
|
527
565
|
/** What it became — `undefined` means the lever was dropped entirely. */
|
|
@@ -534,6 +572,10 @@ interface NormalizedModelInput {
|
|
|
534
572
|
quality?: string;
|
|
535
573
|
duration?: number;
|
|
536
574
|
background?: string;
|
|
575
|
+
outputFormat?: string;
|
|
576
|
+
gifFrames?: number;
|
|
577
|
+
gifFrameDurationMs?: number;
|
|
578
|
+
svgLevel?: string;
|
|
537
579
|
/** Empty when the input was already valid. */
|
|
538
580
|
adjustments: ModelInputAdjustment[];
|
|
539
581
|
}
|
|
@@ -624,6 +666,10 @@ declare function normalizeModelInput(modelId: string, input: {
|
|
|
624
666
|
quality?: string;
|
|
625
667
|
duration?: number;
|
|
626
668
|
background?: string;
|
|
669
|
+
outputFormat?: string;
|
|
670
|
+
gifFrames?: number;
|
|
671
|
+
gifFrameDurationMs?: number;
|
|
672
|
+
svgLevel?: string;
|
|
627
673
|
}, context?: ModelInputContext): NormalizedModelInput;
|
|
628
674
|
/**
|
|
629
675
|
* `ratio` as `modelId` renders it: the catalog's own spelling when the model
|
|
@@ -733,6 +779,14 @@ declare function aspectRatioOptionsByKind(kind: ModelKind): Record<string, Label
|
|
|
733
779
|
declare function qualityOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
734
780
|
/** Same shape as `qualityOptionsByKind` but for `backgrounds`. */
|
|
735
781
|
declare function backgroundOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
782
|
+
/** How an output format is named in a menu. */
|
|
783
|
+
declare const IMAGE_OUTPUT_FORMAT_LABELS: Readonly<Record<string, string>>;
|
|
784
|
+
/** How an SVG level of detail is named in a menu (its own table: `max` is also a quality). */
|
|
785
|
+
declare const IMAGE_SVG_LEVEL_LABELS: Readonly<Record<string, string>>;
|
|
786
|
+
/** The output formats per model of a kind, the model's default first. No entry: a single format, not a setting. */
|
|
787
|
+
declare function outputFormatOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
788
|
+
/** The SVG levels per model of a kind that writes SVG. */
|
|
789
|
+
declare function svgLevelOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
736
790
|
/** One shaped model row for a picker — capabilities derived from the catalog. */
|
|
737
791
|
interface ModelMenuOption {
|
|
738
792
|
/** Catalog id (the API enum value). */
|
|
@@ -779,4 +833,4 @@ declare function modelIdsByKindMode(kind: ModelKind | null, modes: readonly Mode
|
|
|
779
833
|
includeHidden?: boolean;
|
|
780
834
|
}): [string, ...string[]];
|
|
781
835
|
|
|
782
|
-
export {
|
|
836
|
+
export { modelsWithFeature as $, creditRangesAll as A, defaultResolutionFor as B, durationsByMode as C, fitAspectRatioToModel as D, getAspectRatioOptions as E, getCreditRange as F, getDurationsForModel as G, getModel as H, IMAGE_GIF_FRAME_SIZE as I, getQualityOptions as J, getResolutionOptions as K, type LabeledOption as L, MASKLESS_OUTPUT_FORMATS as M, type NormalizedModelInput as N, groupByFamily as O, type PriceVariant as P, groupByKindAndFamily as Q, hasFeature as R, SPEECH_UNIT_PRICE_NOTE as S, TRANSPARENT_OUTPUT_FORMATS as T, isAutoAspectToken as U, type ValidationField as V, isModelMakerId as W, listModels as X, modelIdsByKindMode as Y, modelMakerOf as Z, modelTakesSeed as _, IMAGE_OUTPUT_FORMAT_LABELS as a, nearestCatalogAspectRatio as a0, normalizeModelInput as a1, normalizeVideoRequestParams as a2, outputFormatOptionsByKind as a3, qualityOptionsByKind as a4, resolutionAtAspectRatio as a5, resolutionOptionsByKind as a6, resolutionsAtAspectRatio as a7, svgLevelOptionsByKind as a8, validateModelInput as a9, IMAGE_SVG_LEVEL_LABELS as b, MODEL_CATALOG as c, MODEL_INPUT_ADJUSTMENT_FIELDS as d, MODEL_KINDS as e, MODEL_MAKERS as f, MODEL_RECOMMENDATIONS as g, type ModelCatalogEntry as h, type ModelInputAdjustment as i, type ModelInputAdjustmentField as j, type ModelInputContext as k, type ModelKind as l, type ModelMaker as m, type ModelMakerId as n, type ModelMenuOption as o, type ModelMode as p, type ModelRecommendation as q, type ModelValidationIssue as r, type NormalizedVideoRequest as s, type SourceImageSize as t, type TtsCapabilities as u, type TtsSettingLever as v, aspectRatioOptionsByKind as w, autoAspectNeedsSourceImage as x, backgroundOptionsByKind as y, buildModelMenu as z };
|
|
@@ -362,6 +362,35 @@ interface ModelCatalogEntry {
|
|
|
362
362
|
* `transparentResolution`. Above it nothing is sent.
|
|
363
363
|
*/
|
|
364
364
|
backgroundOnlyAtTransparentResolution?: true;
|
|
365
|
+
/**
|
|
366
|
+
* The files this image model can write (`png`, `jpeg`, `webp`, `gif`, `svg`),
|
|
367
|
+
* the first being what it writes when none is named. Absent: a single format,
|
|
368
|
+
* not a setting, and a value sent is dropped. With `gif` the aspect ratio and
|
|
369
|
+
* size do not apply (a GIF is square, `IMAGE_GIF_FRAME_SIZE` a frame), and a
|
|
370
|
+
* transparent background is only kept with `png` and `webp`
|
|
371
|
+
* (`TRANSPARENT_OUTPUT_FORMATS`); `normalizeModelInput` says what it moved.
|
|
372
|
+
*/
|
|
373
|
+
outputFormats?: readonly string[];
|
|
374
|
+
/**
|
|
375
|
+
* How many frames a GIF of this model can have: a whole number from `min` to
|
|
376
|
+
* `max`, or one of `values` when the provider takes only some. Read only when
|
|
377
|
+
* `outputFormats` lists `gif`.
|
|
378
|
+
*/
|
|
379
|
+
gifFrames?: {
|
|
380
|
+
readonly min: number;
|
|
381
|
+
readonly max: number;
|
|
382
|
+
readonly default: number;
|
|
383
|
+
readonly values?: readonly number[];
|
|
384
|
+
};
|
|
385
|
+
/** How long each frame of a GIF shows, in ms: `min` to `max` in steps of `step`. */
|
|
386
|
+
gifFrameDurationMs?: {
|
|
387
|
+
readonly min: number;
|
|
388
|
+
readonly max: number;
|
|
389
|
+
readonly step: number;
|
|
390
|
+
readonly default: number;
|
|
391
|
+
};
|
|
392
|
+
/** The levels of detail an SVG of this model is drawn at (`standard`, `detailed`, `max`), the first the default. Read only when `outputFormats` lists `svg`. */
|
|
393
|
+
svgLevels?: readonly string[];
|
|
365
394
|
durations?: readonly number[];
|
|
366
395
|
/**
|
|
367
396
|
* The length (seconds) this model renders when the request names no duration
|
|
@@ -519,9 +548,18 @@ declare function validateModelInput(modelId: string, input: {
|
|
|
519
548
|
* `options[0]` normally).
|
|
520
549
|
*/
|
|
521
550
|
declare function defaultResolutionFor(modelId: string): string | undefined;
|
|
551
|
+
/** Every lever `normalizeModelInput` can correct, as an adjustment names it. */
|
|
552
|
+
declare const MODEL_INPUT_ADJUSTMENT_FIELDS: readonly ["aspectRatio", "resolution", "quality", "duration", "background", "outputFormat", "gifFrames", "gifFrameDurationMs", "svgLevel"];
|
|
553
|
+
type ModelInputAdjustmentField = (typeof MODEL_INPUT_ADJUSTMENT_FIELDS)[number];
|
|
554
|
+
/** The pixel size of every frame of a GIF the platform asks for: a GIF is square. */
|
|
555
|
+
declare const IMAGE_GIF_FRAME_SIZE = 512;
|
|
556
|
+
/** The output formats that take no inpainting mask: the image routes refuse a mask with them (a 400). */
|
|
557
|
+
declare const MASKLESS_OUTPUT_FORMATS: readonly string[];
|
|
558
|
+
/** The output formats that keep a transparent background; with any other a transparent one becomes `auto`. */
|
|
559
|
+
declare const TRANSPARENT_OUTPUT_FORMATS: readonly string[];
|
|
522
560
|
/** One correction `normalizeModelInput` made, for disclosure to the user. */
|
|
523
561
|
interface ModelInputAdjustment {
|
|
524
|
-
field:
|
|
562
|
+
field: ModelInputAdjustmentField;
|
|
525
563
|
/** The value that was asked for. */
|
|
526
564
|
from: string | number;
|
|
527
565
|
/** What it became — `undefined` means the lever was dropped entirely. */
|
|
@@ -534,6 +572,10 @@ interface NormalizedModelInput {
|
|
|
534
572
|
quality?: string;
|
|
535
573
|
duration?: number;
|
|
536
574
|
background?: string;
|
|
575
|
+
outputFormat?: string;
|
|
576
|
+
gifFrames?: number;
|
|
577
|
+
gifFrameDurationMs?: number;
|
|
578
|
+
svgLevel?: string;
|
|
537
579
|
/** Empty when the input was already valid. */
|
|
538
580
|
adjustments: ModelInputAdjustment[];
|
|
539
581
|
}
|
|
@@ -624,6 +666,10 @@ declare function normalizeModelInput(modelId: string, input: {
|
|
|
624
666
|
quality?: string;
|
|
625
667
|
duration?: number;
|
|
626
668
|
background?: string;
|
|
669
|
+
outputFormat?: string;
|
|
670
|
+
gifFrames?: number;
|
|
671
|
+
gifFrameDurationMs?: number;
|
|
672
|
+
svgLevel?: string;
|
|
627
673
|
}, context?: ModelInputContext): NormalizedModelInput;
|
|
628
674
|
/**
|
|
629
675
|
* `ratio` as `modelId` renders it: the catalog's own spelling when the model
|
|
@@ -733,6 +779,14 @@ declare function aspectRatioOptionsByKind(kind: ModelKind): Record<string, Label
|
|
|
733
779
|
declare function qualityOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
734
780
|
/** Same shape as `qualityOptionsByKind` but for `backgrounds`. */
|
|
735
781
|
declare function backgroundOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
782
|
+
/** How an output format is named in a menu. */
|
|
783
|
+
declare const IMAGE_OUTPUT_FORMAT_LABELS: Readonly<Record<string, string>>;
|
|
784
|
+
/** How an SVG level of detail is named in a menu (its own table: `max` is also a quality). */
|
|
785
|
+
declare const IMAGE_SVG_LEVEL_LABELS: Readonly<Record<string, string>>;
|
|
786
|
+
/** The output formats per model of a kind, the model's default first. No entry: a single format, not a setting. */
|
|
787
|
+
declare function outputFormatOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
788
|
+
/** The SVG levels per model of a kind that writes SVG. */
|
|
789
|
+
declare function svgLevelOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]>;
|
|
736
790
|
/** One shaped model row for a picker — capabilities derived from the catalog. */
|
|
737
791
|
interface ModelMenuOption {
|
|
738
792
|
/** Catalog id (the API enum value). */
|
|
@@ -779,4 +833,4 @@ declare function modelIdsByKindMode(kind: ModelKind | null, modes: readonly Mode
|
|
|
779
833
|
includeHidden?: boolean;
|
|
780
834
|
}): [string, ...string[]];
|
|
781
835
|
|
|
782
|
-
export {
|
|
836
|
+
export { modelsWithFeature as $, creditRangesAll as A, defaultResolutionFor as B, durationsByMode as C, fitAspectRatioToModel as D, getAspectRatioOptions as E, getCreditRange as F, getDurationsForModel as G, getModel as H, IMAGE_GIF_FRAME_SIZE as I, getQualityOptions as J, getResolutionOptions as K, type LabeledOption as L, MASKLESS_OUTPUT_FORMATS as M, type NormalizedModelInput as N, groupByFamily as O, type PriceVariant as P, groupByKindAndFamily as Q, hasFeature as R, SPEECH_UNIT_PRICE_NOTE as S, TRANSPARENT_OUTPUT_FORMATS as T, isAutoAspectToken as U, type ValidationField as V, isModelMakerId as W, listModels as X, modelIdsByKindMode as Y, modelMakerOf as Z, modelTakesSeed as _, IMAGE_OUTPUT_FORMAT_LABELS as a, nearestCatalogAspectRatio as a0, normalizeModelInput as a1, normalizeVideoRequestParams as a2, outputFormatOptionsByKind as a3, qualityOptionsByKind as a4, resolutionAtAspectRatio as a5, resolutionOptionsByKind as a6, resolutionsAtAspectRatio as a7, svgLevelOptionsByKind as a8, validateModelInput as a9, IMAGE_SVG_LEVEL_LABELS as b, MODEL_CATALOG as c, MODEL_INPUT_ADJUSTMENT_FIELDS as d, MODEL_KINDS as e, MODEL_MAKERS as f, MODEL_RECOMMENDATIONS as g, type ModelCatalogEntry as h, type ModelInputAdjustment as i, type ModelInputAdjustmentField as j, type ModelInputContext as k, type ModelKind as l, type ModelMaker as m, type ModelMakerId as n, type ModelMenuOption as o, type ModelMode as p, type ModelRecommendation as q, type ModelValidationIssue as r, type NormalizedVideoRequest as s, type SourceImageSize as t, type TtsCapabilities as u, type TtsSettingLever as v, aspectRatioOptionsByKind as w, autoAspectNeedsSourceImage as x, backgroundOptionsByKind as y, buildModelMenu as z };
|
|
@@ -53,6 +53,21 @@ type ImageQuality = typeof IMAGE_QUALITY_VALUES[number];
|
|
|
53
53
|
/** The `background` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
|
|
54
54
|
declare const IMAGE_BACKGROUND_VALUES: readonly ["auto", "opaque", "transparent"];
|
|
55
55
|
type ImageBackground = typeof IMAGE_BACKGROUND_VALUES[number];
|
|
56
|
+
/**
|
|
57
|
+
* The `outputFormat` vocabulary of the same two routes: the file a run writes
|
|
58
|
+
* (vocabulary bound; the catalog snap gates per model, `outputFormats`). No
|
|
59
|
+
* value is PNG. `gif` is an animation of square frames, `svg` a vector drawing.
|
|
60
|
+
*/
|
|
61
|
+
declare const IMAGE_OUTPUT_FORMAT_VALUES: readonly ["png", "jpeg", "webp", "gif", "svg"];
|
|
62
|
+
type ImageOutputFormat = typeof IMAGE_OUTPUT_FORMAT_VALUES[number];
|
|
63
|
+
/** The `svgLevel` vocabulary: how much detail an SVG is drawn with, Standard to Max. */
|
|
64
|
+
declare const IMAGE_SVG_LEVEL_VALUES: readonly ["standard", "detailed", "max"];
|
|
65
|
+
type ImageSvgLevel = typeof IMAGE_SVG_LEVEL_VALUES[number];
|
|
66
|
+
|
|
67
|
+
/** The MIME type of each output format, as it is stored and served. */
|
|
68
|
+
declare const IMAGE_OUTPUT_FORMAT_MIME: Readonly<Record<ImageOutputFormat, string>>;
|
|
69
|
+
/** The file extension each output format is stored under. */
|
|
70
|
+
declare const IMAGE_OUTPUT_FORMAT_EXT: Readonly<Record<ImageOutputFormat, string>>;
|
|
56
71
|
/** The `renderingSpeed` vocabulary (Ideogram's speed tiers — see {@link RENDERING_SPEED_SUPPORT}). */
|
|
57
72
|
declare const IMAGE_RENDERING_SPEED_VALUES: readonly ["TURBO", "BALANCED", "QUALITY"];
|
|
58
73
|
type ImageRenderingSpeed = typeof IMAGE_RENDERING_SPEED_VALUES[number];
|
|
@@ -1735,4 +1750,4 @@ declare function applyDefaultVideoSelection<D>(input: {
|
|
|
1735
1750
|
duration: D | number | undefined;
|
|
1736
1751
|
};
|
|
1737
1752
|
|
|
1738
|
-
export { IMAGE_I2I_PROVIDERS as $, AI_WRITER_PROVIDERS as A, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, type FaceSwapProvider as G, GEMINI_OMNI_12_MAX_SOURCE_SEC as H, GEMINI_OMNI_PER_SECOND_PROVIDERS as I, GEMINI_OMNI_PROVIDERS as J, GUIDANCE_SCALE_SUPPORT as K, GVP_ANCHOR_CHOICES as L, GVP_DEFAULT_PROVIDER as M, GVP_END_FRAME_PROVIDERS as N, GVP_EXTEND_PROVIDERS as O, GVP_SUPPORTED_PROVIDERS as P, type GvpAnchorChoice as Q, type GvpAnchorWireMode as R, HIGH_QUALITY_PROVIDERS as S, I2I_MASK_SUPPORT as T, I2I_STRENGTH_SUPPORT as U, IDEOGRAM_PROVIDERS as V, IMAGE_ASPECT_RATIO_VALUES as W, IMAGE_BACKGROUND_VALUES as X, IMAGE_EDIT_PROVIDERS as Y, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as Z, IMAGE_GEN_PROVIDERS as _, ASPECT_RATIO_DIMENSIONS as a,
|
|
1753
|
+
export { IMAGE_I2I_PROVIDERS as $, AI_WRITER_PROVIDERS as A, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, type FaceSwapProvider as G, GEMINI_OMNI_12_MAX_SOURCE_SEC as H, GEMINI_OMNI_PER_SECOND_PROVIDERS as I, GEMINI_OMNI_PROVIDERS as J, GUIDANCE_SCALE_SUPPORT as K, GVP_ANCHOR_CHOICES as L, GVP_DEFAULT_PROVIDER as M, GVP_END_FRAME_PROVIDERS as N, GVP_EXTEND_PROVIDERS as O, GVP_SUPPORTED_PROVIDERS as P, type GvpAnchorChoice as Q, type GvpAnchorWireMode as R, HIGH_QUALITY_PROVIDERS as S, I2I_MASK_SUPPORT as T, I2I_STRENGTH_SUPPORT as U, IDEOGRAM_PROVIDERS as V, IMAGE_ASPECT_RATIO_VALUES as W, IMAGE_BACKGROUND_VALUES as X, IMAGE_EDIT_PROVIDERS as Y, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as Z, IMAGE_GEN_PROVIDERS as _, ASPECT_RATIO_DIMENSIONS as a, RETIRED_VIDEO_PROVIDERS as a$, IMAGE_MASK_MODE as a0, IMAGE_OUTPUT_FORMAT_EXT as a1, IMAGE_OUTPUT_FORMAT_MIME as a2, IMAGE_OUTPUT_FORMAT_VALUES as a3, IMAGE_PROMPT_MAX as a4, IMAGE_QUALITY_VALUES as a5, IMAGE_RENDERING_SPEED_VALUES as a6, IMAGE_RESOLUTION_VALUES as a7, IMAGE_SVG_LEVEL_VALUES as a8, IMAGE_TO_VIDEO_PROVIDERS as a9, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as aA, MINIMAX_H3_DEFAULT_RESOLUTION as aB, MINIMAX_H3_PROVIDERS as aC, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as aD, MODIFY_IMAGE_PROVIDERS as aE, MOTION_TRANSFER_PROVIDERS as aF, MUSIC_CREDIT_ID as aG, MUSIC_PROVIDERS as aH, MUSIC_PROVIDER_LABELS as aI, type ModelPromptingStyle as aJ, type ModifyImageProvider as aK, type MotionTransferProviderType as aL, type MusicProvider as aM, NATIVE_ADAPTIVE_ASPECT as aN, NATIVE_NEGATIVE_PROMPT_MODELS as aO, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aP, NEGATIVE_PROMPT_MAX as aQ, OBJECT_MOTION_PROVIDERS as aR, type ObjectMotionProvider as aS, PRICING_DEFAULT_DURATION_SEC as aT, PRICING_DEFAULT_RESOLUTION as aU, PROMPT_HARD_CEILING as aV, QA_CHECK_PROVIDERS as aW, type QaCheckProvider as aX, REF_IMAGE_MAX_LIMITS as aY, RENDERING_SPEED_SUPPORT as aZ, REPLICATE_LIP_SYNC_PROVIDERS as a_, type ImageAspectRatio as aa, type ImageBackground as ab, type ImageEditProvider as ac, type ImageEditTargetResolution as ad, type ImageGenProvider as ae, type ImageI2IProvider as af, type ImageMaskMode as ag, type ImageOutputFormat as ah, type ImageQuality as ai, type ImageRenderingSpeed as aj, type ImageResolution as ak, type ImageSvgLevel as al, type ImageToVideoProvider as am, KLING_4_DEFAULT_RESOLUTION as an, KLING_4_MAX_MIDDLE_FRAMES as ao, KLING_4_PROVIDERS as ap, LIP_SYNC_PROVIDERS as aq, LLM_STRUCTURED_SYSTEM_MAX as ar, LLM_TEXT_INPUT_MAX as as, LOCATION_ATMOSPHERE_PROVIDERS as at, type LipSyncProvider as au, type LocationAtmosphereProvider as av, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as aw, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as ax, MAX_REQUEST_IMAGE_LIMIT as ay, MAX_TTS_CHARS_BY_PROVIDER as az, AUDIO_ADDON_PROVIDERS as b, VIDEO_PROVIDERS_WITHOUT_DISPATCH as b$, type RefAudioCheck as b0, type RefAudioProbe as b1, type RefAudioRule as b2, type RefVideoDurationLimit as b3, SCRIPT_PROVIDERS as b4, SEEDANCE_2_5_REF_LIMITS as b5, SEEDANCE_2_CONTINUATION_REF_SEC as b6, SEEDANCE_2_EXTEND_STITCH as b7, SEEDANCE_2_PROVIDERS as b8, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as b9, TRANSCRIBE_PROVIDERS as bA, TRANSCRIBE_PROVIDER_CAPABILITIES as bB, TTS_OUTPUT_FORMATS as bC, TTS_OUTPUT_FORMAT_FILES as bD, TTS_PROVIDERS as bE, TTS_TEXT_MAX as bF, TWO_K_RESOLUTION_PROVIDERS as bG, type TaskChainedEditProvider as bH, type TextToAudioProvider as bI, type TextToVideoProvider as bJ, type TranscribeLane as bK, type TranscribeProvider as bL, type TtsOutputFormat as bM, type TtsProvider as bN, UPSCALE_IMAGE_PROVIDERS as bO, type UpscaleImageProvider as bP, VARIABLE_PRICING_MODELS as bQ, VEO_PROVIDERS as bR, VIDEO_AUDIO_CAPABILITY as bS, VIDEO_DURATION_TIERS as bT, VIDEO_GEN_COLLAPSED_T2V_IDS as bU, VIDEO_GEN_PROVIDERS as bV, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bW, VIDEO_MODEL_CAPS as bX, VIDEO_MODE_ALIASES as bY, VIDEO_PROMPT_MAX as bZ, VIDEO_PROVIDERS_REQUIRING_IMAGE as b_, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as ba, SEEDANCE_2_REF_LIMITS as bb, SEEDANCE_LIP_SYNC_PROVIDERS as bc, SEEDANCE_VIDEO_EDIT_PROVIDERS as bd, SEEDANCE_VIDEO_EDIT_SHAPE as be, SEED_SUPPORT as bf, SUNO_ACTIVE_MODELS as bg, SUNO_ADD_TRACK_MODELS as bh, SUNO_DURATION_MODELS as bi, SUNO_HARD_CEILING as bj, SUNO_LEGACY_MODELS as bk, SUNO_MODELS as bl, SUNO_TEXT_MAX as bm, SUNO_TITLE_MAX as bn, type SceneInputMode as bo, SceneInputModeSchema as bp, type ScriptProvider as bq, type SeedanceVideoEditProvider as br, type SunoAddTrackModel as bs, type SunoModel as bt, T2I_TO_I2I_VARIANT as bu, TASK_CHAINED_EDIT_PROVIDERS as bv, TASK_CHAINED_EDIT_PROVIDER_IDS as bw, TEXT_TO_AUDIO_PROVIDERS as bx, TEXT_TO_VIDEO_PROVIDERS as by, TRANSCRIBE_LANES as bz, type AiWriterProvider as c, preferredInputModeForModel as c$, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as c0, VIDEO_REF_AUDIO_RULES as c1, VIDEO_REF_LIMITS_BY_PROVIDER as c2, VIDEO_REF_RATE_PROVIDERS as c3, VIDEO_REF_VIDEO_DURATION_LIMITS as c4, VIDEO_TO_VIDEO_NODE_PROVIDERS as c5, VIDEO_TO_VIDEO_PROVIDERS as c6, VIDEO_UPSCALE_PROVIDERS as c7, VIDEO_VARIABLE_PRICING as c8, VIDU_Q4_DEFAULT_RESOLUTION as c9, getMaxSunoStyleChars as cA, getMaxTtsChars as cB, getMaxVideoPromptChars as cC, getVideoAudioCapability as cD, hasContiguousSegmentDurations as cE, imageReferenceLimit as cF, isGeminiOmniPerSecondProvider as cG, isGeminiOmniProvider as cH, isGvpSupportedProvider as cI, isKling4Provider as cJ, isLegacySunoModel as cK, isMinimaxH3Provider as cL, isSeedance2Provider as cM, isSeedanceVideoEditProvider as cN, isVeoProvider as cO, isViduQ4Provider as cP, isWan3Provider as cQ, kling4KeyframeFrameCap as cR, maxSegmentSecFor as cS, maxSegmentsFor as cT, maxVideoDurationSec as cU, minSegmentSecFor as cV, modelsForInputMode as cW, normalizeKling4Resolution as cX, normalizeMinimaxH3Resolution as cY, normalizeViduQ4Resolution as cZ, normalizeWan3Resolution as c_, VIDU_Q4_PROVIDERS as ca, VOICE_DESIGN_MODELS as cb, type VideoAudioCapability as cc, type VideoAudioMode as cd, type VideoGenProvider as ce, type VideoModeAlias as cf, type VideoModelCapabilities as cg, type VideoReferenceSyntax as ch, type VideoToVideoNodeProvider as ci, type VideoToVideoProvider as cj, type VideoUpscaleProvider as ck, type VoiceDesignModel as cl, WAN_3_DEFAULT_RESOLUTION as cm, WAN_3_PROVIDERS as cn, applyDefaultVideoSelection as co, applyVideoAudioToggle as cp, applyVideoNegativePrompt as cq, billsReferenceVideoSeconds as cr, canonicalVideoProvider as cs, checkRefAudioRules as ct, checkRefVideoDurations as cu, defaultVideoAspectRatio as cv, findSeedance2AudioOverLimit as cw, getMaxImagePromptChars as cx, getMaxNegativePromptChars as cy, getMaxSunoPromptChars as cz, COMPOSER_PLAN_FIELDS as d, pricedOutputDurationSec as d0, requestImageLimit as d1, resolveGvpAnchorWire as d2, resolveMusicProvider as d3, resolveVideoModeForInputs as d4, resolveVideoProviderForMode as d5, seedance2AudioLimitSec as d6, segmentDurationsFor as d7, snapToNearestDuration as d8, sunoModelHonoursDuration as d9, supportsAutoVideoDuration as da, supportsEndAnchor as db, supportsExtendRender as dc, transcribeLaneSupportsWordTimestamps as dd, transcribeProvidersWithWordTimestamps as de, videoDefaultDurationSec as df, videoModelCanSpeakDialogue as dg, videoModelSupportsAudio as dh, videoNegativeSuffix as di, videoProviderAppendsFrames as dj, videoProviderFoldsLoneEndFrame as dk, videoProviderRefModeFrameSeats as dl, videoProviderReferenceSyntax as dm, videoProviderRequiresImage as dn, videoProviderRunsFromReferences as dp, videoSourceTrimMaxSec as dq, 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_VIDEO_TO_VIDEO_PROVIDER as s, DEFAULT_VOICE_DESIGN_MODEL as t, DIALOGUE_PROVIDERS as u, DURATION_PRICED_PROVIDERS as v, type DialogueProvider as w, type ExtendVideoProvider as x, FAL_LIP_SYNC_PROVIDERS as y, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as z };
|
|
@@ -53,6 +53,21 @@ type ImageQuality = typeof IMAGE_QUALITY_VALUES[number];
|
|
|
53
53
|
/** The `background` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
|
|
54
54
|
declare const IMAGE_BACKGROUND_VALUES: readonly ["auto", "opaque", "transparent"];
|
|
55
55
|
type ImageBackground = typeof IMAGE_BACKGROUND_VALUES[number];
|
|
56
|
+
/**
|
|
57
|
+
* The `outputFormat` vocabulary of the same two routes: the file a run writes
|
|
58
|
+
* (vocabulary bound; the catalog snap gates per model, `outputFormats`). No
|
|
59
|
+
* value is PNG. `gif` is an animation of square frames, `svg` a vector drawing.
|
|
60
|
+
*/
|
|
61
|
+
declare const IMAGE_OUTPUT_FORMAT_VALUES: readonly ["png", "jpeg", "webp", "gif", "svg"];
|
|
62
|
+
type ImageOutputFormat = typeof IMAGE_OUTPUT_FORMAT_VALUES[number];
|
|
63
|
+
/** The `svgLevel` vocabulary: how much detail an SVG is drawn with, Standard to Max. */
|
|
64
|
+
declare const IMAGE_SVG_LEVEL_VALUES: readonly ["standard", "detailed", "max"];
|
|
65
|
+
type ImageSvgLevel = typeof IMAGE_SVG_LEVEL_VALUES[number];
|
|
66
|
+
|
|
67
|
+
/** The MIME type of each output format, as it is stored and served. */
|
|
68
|
+
declare const IMAGE_OUTPUT_FORMAT_MIME: Readonly<Record<ImageOutputFormat, string>>;
|
|
69
|
+
/** The file extension each output format is stored under. */
|
|
70
|
+
declare const IMAGE_OUTPUT_FORMAT_EXT: Readonly<Record<ImageOutputFormat, string>>;
|
|
56
71
|
/** The `renderingSpeed` vocabulary (Ideogram's speed tiers — see {@link RENDERING_SPEED_SUPPORT}). */
|
|
57
72
|
declare const IMAGE_RENDERING_SPEED_VALUES: readonly ["TURBO", "BALANCED", "QUALITY"];
|
|
58
73
|
type ImageRenderingSpeed = typeof IMAGE_RENDERING_SPEED_VALUES[number];
|
|
@@ -1735,4 +1750,4 @@ declare function applyDefaultVideoSelection<D>(input: {
|
|
|
1735
1750
|
duration: D | number | undefined;
|
|
1736
1751
|
};
|
|
1737
1752
|
|
|
1738
|
-
export { IMAGE_I2I_PROVIDERS as $, AI_WRITER_PROVIDERS as A, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, type FaceSwapProvider as G, GEMINI_OMNI_12_MAX_SOURCE_SEC as H, GEMINI_OMNI_PER_SECOND_PROVIDERS as I, GEMINI_OMNI_PROVIDERS as J, GUIDANCE_SCALE_SUPPORT as K, GVP_ANCHOR_CHOICES as L, GVP_DEFAULT_PROVIDER as M, GVP_END_FRAME_PROVIDERS as N, GVP_EXTEND_PROVIDERS as O, GVP_SUPPORTED_PROVIDERS as P, type GvpAnchorChoice as Q, type GvpAnchorWireMode as R, HIGH_QUALITY_PROVIDERS as S, I2I_MASK_SUPPORT as T, I2I_STRENGTH_SUPPORT as U, IDEOGRAM_PROVIDERS as V, IMAGE_ASPECT_RATIO_VALUES as W, IMAGE_BACKGROUND_VALUES as X, IMAGE_EDIT_PROVIDERS as Y, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as Z, IMAGE_GEN_PROVIDERS as _, ASPECT_RATIO_DIMENSIONS as a,
|
|
1753
|
+
export { IMAGE_I2I_PROVIDERS as $, AI_WRITER_PROVIDERS as A, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, type FaceSwapProvider as G, GEMINI_OMNI_12_MAX_SOURCE_SEC as H, GEMINI_OMNI_PER_SECOND_PROVIDERS as I, GEMINI_OMNI_PROVIDERS as J, GUIDANCE_SCALE_SUPPORT as K, GVP_ANCHOR_CHOICES as L, GVP_DEFAULT_PROVIDER as M, GVP_END_FRAME_PROVIDERS as N, GVP_EXTEND_PROVIDERS as O, GVP_SUPPORTED_PROVIDERS as P, type GvpAnchorChoice as Q, type GvpAnchorWireMode as R, HIGH_QUALITY_PROVIDERS as S, I2I_MASK_SUPPORT as T, I2I_STRENGTH_SUPPORT as U, IDEOGRAM_PROVIDERS as V, IMAGE_ASPECT_RATIO_VALUES as W, IMAGE_BACKGROUND_VALUES as X, IMAGE_EDIT_PROVIDERS as Y, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as Z, IMAGE_GEN_PROVIDERS as _, ASPECT_RATIO_DIMENSIONS as a, RETIRED_VIDEO_PROVIDERS as a$, IMAGE_MASK_MODE as a0, IMAGE_OUTPUT_FORMAT_EXT as a1, IMAGE_OUTPUT_FORMAT_MIME as a2, IMAGE_OUTPUT_FORMAT_VALUES as a3, IMAGE_PROMPT_MAX as a4, IMAGE_QUALITY_VALUES as a5, IMAGE_RENDERING_SPEED_VALUES as a6, IMAGE_RESOLUTION_VALUES as a7, IMAGE_SVG_LEVEL_VALUES as a8, IMAGE_TO_VIDEO_PROVIDERS as a9, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as aA, MINIMAX_H3_DEFAULT_RESOLUTION as aB, MINIMAX_H3_PROVIDERS as aC, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as aD, MODIFY_IMAGE_PROVIDERS as aE, MOTION_TRANSFER_PROVIDERS as aF, MUSIC_CREDIT_ID as aG, MUSIC_PROVIDERS as aH, MUSIC_PROVIDER_LABELS as aI, type ModelPromptingStyle as aJ, type ModifyImageProvider as aK, type MotionTransferProviderType as aL, type MusicProvider as aM, NATIVE_ADAPTIVE_ASPECT as aN, NATIVE_NEGATIVE_PROMPT_MODELS as aO, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aP, NEGATIVE_PROMPT_MAX as aQ, OBJECT_MOTION_PROVIDERS as aR, type ObjectMotionProvider as aS, PRICING_DEFAULT_DURATION_SEC as aT, PRICING_DEFAULT_RESOLUTION as aU, PROMPT_HARD_CEILING as aV, QA_CHECK_PROVIDERS as aW, type QaCheckProvider as aX, REF_IMAGE_MAX_LIMITS as aY, RENDERING_SPEED_SUPPORT as aZ, REPLICATE_LIP_SYNC_PROVIDERS as a_, type ImageAspectRatio as aa, type ImageBackground as ab, type ImageEditProvider as ac, type ImageEditTargetResolution as ad, type ImageGenProvider as ae, type ImageI2IProvider as af, type ImageMaskMode as ag, type ImageOutputFormat as ah, type ImageQuality as ai, type ImageRenderingSpeed as aj, type ImageResolution as ak, type ImageSvgLevel as al, type ImageToVideoProvider as am, KLING_4_DEFAULT_RESOLUTION as an, KLING_4_MAX_MIDDLE_FRAMES as ao, KLING_4_PROVIDERS as ap, LIP_SYNC_PROVIDERS as aq, LLM_STRUCTURED_SYSTEM_MAX as ar, LLM_TEXT_INPUT_MAX as as, LOCATION_ATMOSPHERE_PROVIDERS as at, type LipSyncProvider as au, type LocationAtmosphereProvider as av, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as aw, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as ax, MAX_REQUEST_IMAGE_LIMIT as ay, MAX_TTS_CHARS_BY_PROVIDER as az, AUDIO_ADDON_PROVIDERS as b, VIDEO_PROVIDERS_WITHOUT_DISPATCH as b$, type RefAudioCheck as b0, type RefAudioProbe as b1, type RefAudioRule as b2, type RefVideoDurationLimit as b3, SCRIPT_PROVIDERS as b4, SEEDANCE_2_5_REF_LIMITS as b5, SEEDANCE_2_CONTINUATION_REF_SEC as b6, SEEDANCE_2_EXTEND_STITCH as b7, SEEDANCE_2_PROVIDERS as b8, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as b9, TRANSCRIBE_PROVIDERS as bA, TRANSCRIBE_PROVIDER_CAPABILITIES as bB, TTS_OUTPUT_FORMATS as bC, TTS_OUTPUT_FORMAT_FILES as bD, TTS_PROVIDERS as bE, TTS_TEXT_MAX as bF, TWO_K_RESOLUTION_PROVIDERS as bG, type TaskChainedEditProvider as bH, type TextToAudioProvider as bI, type TextToVideoProvider as bJ, type TranscribeLane as bK, type TranscribeProvider as bL, type TtsOutputFormat as bM, type TtsProvider as bN, UPSCALE_IMAGE_PROVIDERS as bO, type UpscaleImageProvider as bP, VARIABLE_PRICING_MODELS as bQ, VEO_PROVIDERS as bR, VIDEO_AUDIO_CAPABILITY as bS, VIDEO_DURATION_TIERS as bT, VIDEO_GEN_COLLAPSED_T2V_IDS as bU, VIDEO_GEN_PROVIDERS as bV, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bW, VIDEO_MODEL_CAPS as bX, VIDEO_MODE_ALIASES as bY, VIDEO_PROMPT_MAX as bZ, VIDEO_PROVIDERS_REQUIRING_IMAGE as b_, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as ba, SEEDANCE_2_REF_LIMITS as bb, SEEDANCE_LIP_SYNC_PROVIDERS as bc, SEEDANCE_VIDEO_EDIT_PROVIDERS as bd, SEEDANCE_VIDEO_EDIT_SHAPE as be, SEED_SUPPORT as bf, SUNO_ACTIVE_MODELS as bg, SUNO_ADD_TRACK_MODELS as bh, SUNO_DURATION_MODELS as bi, SUNO_HARD_CEILING as bj, SUNO_LEGACY_MODELS as bk, SUNO_MODELS as bl, SUNO_TEXT_MAX as bm, SUNO_TITLE_MAX as bn, type SceneInputMode as bo, SceneInputModeSchema as bp, type ScriptProvider as bq, type SeedanceVideoEditProvider as br, type SunoAddTrackModel as bs, type SunoModel as bt, T2I_TO_I2I_VARIANT as bu, TASK_CHAINED_EDIT_PROVIDERS as bv, TASK_CHAINED_EDIT_PROVIDER_IDS as bw, TEXT_TO_AUDIO_PROVIDERS as bx, TEXT_TO_VIDEO_PROVIDERS as by, TRANSCRIBE_LANES as bz, type AiWriterProvider as c, preferredInputModeForModel as c$, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as c0, VIDEO_REF_AUDIO_RULES as c1, VIDEO_REF_LIMITS_BY_PROVIDER as c2, VIDEO_REF_RATE_PROVIDERS as c3, VIDEO_REF_VIDEO_DURATION_LIMITS as c4, VIDEO_TO_VIDEO_NODE_PROVIDERS as c5, VIDEO_TO_VIDEO_PROVIDERS as c6, VIDEO_UPSCALE_PROVIDERS as c7, VIDEO_VARIABLE_PRICING as c8, VIDU_Q4_DEFAULT_RESOLUTION as c9, getMaxSunoStyleChars as cA, getMaxTtsChars as cB, getMaxVideoPromptChars as cC, getVideoAudioCapability as cD, hasContiguousSegmentDurations as cE, imageReferenceLimit as cF, isGeminiOmniPerSecondProvider as cG, isGeminiOmniProvider as cH, isGvpSupportedProvider as cI, isKling4Provider as cJ, isLegacySunoModel as cK, isMinimaxH3Provider as cL, isSeedance2Provider as cM, isSeedanceVideoEditProvider as cN, isVeoProvider as cO, isViduQ4Provider as cP, isWan3Provider as cQ, kling4KeyframeFrameCap as cR, maxSegmentSecFor as cS, maxSegmentsFor as cT, maxVideoDurationSec as cU, minSegmentSecFor as cV, modelsForInputMode as cW, normalizeKling4Resolution as cX, normalizeMinimaxH3Resolution as cY, normalizeViduQ4Resolution as cZ, normalizeWan3Resolution as c_, VIDU_Q4_PROVIDERS as ca, VOICE_DESIGN_MODELS as cb, type VideoAudioCapability as cc, type VideoAudioMode as cd, type VideoGenProvider as ce, type VideoModeAlias as cf, type VideoModelCapabilities as cg, type VideoReferenceSyntax as ch, type VideoToVideoNodeProvider as ci, type VideoToVideoProvider as cj, type VideoUpscaleProvider as ck, type VoiceDesignModel as cl, WAN_3_DEFAULT_RESOLUTION as cm, WAN_3_PROVIDERS as cn, applyDefaultVideoSelection as co, applyVideoAudioToggle as cp, applyVideoNegativePrompt as cq, billsReferenceVideoSeconds as cr, canonicalVideoProvider as cs, checkRefAudioRules as ct, checkRefVideoDurations as cu, defaultVideoAspectRatio as cv, findSeedance2AudioOverLimit as cw, getMaxImagePromptChars as cx, getMaxNegativePromptChars as cy, getMaxSunoPromptChars as cz, COMPOSER_PLAN_FIELDS as d, pricedOutputDurationSec as d0, requestImageLimit as d1, resolveGvpAnchorWire as d2, resolveMusicProvider as d3, resolveVideoModeForInputs as d4, resolveVideoProviderForMode as d5, seedance2AudioLimitSec as d6, segmentDurationsFor as d7, snapToNearestDuration as d8, sunoModelHonoursDuration as d9, supportsAutoVideoDuration as da, supportsEndAnchor as db, supportsExtendRender as dc, transcribeLaneSupportsWordTimestamps as dd, transcribeProvidersWithWordTimestamps as de, videoDefaultDurationSec as df, videoModelCanSpeakDialogue as dg, videoModelSupportsAudio as dh, videoNegativeSuffix as di, videoProviderAppendsFrames as dj, videoProviderFoldsLoneEndFrame as dk, videoProviderRefModeFrameSeats as dl, videoProviderReferenceSyntax as dm, videoProviderRequiresImage as dn, videoProviderRunsFromReferences as dp, videoSourceTrimMaxSec as dq, 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_VIDEO_TO_VIDEO_PROVIDER as s, DEFAULT_VOICE_DESIGN_MODEL as t, DIALOGUE_PROVIDERS as u, DURATION_PRICED_PROVIDERS as v, type DialogueProvider as w, type ExtendVideoProvider as x, FAL_LIP_SYNC_PROVIDERS as y, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as z };
|
package/package.json
CHANGED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { buildCreditModelIdentifier, imageFormatInputOf, resolveNormalizedImageGen } from "../credit-identifiers.js"
|
|
3
|
+
import { MODEL_CATALOG, normalizeModelInput, outputFormatOptionsByKind, svgLevelOptionsByKind } from "../model-catalog.js"
|
|
4
|
+
import { GPT_IMAGE_2_6_GIF_BANDS, gptImage26GifBand, gptImage26PricedFormat } from "../gpt-image-2-6.js"
|
|
5
|
+
|
|
6
|
+
const FLARE = "gpt-image-2-6-flare"
|
|
7
|
+
const fields = (n: ReturnType<typeof normalizeModelInput>) => n.adjustments.map((a) => a.field)
|
|
8
|
+
|
|
9
|
+
describe("which models write which files", () => {
|
|
10
|
+
it("Flare and Sunburst write five formats from a prompt and from an edit, Economy fewer", () => {
|
|
11
|
+
for (const id of ["gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"]) {
|
|
12
|
+
expect(MODEL_CATALOG[id]!.outputFormats).toEqual(["png", "jpeg", "webp", "gif", "svg"])
|
|
13
|
+
expect(MODEL_CATALOG[id]!.svgLevels).toEqual(["standard", "detailed", "max"])
|
|
14
|
+
expect(MODEL_CATALOG[id]!.gifFrames).toEqual({ min: 2, max: 16, default: 9 })
|
|
15
|
+
expect(MODEL_CATALOG[id]!.gifFrameDurationMs).toEqual({ min: 20, max: 2000, step: 10, default: 200 })
|
|
16
|
+
}
|
|
17
|
+
expect(MODEL_CATALOG["gpt-image-2-6-economy"]!.outputFormats).toEqual(["png", "gif"])
|
|
18
|
+
expect(MODEL_CATALOG["gpt-image-2-6-economy"]!.gifFrames?.values).toEqual([4, 9, 16])
|
|
19
|
+
expect(MODEL_CATALOG["gpt-image-2-6-economy-i2i"]!.outputFormats).toEqual(["png"])
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it("a menu offers a format only on a model that writes more than one", () => {
|
|
23
|
+
const formats = outputFormatOptionsByKind("image")
|
|
24
|
+
expect(Object.keys(formats).sort()).toEqual(["gpt-image-2-6-economy", "gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"])
|
|
25
|
+
expect(formats[FLARE]!.map((o) => o.value)).toEqual(["png", "jpeg", "webp", "gif", "svg"])
|
|
26
|
+
expect(Object.keys(svgLevelOptionsByKind("image")).sort()).toEqual(["gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"])
|
|
27
|
+
expect(svgLevelOptionsByKind("image")[FLARE]!.map((o) => o.label)).toEqual(["SVG Standard", "SVG Detailed", "SVG Max"])
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it("the bands of frames cover 2 to 16 without a gap", () => {
|
|
31
|
+
const frames = GPT_IMAGE_2_6_GIF_BANDS.flatMap((b) => Array.from({ length: b.max - b.min + 1 }, (_, i) => b.min + i))
|
|
32
|
+
expect(frames).toEqual(Array.from({ length: 15 }, (_, i) => i + 2))
|
|
33
|
+
expect(gptImage26GifBand(1)).toBe("2-8")
|
|
34
|
+
expect(gptImage26GifBand(40)).toBe("13-16")
|
|
35
|
+
expect(gptImage26GifBand("14")).toBe("13-16")
|
|
36
|
+
expect(gptImage26GifBand(undefined)).toBe("9-12")
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
describe("a GIF's levers", () => {
|
|
41
|
+
it("ignores the ratio and the size, and says so", () => {
|
|
42
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "gif", aspectRatio: "16:9", resolution: "4K", quality: "high" })
|
|
43
|
+
expect(n).toMatchObject({ outputFormat: "gif", aspectRatio: "1:1", resolution: undefined, quality: "high", gifFrames: 9, gifFrameDurationMs: 200 })
|
|
44
|
+
expect(fields(n)).toEqual(["aspectRatio", "resolution"])
|
|
45
|
+
expect(n.adjustments[0]!.reason).toContain("square")
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it("auto and a square ratio say nothing", () => {
|
|
49
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "gif", aspectRatio: "auto" }).adjustments).toEqual([])
|
|
50
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "gif", aspectRatio: "1:1" }).adjustments).toEqual([])
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it("keeps its frames and speed in range, and the speed on its step", () => {
|
|
54
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "gif", gifFrames: 30, gifFrameDurationMs: 155 })
|
|
55
|
+
expect(n).toMatchObject({ gifFrames: 16, gifFrameDurationMs: 160 })
|
|
56
|
+
expect(fields(n)).toEqual(["gifFrames", "gifFrameDurationMs"])
|
|
57
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "gif", gifFrames: 1, gifFrameDurationMs: 5000 })).toMatchObject({ gifFrames: 2, gifFrameDurationMs: 2000 })
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it("Economy takes 4, 9 or 16 frames: the nearest", () => {
|
|
61
|
+
expect(normalizeModelInput("gpt-image-2-6-economy", { outputFormat: "gif", gifFrames: 6 }).gifFrames).toBe(4)
|
|
62
|
+
expect(normalizeModelInput("gpt-image-2-6-economy", { outputFormat: "gif", gifFrames: 12 }).gifFrames).toBe(9)
|
|
63
|
+
expect(normalizeModelInput("gpt-image-2-6-economy", { outputFormat: "gif", gifFrames: 15 }).gifFrames).toBe(16)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it("moves a transparent background to auto, and keeps an opaque one", () => {
|
|
67
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "gif", background: "transparent" })
|
|
68
|
+
expect(n.background).toBe("auto")
|
|
69
|
+
expect(fields(n)).toEqual(["background"])
|
|
70
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "gif", background: "opaque" }).background).toBe("opaque")
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it("is not moved to 1K by a transparent background", () => {
|
|
74
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "gif", background: "transparent", resolution: "4K" })
|
|
75
|
+
expect(n.resolution).toBeUndefined()
|
|
76
|
+
expect(n.adjustments.some((a) => a.to === "1K")).toBe(false)
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
describe("an SVG's levers", () => {
|
|
81
|
+
it("takes its level, Standard when none is named", () => {
|
|
82
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "svg" }).svgLevel).toBe("standard")
|
|
83
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "svg", svgLevel: "Detailed" }).svgLevel).toBe("detailed")
|
|
84
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "svg", svgLevel: "ultra" })
|
|
85
|
+
expect(n.svgLevel).toBe("standard")
|
|
86
|
+
expect(fields(n)).toEqual(["svgLevel"])
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it("keeps the ratio and size of a PNG", () => {
|
|
90
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "svg", aspectRatio: "16:9", resolution: "2K" })).toMatchObject({ aspectRatio: "16:9", resolution: "2K", adjustments: [] })
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
it("takes no background: any but auto becomes auto, said once", () => {
|
|
94
|
+
for (const background of ["transparent", "opaque"]) {
|
|
95
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "svg", background, resolution: "4K" })
|
|
96
|
+
expect(n.background).toBe("auto")
|
|
97
|
+
expect(n.resolution).toBe("4K")
|
|
98
|
+
expect(fields(n)).toEqual(["background"])
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
describe("JPEG and WebP", () => {
|
|
104
|
+
it("JPEG moves a transparent background to auto at the size asked; WebP keeps it, at 1K", () => {
|
|
105
|
+
const jpeg = normalizeModelInput(FLARE, { outputFormat: "jpeg", background: "transparent", resolution: "4K" })
|
|
106
|
+
expect(jpeg).toMatchObject({ outputFormat: "jpeg", background: "auto", resolution: "4K" })
|
|
107
|
+
const webp = normalizeModelInput(FLARE, { outputFormat: "webp", background: "transparent", resolution: "4K" })
|
|
108
|
+
expect(webp).toMatchObject({ outputFormat: "webp", background: "transparent", resolution: "1K" })
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it("jpg is jpeg, in any case", () => {
|
|
112
|
+
expect(normalizeModelInput(FLARE, { outputFormat: "JPG" }).outputFormat).toBe("jpeg")
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
describe("the format and the model", () => {
|
|
117
|
+
it("a format the model does not write moves to its first, and says so", () => {
|
|
118
|
+
const n = normalizeModelInput("gpt-image-2-6-economy-i2i", { outputFormat: "svg", svgLevel: "max" })
|
|
119
|
+
expect(n.outputFormat).toBe("png")
|
|
120
|
+
expect(n.svgLevel).toBeUndefined()
|
|
121
|
+
expect(fields(n)).toEqual(["outputFormat"])
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it("a model with no format setting drops it", () => {
|
|
125
|
+
const n = normalizeModelInput("nano-banana-2", { outputFormat: "gif", gifFrames: 9 })
|
|
126
|
+
expect(n.outputFormat).toBeUndefined()
|
|
127
|
+
expect(n.gifFrames).toBeUndefined()
|
|
128
|
+
expect(fields(n)).toEqual(["outputFormat"])
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
it("a GIF's and an SVG's levers are left out for any other format, saying nothing", () => {
|
|
132
|
+
const n = normalizeModelInput(FLARE, { outputFormat: "png", gifFrames: 9, gifFrameDurationMs: 200, svgLevel: "max" })
|
|
133
|
+
expect(n).toMatchObject({ outputFormat: "png", gifFrames: undefined, gifFrameDurationMs: undefined, svgLevel: undefined, adjustments: [] })
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
it("a text-to-image Economy GIF with references swaps to its edit sibling and becomes a PNG", () => {
|
|
137
|
+
const n = resolveNormalizedImageGen({ provider: "gpt-image-2-6-economy", outputFormat: "gif", gifFrames: 9, refCount: 1, swapToI2i: true })
|
|
138
|
+
expect(n.modelId).toBe("gpt-image-2-6-economy-i2i")
|
|
139
|
+
expect(n.outputFormat).toBe("png")
|
|
140
|
+
expect(n.identifier).toBe("gpt-image-2-6-economy-i2i")
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
describe("the price follows the snapped levers", () => {
|
|
145
|
+
it("a GIF's id is its band; the ratio and size it ignored do not price it", () => {
|
|
146
|
+
const n = resolveNormalizedImageGen({ provider: FLARE, outputFormat: "gif", gifFrames: 14, quality: "low", resolution: "4K", aspectRatio: "16:9", refCount: 0 })
|
|
147
|
+
expect(n.identifier).toBe("gpt-image-2-6-flare:low:gif-13-16")
|
|
148
|
+
expect(n).toMatchObject({ gifFrames: 14, gifFrameDurationMs: 200, resolution: undefined, aspectRatio: "1:1" })
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
it("a GIF's frames off the range are priced where they land", () => {
|
|
152
|
+
expect(resolveNormalizedImageGen({ provider: FLARE, outputFormat: "gif", gifFrames: 40, refCount: 0 }).identifier).toBe("gpt-image-2-6-flare:medium:gif-13-16")
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it("an SVG edit is priced at its size, level and images", () => {
|
|
156
|
+
expect(resolveNormalizedImageGen({ provider: FLARE, outputFormat: "svg", svgLevel: "max", resolution: "2K", refCount: 3, swapToI2i: true }).identifier)
|
|
157
|
+
.toBe("gpt-image-2-6-flare-i2i:medium:2K:svg-max:3ref")
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
it("numeric strings from a form or a mapping are read as their numbers", () => {
|
|
161
|
+
expect(imageFormatInputOf({ outputFormat: "gif", gifFrames: "12", gifFrameDurationMs: " 300 " })).toEqual({ outputFormat: "gif", gifFrames: 12, gifFrameDurationMs: 300, svgLevel: undefined })
|
|
162
|
+
expect(resolveNormalizedImageGen({ provider: FLARE, outputFormat: "gif", gifFrames: "3", refCount: 0 }).identifier).toBe("gpt-image-2-6-flare:medium:gif-2-8")
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
it("the priced format reads a format in any case, as the snap does", () => {
|
|
166
|
+
expect(gptImage26PricedFormat({ outputFormat: "GIF", gifFrames: 16 })).toEqual({ kind: "gif", band: "13-16" })
|
|
167
|
+
expect(gptImage26PricedFormat({ outputFormat: "svg", svgLevel: "MAX" })).toEqual({ kind: "svg", level: "max" })
|
|
168
|
+
expect(gptImage26PricedFormat({ outputFormat: "webp" })).toBeUndefined()
|
|
169
|
+
expect(buildCreditModelIdentifier(FLARE, "medium", "1K", undefined, undefined, 0, { outputFormat: "Svg" })).toBe("gpt-image-2-6-flare:medium:1K:svg-standard")
|
|
170
|
+
})
|
|
171
|
+
})
|