@nodaro/shared 3.60.0 → 3.61.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-DS2TOM32.js → chunk-43TGSZRJ.js} +27 -3
- package/dist/chunk-43TGSZRJ.js.map +1 -0
- package/dist/{chunk-RRPPXZ36.cjs → chunk-4KYLNTR7.cjs} +4 -4
- package/dist/{chunk-RRPPXZ36.cjs.map → chunk-4KYLNTR7.cjs.map} +1 -1
- package/dist/{chunk-HDHLZK7C.cjs → chunk-5I4T4QR5.cjs} +5 -5
- package/dist/{chunk-HDHLZK7C.cjs.map → chunk-5I4T4QR5.cjs.map} +1 -1
- package/dist/{chunk-DQIJPDHC.cjs → chunk-5XRRENHD.cjs} +11 -11
- package/dist/{chunk-DQIJPDHC.cjs.map → chunk-5XRRENHD.cjs.map} +1 -1
- package/dist/{chunk-LN3EVFRS.js → chunk-673E4KYC.js} +5 -5
- package/dist/{chunk-LN3EVFRS.js.map → chunk-673E4KYC.js.map} +1 -1
- package/dist/{chunk-CIOXUPCJ.cjs → chunk-7ARKVJTN.cjs} +12 -12
- package/dist/{chunk-CIOXUPCJ.cjs.map → chunk-7ARKVJTN.cjs.map} +1 -1
- package/dist/{chunk-MHY47BLL.js → chunk-7WGKP3EU.js} +4 -4
- package/dist/{chunk-MHY47BLL.js.map → chunk-7WGKP3EU.js.map} +1 -1
- package/dist/{chunk-KOLC7AF2.js → chunk-A3FHTSLB.js} +99 -14
- package/dist/chunk-A3FHTSLB.js.map +1 -0
- package/dist/{chunk-6Q6SI7AG.js → chunk-B6BG3LV2.js} +3 -3
- package/dist/{chunk-6Q6SI7AG.js.map → chunk-B6BG3LV2.js.map} +1 -1
- package/dist/{chunk-SCYBGTX6.js → chunk-C77F4ZTL.js} +3 -3
- package/dist/{chunk-SCYBGTX6.js.map → chunk-C77F4ZTL.js.map} +1 -1
- package/dist/{chunk-IV6IDECY.js → chunk-EWS2VFO4.js} +4 -4
- package/dist/{chunk-IV6IDECY.js.map → chunk-EWS2VFO4.js.map} +1 -1
- package/dist/{chunk-A6HRY3WF.cjs → chunk-F5YEMSNK.cjs} +102 -13
- package/dist/chunk-F5YEMSNK.cjs.map +1 -0
- package/dist/{chunk-5HK5Z5OB.cjs → chunk-FMXFHJWX.cjs} +4 -4
- package/dist/{chunk-5HK5Z5OB.cjs.map → chunk-FMXFHJWX.cjs.map} +1 -1
- package/dist/{chunk-GWBQ3GPO.cjs → chunk-FQXRYPCX.cjs} +27 -22
- package/dist/chunk-FQXRYPCX.cjs.map +1 -0
- package/dist/{chunk-ICDLYU4I.js → chunk-HGI2VKIV.js} +8 -8
- package/dist/{chunk-ICDLYU4I.js.map → chunk-HGI2VKIV.js.map} +1 -1
- package/dist/{chunk-EN2YI5TV.js → chunk-IRQ3SPX7.js} +3 -3
- package/dist/{chunk-EN2YI5TV.js.map → chunk-IRQ3SPX7.js.map} +1 -1
- package/dist/{chunk-5Y42RIGY.cjs → chunk-IVXSNW2B.cjs} +8 -8
- package/dist/{chunk-5Y42RIGY.cjs.map → chunk-IVXSNW2B.cjs.map} +1 -1
- package/dist/{chunk-BGIJO5V4.cjs → chunk-JHTT2V4A.cjs} +39 -39
- package/dist/chunk-JHTT2V4A.cjs.map +1 -0
- package/dist/{chunk-VYQ25YQF.js → chunk-KHZAQGRP.js} +3 -3
- package/dist/{chunk-VYQ25YQF.js.map → chunk-KHZAQGRP.js.map} +1 -1
- package/dist/{chunk-G6GMY5BC.js → chunk-LLOIAGFB.js} +9 -4
- package/dist/chunk-LLOIAGFB.js.map +1 -0
- package/dist/{chunk-AZGONXWV.js → chunk-MOMFX32D.js} +4 -4
- package/dist/{chunk-AZGONXWV.js.map → chunk-MOMFX32D.js.map} +1 -1
- package/dist/{chunk-BXNPO3PL.cjs → chunk-MQZRQ5LM.cjs} +8 -8
- package/dist/{chunk-BXNPO3PL.cjs.map → chunk-MQZRQ5LM.cjs.map} +1 -1
- package/dist/chunk-NCOGGRRP.cjs +27 -0
- package/dist/{chunk-G7ZYZQKO.cjs.map → chunk-NCOGGRRP.cjs.map} +1 -1
- package/dist/{chunk-AXT7YNOR.cjs → chunk-NJVOJXBS.cjs} +43 -43
- package/dist/{chunk-AXT7YNOR.cjs.map → chunk-NJVOJXBS.cjs.map} +1 -1
- package/dist/{chunk-SKFJIFEV.cjs → chunk-RQ4F3AJH.cjs} +21 -21
- package/dist/{chunk-SKFJIFEV.cjs.map → chunk-RQ4F3AJH.cjs.map} +1 -1
- package/dist/{chunk-TZ42IVSF.js → chunk-RUHKBEFF.js} +4 -4
- package/dist/chunk-RUHKBEFF.js.map +1 -0
- package/dist/{chunk-URLDVK67.js → chunk-SCMTN57Y.js} +3 -3
- package/dist/{chunk-URLDVK67.js.map → chunk-SCMTN57Y.js.map} +1 -1
- package/dist/{chunk-JKZVRKN3.js → chunk-UARGJ5IZ.js} +6 -6
- package/dist/chunk-UARGJ5IZ.js.map +1 -0
- package/dist/{chunk-6AJOTEVC.js → chunk-VOWJCUMR.js} +3 -3
- package/dist/{chunk-6AJOTEVC.js.map → chunk-VOWJCUMR.js.map} +1 -1
- package/dist/{chunk-5G23AJBU.cjs → chunk-XUJC6GHE.cjs} +6 -6
- package/dist/{chunk-5G23AJBU.cjs.map → chunk-XUJC6GHE.cjs.map} +1 -1
- package/dist/{chunk-GNPJ2JLE.cjs → chunk-XZKFZMRT.cjs} +6 -6
- package/dist/{chunk-GNPJ2JLE.cjs.map → chunk-XZKFZMRT.cjs.map} +1 -1
- package/dist/{chunk-KJZVQIN4.js → chunk-ZDBPQBAA.js} +3 -3
- package/dist/{chunk-KJZVQIN4.js.map → chunk-ZDBPQBAA.js.map} +1 -1
- package/dist/{chunk-HOKWJXHA.cjs → chunk-ZFJN23V4.cjs} +29 -2
- package/dist/chunk-ZFJN23V4.cjs.map +1 -0
- package/dist/{chunk-HNEF2N5C.cjs → chunk-ZLDFPVVI.cjs} +5 -5
- package/dist/{chunk-HNEF2N5C.cjs.map → chunk-ZLDFPVVI.cjs.map} +1 -1
- package/dist/{chunk-BDXXOEBZ.cjs → chunk-ZNM2LW3D.cjs} +47 -47
- package/dist/chunk-ZNM2LW3D.cjs.map +1 -0
- package/dist/{chunk-YHVEZVAO.js → chunk-ZZGQRRN7.js} +4 -4
- package/dist/{chunk-YHVEZVAO.js.map → chunk-ZZGQRRN7.js.map} +1 -1
- package/dist/entries/apps.cjs +42 -42
- package/dist/entries/apps.js +7 -7
- package/dist/entries/credits.cjs +151 -151
- package/dist/entries/credits.d.cts +8 -4
- package/dist/entries/credits.d.ts +8 -4
- package/dist/entries/credits.js +7 -7
- package/dist/entries/llm-models.d.cts +1 -1
- package/dist/entries/llm-models.d.ts +1 -1
- package/dist/entries/model-catalog.cjs +94 -78
- package/dist/entries/model-catalog.d.cts +2 -2
- package/dist/entries/model-catalog.d.ts +2 -2
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +293 -293
- package/dist/entries/models.d.cts +5 -4
- package/dist/entries/models.d.ts +5 -4
- package/dist/entries/models.js +4 -4
- package/dist/entries/nodes.cjs +206 -206
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +8 -8
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +1 -1
- package/dist/entries/pipeline.d.ts +1 -1
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +117 -117
- package/dist/entries/video.js +4 -4
- package/dist/entries/workflow.cjs +110 -98
- package/dist/entries/workflow.d.cts +28 -2
- package/dist/entries/workflow.d.ts +28 -2
- package/dist/entries/workflow.js +1 -1
- package/dist/index.cjs +1212 -1184
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -18
- package/dist/{model-catalog-D6Es7VG-.d.cts → model-catalog-BgSvskgY.d.cts} +52 -1
- package/dist/{model-catalog-D6Es7VG-.d.ts → model-catalog-BgSvskgY.d.ts} +52 -1
- package/dist/{model-constants-22k3fjp1.d.cts → model-constants-DHd9jwQ7.d.cts} +6 -1
- package/dist/{model-constants-22k3fjp1.d.ts → model-constants-DHd9jwQ7.d.ts} +6 -1
- package/package.json +1 -1
- package/src/__tests__/gpt-image-2-6.test.ts +7 -0
- package/src/__tests__/image-mask-mode.test.ts +34 -1
- package/src/__tests__/mask-edit-follows-source.test.ts +150 -0
- package/src/cast-swap-limits.ts +2 -1
- package/src/credit-identifiers.ts +8 -4
- package/src/entries/model-catalog.ts +4 -0
- package/src/entries/workflow.ts +1 -0
- package/src/model-catalog.ts +157 -11
- package/src/model-constants.ts +12 -2
- package/src/node-execution-state.ts +3 -1
- package/src/wired-image-size.ts +55 -0
- package/dist/chunk-A6HRY3WF.cjs.map +0 -1
- package/dist/chunk-BDXXOEBZ.cjs.map +0 -1
- package/dist/chunk-BGIJO5V4.cjs.map +0 -1
- package/dist/chunk-DS2TOM32.js.map +0 -1
- package/dist/chunk-G6GMY5BC.js.map +0 -1
- package/dist/chunk-G7ZYZQKO.cjs +0 -27
- package/dist/chunk-GWBQ3GPO.cjs.map +0 -1
- package/dist/chunk-HOKWJXHA.cjs.map +0 -1
- package/dist/chunk-JKZVRKN3.js.map +0 -1
- package/dist/chunk-KOLC7AF2.js.map +0 -1
- package/dist/chunk-TZ42IVSF.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DEFAULT_DIALOGUE_PROVIDER } from './chunk-
|
|
2
|
-
import { MODEL_CATALOG } from './chunk-
|
|
1
|
+
import { DEFAULT_DIALOGUE_PROVIDER } from './chunk-LLOIAGFB.js';
|
|
2
|
+
import { MODEL_CATALOG } from './chunk-A3FHTSLB.js';
|
|
3
3
|
|
|
4
4
|
// src/dialogue-capabilities.ts
|
|
5
5
|
function findDialogueCapabilities(provider) {
|
|
@@ -27,5 +27,5 @@ function dialogueStabilityAccepted(provider, value) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { dialogueHasLever, dialogueProviderOf, dialogueStabilityAccepted, dialogueSupportsTimestamps, findDialogueCapabilities, getDialogueCapabilities };
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-EWS2VFO4.js.map
|
|
31
|
+
//# sourceMappingURL=chunk-EWS2VFO4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dialogue-capabilities.ts"],"names":[],"mappings":";;;;AAeO,SAAS,yBAAyB,QAAA,EAAgD;AACvF,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,UAAU,OAAO,MAAA;AACtD,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,QAAQ,GAAG,OAAO,MAAA;AACpD,EAAA,MAAM,KAAA,GAAQ,cAAc,QAAQ,CAAA;AACpC,EAAA,OAAO,MAAM,KAAA,CAAM,QAAA,CAAS,UAAU,CAAA,GAAI,MAAM,GAAA,GAAM,MAAA;AACxD;AAGO,SAAS,mBAAmB,QAAA,EAAqC;AACtE,EAAA,OAAO,wBAAA,CAAyB,QAAQ,CAAA,GAAK,QAAA,GAAgC,yBAAA;AAC/E;AAGO,SAAS,wBAAwB,QAAA,EAAoC;AAC1E,EAAA,OAAO,aAAA,CAAc,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAG,GAAA;AACtD;AAGO,SAAS,gBAAA,CAAiB,UAAmB,KAAA,EAAiC;AACnF,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,MAAA,CAAO,SAAS,KAAK,CAAA;AAChE;AAGO,SAAS,2BAA2B,QAAA,EAA4B;AACrE,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,UAAA;AAC3C;AAGO,SAAS,yBAAA,CAA0B,UAAmB,KAAA,EAAwB;AACnF,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,KAAK,KAAK,KAAA,GAAQ,CAAA,IAAK,KAAA,GAAQ,CAAA,EAAG,OAAO,KAAA;AAC9D,EAAA,MAAM,KAAA,GAAQ,uBAAA,CAAwB,QAAQ,CAAA,CAAE,cAAA;AAChD,EAAA,OAAO,KAAA,GAAQ,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,GAAI,IAAA;AACzC","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/dialogue-capabilities.ts"],"names":[],"mappings":";;;;AAeO,SAAS,yBAAyB,QAAA,EAAgD;AACvF,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,CAAC,UAAU,OAAO,MAAA;AACtD,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,CAAO,aAAA,EAAe,QAAQ,GAAG,OAAO,MAAA;AACpD,EAAA,MAAM,KAAA,GAAQ,cAAc,QAAQ,CAAA;AACpC,EAAA,OAAO,MAAM,KAAA,CAAM,QAAA,CAAS,UAAU,CAAA,GAAI,MAAM,GAAA,GAAM,MAAA;AACxD;AAGO,SAAS,mBAAmB,QAAA,EAAqC;AACtE,EAAA,OAAO,wBAAA,CAAyB,QAAQ,CAAA,GAAK,QAAA,GAAgC,yBAAA;AAC/E;AAGO,SAAS,wBAAwB,QAAA,EAAoC;AAC1E,EAAA,OAAO,aAAA,CAAc,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAG,GAAA;AACtD;AAGO,SAAS,gBAAA,CAAiB,UAAmB,KAAA,EAAiC;AACnF,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,MAAA,CAAO,SAAS,KAAK,CAAA;AAChE;AAGO,SAAS,2BAA2B,QAAA,EAA4B;AACrE,EAAA,OAAO,uBAAA,CAAwB,QAAQ,CAAA,CAAE,UAAA;AAC3C;AAGO,SAAS,yBAAA,CAA0B,UAAmB,KAAA,EAAwB;AACnF,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,KAAK,KAAK,KAAA,GAAQ,CAAA,IAAK,KAAA,GAAQ,CAAA,EAAG,OAAO,KAAA;AAC9D,EAAA,MAAM,KAAA,GAAQ,uBAAA,CAAwB,QAAQ,CAAA,CAAE,cAAA;AAChD,EAAA,OAAO,KAAA,GAAQ,KAAA,CAAM,QAAA,CAAS,KAAK,CAAA,GAAI,IAAA;AACzC","file":"chunk-EWS2VFO4.js","sourcesContent":["/**\n * Capability lookups for the DIALOGUE lane (`/v1/text-to-dialogue`, the Text to\n * Dialogue node, the voiced-video multi-speaker track).\n *\n * The dialogue models carry a `tts` sheet in `MODEL_CATALOG` like the\n * text-to-speech models, but each lane answers only for its own models: the\n * text-to-speech lookups (`tts-capabilities.ts`) treat a dialogue id as unknown,\n * and these treat a text-to-speech id as unknown. An unknown id here runs as\n * {@link DEFAULT_DIALOGUE_PROVIDER} (v3 dialogue) — not as the text-to-speech\n * fallback (turbo), which has no dialogue form.\n */\nimport { MODEL_CATALOG, type TtsCapabilities, type TtsSettingLever } from \"./model-catalog.js\"\nimport { DEFAULT_DIALOGUE_PROVIDER, type DialogueProvider } from \"./model-constants.js\"\n\n/** The sheet of a dialogue model, or `undefined` when the id is not one. Own properties only; a non-string is unknown. */\nexport function findDialogueCapabilities(provider: unknown): TtsCapabilities | undefined {\n if (typeof provider !== \"string\" || !provider) return undefined\n if (!Object.hasOwn(MODEL_CATALOG, provider)) return undefined\n const entry = MODEL_CATALOG[provider]!\n return entry.modes.includes(\"dialogue\") ? entry.tts : undefined\n}\n\n/** The dialogue model a request naming `provider` runs on (and is billed as). */\nexport function dialogueProviderOf(provider: unknown): DialogueProvider {\n return findDialogueCapabilities(provider) ? (provider as DialogueProvider) : DEFAULT_DIALOGUE_PROVIDER\n}\n\n/** The sheet a dialogue request runs under. */\nexport function getDialogueCapabilities(provider: unknown): TtsCapabilities {\n return MODEL_CATALOG[dialogueProviderOf(provider)]!.tts!\n}\n\n/** The dialogue model honours this voice-setting lever. */\nexport function dialogueHasLever(provider: unknown, lever: TtsSettingLever): boolean {\n return getDialogueCapabilities(provider).levers.includes(lever)\n}\n\n/** The dialogue model answers `/v1/text-to-dialogue/with-timestamps` (character timings + per-line voice segments). */\nexport function dialogueSupportsTimestamps(provider: unknown): boolean {\n return getDialogueCapabilities(provider).timestamps\n}\n\n/** `value` is a stability this platform accepts for the dialogue model: one of its steps, or any finite 0–1 when it has none. */\nexport function dialogueStabilityAccepted(provider: unknown, value: number): boolean {\n if (!Number.isFinite(value) || value < 0 || value > 1) return false\n const steps = getDialogueCapabilities(provider).stabilitySteps\n return steps ? steps.includes(value) : true\n}\n"]}
|
|
@@ -131,6 +131,23 @@ var GPT_IMAGE_2_6_RATIOS = [
|
|
|
131
131
|
"1:3"
|
|
132
132
|
];
|
|
133
133
|
var GPT_IMAGE_2_6_ECONOMY_RATIOS = ["auto", "1:1", "16:9", "9:16", "3:2", "2:3", "21:9", "4:3"];
|
|
134
|
+
var GPT_IMAGE_2_6_OUTPUT_SIZES = {
|
|
135
|
+
"1:1": { "1K": [1024, 1024], "2K": [2048, 2048], "4K": [2880, 2880] },
|
|
136
|
+
"3:2": { "1K": [1536, 1024], "2K": [2048, 1360], "4K": [3520, 2336] },
|
|
137
|
+
"2:3": { "1K": [1024, 1536], "2K": [1360, 2048], "4K": [2336, 3520] },
|
|
138
|
+
"4:3": { "1K": [1024, 768], "2K": [2048, 1536], "4K": [3312, 2480] },
|
|
139
|
+
"3:4": { "1K": [768, 1024], "2K": [1536, 2048], "4K": [2480, 3312] },
|
|
140
|
+
"5:4": { "1K": [1280, 1024], "2K": [2560, 2048], "4K": [3216, 2576] },
|
|
141
|
+
"4:5": { "1K": [1024, 1280], "2K": [2048, 2560], "4K": [2576, 3216] },
|
|
142
|
+
"16:9": { "1K": [1536, 864], "2K": [2048, 1152], "4K": [3840, 2160] },
|
|
143
|
+
"9:16": { "1K": [864, 1536], "2K": [1152, 2048], "4K": [2160, 3840] },
|
|
144
|
+
"2:1": { "1K": [2048, 1024], "2K": [2688, 1344], "4K": [3840, 1920] },
|
|
145
|
+
"1:2": { "1K": [1024, 2048], "2K": [1344, 2688], "4K": [1920, 3840] },
|
|
146
|
+
"21:9": { "1K": [2016, 864], "2K": [2688, 1152], "4K": [3840, 1648] },
|
|
147
|
+
"9:21": { "1K": [864, 2016], "2K": [1152, 2688], "4K": [1648, 3840] },
|
|
148
|
+
"3:1": { "1K": [1536, 512], "2K": [3072, 1024], "4K": [3840, 1280] },
|
|
149
|
+
"1:3": { "1K": [512, 1536], "2K": [1024, 3072], "4K": [1280, 3840] }
|
|
150
|
+
};
|
|
134
151
|
var GPT_IMAGE_2_6_VALUE_LABELS = {
|
|
135
152
|
"3:2": "3:2 (Landscape)",
|
|
136
153
|
"2:3": "2:3 (Portrait)",
|
|
@@ -751,11 +768,13 @@ var IMAGE_MODELS = {
|
|
|
751
768
|
maker: "openai",
|
|
752
769
|
label: "GPT Image 2.6 Flare (I2I)",
|
|
753
770
|
series: "GPT Image",
|
|
754
|
-
description: "Fast GPT Image 2.6 edits - up to 16 input images, priced per image. Writes PNG, JPEG, WebP, an animated GIF or an SVG. Pick it while iterating.",
|
|
755
|
-
useCases: ["edit", "high-res"],
|
|
756
|
-
features: ["reference-image"],
|
|
771
|
+
description: "Fast GPT Image 2.6 edits - up to 16 input images, priced per image. Writes PNG, JPEG, WebP, an animated GIF or an SVG. Takes an inpainting mask (PNG, JPEG or WebP; the rest of the picture is kept as it was). Pick it while iterating.",
|
|
772
|
+
useCases: ["edit", "inpaint", "high-res"],
|
|
773
|
+
features: ["reference-image", "mask"],
|
|
757
774
|
aspectRatios: GPT_IMAGE_2_6_RATIOS,
|
|
758
775
|
autoAspectFromSourceImage: true,
|
|
776
|
+
outputSizes: GPT_IMAGE_2_6_OUTPUT_SIZES,
|
|
777
|
+
maskEditMatchesSource: true,
|
|
759
778
|
resolutions: ["1K", "2K", "4K"],
|
|
760
779
|
qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
|
|
761
780
|
defaultQuality: "medium",
|
|
@@ -859,11 +878,13 @@ var IMAGE_MODELS = {
|
|
|
859
878
|
maker: "openai",
|
|
860
879
|
label: "GPT Image 2.6 Sunburst (I2I)",
|
|
861
880
|
series: "GPT Image",
|
|
862
|
-
description: "Precision GPT Image 2.6 edits - up to 16 input images, priced per image. Writes PNG, JPEG, WebP, an animated GIF or an SVG. Pick it for finished, detail-critical edits.",
|
|
863
|
-
useCases: ["edit", "high-res"],
|
|
864
|
-
features: ["reference-image"],
|
|
881
|
+
description: "Precision GPT Image 2.6 edits - up to 16 input images, priced per image. Writes PNG, JPEG, WebP, an animated GIF or an SVG. Takes an inpainting mask (PNG, JPEG or WebP; the rest of the picture is kept as it was). Pick it for finished, detail-critical edits.",
|
|
882
|
+
useCases: ["edit", "inpaint", "high-res"],
|
|
883
|
+
features: ["reference-image", "mask"],
|
|
865
884
|
aspectRatios: GPT_IMAGE_2_6_RATIOS,
|
|
866
885
|
autoAspectFromSourceImage: true,
|
|
886
|
+
outputSizes: GPT_IMAGE_2_6_OUTPUT_SIZES,
|
|
887
|
+
maskEditMatchesSource: true,
|
|
867
888
|
resolutions: ["1K", "2K", "4K"],
|
|
868
889
|
qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
|
|
869
890
|
defaultQuality: "medium",
|
|
@@ -3620,6 +3641,41 @@ var MODEL_INPUT_ADJUSTMENT_FIELDS = [
|
|
|
3620
3641
|
var IMAGE_GIF_FRAME_SIZE = 512;
|
|
3621
3642
|
var MASKLESS_OUTPUT_FORMATS = ["gif", "svg"];
|
|
3622
3643
|
var TRANSPARENT_OUTPUT_FORMATS = ["png", "webp"];
|
|
3644
|
+
function maskEditMatchesSource(modelId, masked) {
|
|
3645
|
+
return masked === true && !!modelId && MODEL_CATALOG[modelId]?.maskEditMatchesSource === true;
|
|
3646
|
+
}
|
|
3647
|
+
function sourceImageSizeNeeded(modelId, aspectRatio, masked) {
|
|
3648
|
+
return autoAspectNeedsSourceImage(modelId, aspectRatio) || maskEditMatchesSource(modelId, masked);
|
|
3649
|
+
}
|
|
3650
|
+
function maskedEditResolution(modelId, levers, sourceImage) {
|
|
3651
|
+
if (!maskEditMatchesSource(modelId, true) || !usableSize(sourceImage)) return void 0;
|
|
3652
|
+
const str = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
3653
|
+
return normalizeModelInput(
|
|
3654
|
+
modelId,
|
|
3655
|
+
{ aspectRatio: str(levers.aspectRatio), resolution: str(levers.resolution), background: str(levers.background), outputFormat: str(levers.outputFormat) },
|
|
3656
|
+
{ sourceImage, masked: true }
|
|
3657
|
+
).resolution;
|
|
3658
|
+
}
|
|
3659
|
+
function resolutionNearestSource(modelId, aspectRatio, source) {
|
|
3660
|
+
const m = MODEL_CATALOG[modelId];
|
|
3661
|
+
const table = m?.outputSizes;
|
|
3662
|
+
if (!table || typeof aspectRatio !== "string" || !usableSize(source)) return void 0;
|
|
3663
|
+
if (!Object.prototype.hasOwnProperty.call(table, aspectRatio)) return void 0;
|
|
3664
|
+
const sizes = table[aspectRatio];
|
|
3665
|
+
const long = Math.max(source.width, source.height);
|
|
3666
|
+
let best;
|
|
3667
|
+
let bestDist = Infinity;
|
|
3668
|
+
for (const resolution of m.resolutions ?? Object.keys(sizes)) {
|
|
3669
|
+
const px = Object.prototype.hasOwnProperty.call(sizes, resolution) ? sizes[resolution] : void 0;
|
|
3670
|
+
if (!px) continue;
|
|
3671
|
+
const dist = Math.abs(Math.log(Math.max(px[0], px[1]) / long));
|
|
3672
|
+
if (dist <= bestDist + ASPECT_TIE_EPSILON) {
|
|
3673
|
+
bestDist = dist;
|
|
3674
|
+
best = resolution;
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
return best;
|
|
3678
|
+
}
|
|
3623
3679
|
function isAutoAspectToken(value) {
|
|
3624
3680
|
return typeof value === "string" && value.trim().toLowerCase() === "auto";
|
|
3625
3681
|
}
|
|
@@ -3703,8 +3759,23 @@ function normalizeModelInput(modelId, input, context = {}) {
|
|
|
3703
3759
|
out.gifFrameDurationMs = format.levers.gifFrameDurationMs;
|
|
3704
3760
|
out.svgLevel = format.levers.svgLevel;
|
|
3705
3761
|
const gif = format.levers.outputFormat === "gif";
|
|
3706
|
-
const
|
|
3707
|
-
|
|
3762
|
+
const followsSource = !gif && maskEditMatchesSource(modelId, context.masked);
|
|
3763
|
+
const askedRatio = followsSource ? "auto" : input.aspectRatio;
|
|
3764
|
+
const sourceRatio = !gif && autoAspectNeedsSourceImage(modelId, askedRatio) && usableSize(context.sourceImage) ? nearestCatalogAspectRatio(context.sourceImage.width, context.sourceImage.height, m.aspectRatios ?? []) : void 0;
|
|
3765
|
+
if (followsSource && input.aspectRatio !== void 0 && !isAutoAspectToken(input.aspectRatio)) {
|
|
3766
|
+
const to = sourceRatio ?? "auto";
|
|
3767
|
+
if (to !== input.aspectRatio) {
|
|
3768
|
+
adjustments.push({
|
|
3769
|
+
field: "aspectRatio",
|
|
3770
|
+
from: input.aspectRatio,
|
|
3771
|
+
to,
|
|
3772
|
+
reason: sourceRatio !== void 0 ? `A masked edit on ${m.label} keeps the photo's shape \u2014 using "${sourceRatio}", the supported ratio closest to the source image (${context.sourceImage.width}x${context.sourceImage.height}).` : `A masked edit on ${m.label} keeps the photo's shape \u2014 using "auto".`
|
|
3773
|
+
});
|
|
3774
|
+
}
|
|
3775
|
+
out.aspectRatio = to;
|
|
3776
|
+
} else if (followsSource && input.aspectRatio === void 0) {
|
|
3777
|
+
out.aspectRatio = sourceRatio ?? "auto";
|
|
3778
|
+
} else if (gif) {
|
|
3708
3779
|
if (input.aspectRatio !== void 0 && input.aspectRatio !== "1:1" && !isAutoAspectToken(input.aspectRatio)) {
|
|
3709
3780
|
adjustments.push({
|
|
3710
3781
|
field: "aspectRatio",
|
|
@@ -3714,12 +3785,12 @@ function normalizeModelInput(modelId, input, context = {}) {
|
|
|
3714
3785
|
});
|
|
3715
3786
|
}
|
|
3716
3787
|
out.aspectRatio = input.aspectRatio === void 0 ? void 0 : "1:1";
|
|
3717
|
-
} else if (sourceRatio !== void 0 &&
|
|
3788
|
+
} else if (sourceRatio !== void 0 && askedRatio !== void 0) {
|
|
3718
3789
|
const { width, height } = context.sourceImage;
|
|
3719
3790
|
const why = m.autoAspectFromSourceImage === true ? `${m.label}'s own "auto" does not keep the photo's shape` : `${m.label} has no "auto" aspect ratio`;
|
|
3720
3791
|
adjustments.push({
|
|
3721
3792
|
field: "aspectRatio",
|
|
3722
|
-
from: input.aspectRatio,
|
|
3793
|
+
from: input.aspectRatio ?? askedRatio,
|
|
3723
3794
|
to: sourceRatio,
|
|
3724
3795
|
reason: `${why} \u2014 using "${sourceRatio}", the supported ratio closest to the source image's shape (${width}x${height}).`
|
|
3725
3796
|
});
|
|
@@ -3727,7 +3798,21 @@ function normalizeModelInput(modelId, input, context = {}) {
|
|
|
3727
3798
|
} else {
|
|
3728
3799
|
out.aspectRatio = snap("aspectRatio", input.aspectRatio, m.aspectRatios);
|
|
3729
3800
|
}
|
|
3730
|
-
if (
|
|
3801
|
+
if (followsSource) {
|
|
3802
|
+
const asked = snap("resolution", input.resolution, m.resolutions, defaultResolutionFor(modelId));
|
|
3803
|
+
const nearest = resolutionNearestSource(modelId, out.aspectRatio, context.sourceImage);
|
|
3804
|
+
const from = asked ?? m.defaultResolution ?? m.resolutions?.[0];
|
|
3805
|
+
if (nearest !== void 0 && from !== void 0 && nearest !== from) {
|
|
3806
|
+
const { width, height } = context.sourceImage;
|
|
3807
|
+
adjustments.push({
|
|
3808
|
+
field: "resolution",
|
|
3809
|
+
from,
|
|
3810
|
+
to: nearest,
|
|
3811
|
+
reason: `A masked edit on ${m.label} is delivered at the photo's own size (${width}x${height}) \u2014 rendering at ${nearest}, the size nearest it.`
|
|
3812
|
+
});
|
|
3813
|
+
}
|
|
3814
|
+
out.resolution = nearest ?? asked;
|
|
3815
|
+
} else if (gif) {
|
|
3731
3816
|
if (input.resolution !== void 0) {
|
|
3732
3817
|
adjustments.push({
|
|
3733
3818
|
field: "resolution",
|
|
@@ -4205,6 +4290,8 @@ exports.isFlux2Model = isFlux2Model;
|
|
|
4205
4290
|
exports.isModelMakerId = isModelMakerId;
|
|
4206
4291
|
exports.isSeedanceDraftCapable = isSeedanceDraftCapable;
|
|
4207
4292
|
exports.listModels = listModels;
|
|
4293
|
+
exports.maskEditMatchesSource = maskEditMatchesSource;
|
|
4294
|
+
exports.maskedEditResolution = maskedEditResolution;
|
|
4208
4295
|
exports.modelIdsByKindMode = modelIdsByKindMode;
|
|
4209
4296
|
exports.modelMakerOf = modelMakerOf;
|
|
4210
4297
|
exports.modelTakesSeed = modelTakesSeed;
|
|
@@ -4215,11 +4302,13 @@ exports.normalizeVideoRequestParams = normalizeVideoRequestParams;
|
|
|
4215
4302
|
exports.outputFormatOptionsByKind = outputFormatOptionsByKind;
|
|
4216
4303
|
exports.qualityOptionsByKind = qualityOptionsByKind;
|
|
4217
4304
|
exports.resolutionAtAspectRatio = resolutionAtAspectRatio;
|
|
4305
|
+
exports.resolutionNearestSource = resolutionNearestSource;
|
|
4218
4306
|
exports.resolutionOptionsByKind = resolutionOptionsByKind;
|
|
4219
4307
|
exports.resolutionsAtAspectRatio = resolutionsAtAspectRatio;
|
|
4220
4308
|
exports.seedanceDraftFinalizeBillableSec = seedanceDraftFinalizeBillableSec;
|
|
4221
4309
|
exports.seedanceDraftFinalizeCreditId = seedanceDraftFinalizeCreditId;
|
|
4310
|
+
exports.sourceImageSizeNeeded = sourceImageSizeNeeded;
|
|
4222
4311
|
exports.svgLevelOptionsByKind = svgLevelOptionsByKind;
|
|
4223
4312
|
exports.validateModelInput = validateModelInput;
|
|
4224
|
-
//# sourceMappingURL=chunk-
|
|
4225
|
-
//# sourceMappingURL=chunk-
|
|
4313
|
+
//# sourceMappingURL=chunk-F5YEMSNK.cjs.map
|
|
4314
|
+
//# sourceMappingURL=chunk-F5YEMSNK.cjs.map
|