@nodaro/shared 3.60.1 → 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.
Files changed (132) hide show
  1. package/dist/{chunk-DS2TOM32.js → chunk-43TGSZRJ.js} +27 -3
  2. package/dist/chunk-43TGSZRJ.js.map +1 -0
  3. package/dist/{chunk-RRPPXZ36.cjs → chunk-4KYLNTR7.cjs} +4 -4
  4. package/dist/{chunk-RRPPXZ36.cjs.map → chunk-4KYLNTR7.cjs.map} +1 -1
  5. package/dist/{chunk-HDHLZK7C.cjs → chunk-5I4T4QR5.cjs} +5 -5
  6. package/dist/{chunk-HDHLZK7C.cjs.map → chunk-5I4T4QR5.cjs.map} +1 -1
  7. package/dist/{chunk-DQIJPDHC.cjs → chunk-5XRRENHD.cjs} +11 -11
  8. package/dist/{chunk-DQIJPDHC.cjs.map → chunk-5XRRENHD.cjs.map} +1 -1
  9. package/dist/{chunk-LN3EVFRS.js → chunk-673E4KYC.js} +5 -5
  10. package/dist/{chunk-LN3EVFRS.js.map → chunk-673E4KYC.js.map} +1 -1
  11. package/dist/{chunk-CIOXUPCJ.cjs → chunk-7ARKVJTN.cjs} +12 -12
  12. package/dist/{chunk-CIOXUPCJ.cjs.map → chunk-7ARKVJTN.cjs.map} +1 -1
  13. package/dist/{chunk-MHY47BLL.js → chunk-7WGKP3EU.js} +4 -4
  14. package/dist/{chunk-MHY47BLL.js.map → chunk-7WGKP3EU.js.map} +1 -1
  15. package/dist/{chunk-KOLC7AF2.js → chunk-A3FHTSLB.js} +99 -14
  16. package/dist/chunk-A3FHTSLB.js.map +1 -0
  17. package/dist/{chunk-6Q6SI7AG.js → chunk-B6BG3LV2.js} +3 -3
  18. package/dist/{chunk-6Q6SI7AG.js.map → chunk-B6BG3LV2.js.map} +1 -1
  19. package/dist/{chunk-SCYBGTX6.js → chunk-C77F4ZTL.js} +3 -3
  20. package/dist/{chunk-SCYBGTX6.js.map → chunk-C77F4ZTL.js.map} +1 -1
  21. package/dist/{chunk-IV6IDECY.js → chunk-EWS2VFO4.js} +4 -4
  22. package/dist/{chunk-IV6IDECY.js.map → chunk-EWS2VFO4.js.map} +1 -1
  23. package/dist/{chunk-A6HRY3WF.cjs → chunk-F5YEMSNK.cjs} +102 -13
  24. package/dist/chunk-F5YEMSNK.cjs.map +1 -0
  25. package/dist/{chunk-5HK5Z5OB.cjs → chunk-FMXFHJWX.cjs} +4 -4
  26. package/dist/{chunk-5HK5Z5OB.cjs.map → chunk-FMXFHJWX.cjs.map} +1 -1
  27. package/dist/{chunk-GWBQ3GPO.cjs → chunk-FQXRYPCX.cjs} +27 -22
  28. package/dist/chunk-FQXRYPCX.cjs.map +1 -0
  29. package/dist/{chunk-ICDLYU4I.js → chunk-HGI2VKIV.js} +8 -8
  30. package/dist/{chunk-ICDLYU4I.js.map → chunk-HGI2VKIV.js.map} +1 -1
  31. package/dist/{chunk-EN2YI5TV.js → chunk-IRQ3SPX7.js} +3 -3
  32. package/dist/{chunk-EN2YI5TV.js.map → chunk-IRQ3SPX7.js.map} +1 -1
  33. package/dist/{chunk-5Y42RIGY.cjs → chunk-IVXSNW2B.cjs} +8 -8
  34. package/dist/{chunk-5Y42RIGY.cjs.map → chunk-IVXSNW2B.cjs.map} +1 -1
  35. package/dist/{chunk-W4M7TNXG.cjs → chunk-JHTT2V4A.cjs} +39 -39
  36. package/dist/{chunk-W4M7TNXG.cjs.map → chunk-JHTT2V4A.cjs.map} +1 -1
  37. package/dist/{chunk-VYQ25YQF.js → chunk-KHZAQGRP.js} +3 -3
  38. package/dist/{chunk-VYQ25YQF.js.map → chunk-KHZAQGRP.js.map} +1 -1
  39. package/dist/{chunk-G6GMY5BC.js → chunk-LLOIAGFB.js} +9 -4
  40. package/dist/chunk-LLOIAGFB.js.map +1 -0
  41. package/dist/{chunk-AZGONXWV.js → chunk-MOMFX32D.js} +4 -4
  42. package/dist/{chunk-AZGONXWV.js.map → chunk-MOMFX32D.js.map} +1 -1
  43. package/dist/{chunk-BXNPO3PL.cjs → chunk-MQZRQ5LM.cjs} +8 -8
  44. package/dist/{chunk-BXNPO3PL.cjs.map → chunk-MQZRQ5LM.cjs.map} +1 -1
  45. package/dist/chunk-NCOGGRRP.cjs +27 -0
  46. package/dist/{chunk-G7ZYZQKO.cjs.map → chunk-NCOGGRRP.cjs.map} +1 -1
  47. package/dist/{chunk-AXT7YNOR.cjs → chunk-NJVOJXBS.cjs} +43 -43
  48. package/dist/{chunk-AXT7YNOR.cjs.map → chunk-NJVOJXBS.cjs.map} +1 -1
  49. package/dist/{chunk-SKFJIFEV.cjs → chunk-RQ4F3AJH.cjs} +21 -21
  50. package/dist/{chunk-SKFJIFEV.cjs.map → chunk-RQ4F3AJH.cjs.map} +1 -1
  51. package/dist/{chunk-HYBACFYW.js → chunk-RUHKBEFF.js} +4 -4
  52. package/dist/{chunk-HYBACFYW.js.map → chunk-RUHKBEFF.js.map} +1 -1
  53. package/dist/{chunk-URLDVK67.js → chunk-SCMTN57Y.js} +3 -3
  54. package/dist/{chunk-URLDVK67.js.map → chunk-SCMTN57Y.js.map} +1 -1
  55. package/dist/{chunk-JKZVRKN3.js → chunk-UARGJ5IZ.js} +6 -6
  56. package/dist/chunk-UARGJ5IZ.js.map +1 -0
  57. package/dist/{chunk-6AJOTEVC.js → chunk-VOWJCUMR.js} +3 -3
  58. package/dist/{chunk-6AJOTEVC.js.map → chunk-VOWJCUMR.js.map} +1 -1
  59. package/dist/{chunk-5G23AJBU.cjs → chunk-XUJC6GHE.cjs} +6 -6
  60. package/dist/{chunk-5G23AJBU.cjs.map → chunk-XUJC6GHE.cjs.map} +1 -1
  61. package/dist/{chunk-GNPJ2JLE.cjs → chunk-XZKFZMRT.cjs} +6 -6
  62. package/dist/{chunk-GNPJ2JLE.cjs.map → chunk-XZKFZMRT.cjs.map} +1 -1
  63. package/dist/{chunk-KJZVQIN4.js → chunk-ZDBPQBAA.js} +3 -3
  64. package/dist/{chunk-KJZVQIN4.js.map → chunk-ZDBPQBAA.js.map} +1 -1
  65. package/dist/{chunk-HOKWJXHA.cjs → chunk-ZFJN23V4.cjs} +29 -2
  66. package/dist/chunk-ZFJN23V4.cjs.map +1 -0
  67. package/dist/{chunk-HNEF2N5C.cjs → chunk-ZLDFPVVI.cjs} +5 -5
  68. package/dist/{chunk-HNEF2N5C.cjs.map → chunk-ZLDFPVVI.cjs.map} +1 -1
  69. package/dist/{chunk-BDXXOEBZ.cjs → chunk-ZNM2LW3D.cjs} +47 -47
  70. package/dist/chunk-ZNM2LW3D.cjs.map +1 -0
  71. package/dist/{chunk-YHVEZVAO.js → chunk-ZZGQRRN7.js} +4 -4
  72. package/dist/{chunk-YHVEZVAO.js.map → chunk-ZZGQRRN7.js.map} +1 -1
  73. package/dist/entries/apps.cjs +42 -42
  74. package/dist/entries/apps.js +7 -7
  75. package/dist/entries/credits.cjs +151 -151
  76. package/dist/entries/credits.d.cts +8 -4
  77. package/dist/entries/credits.d.ts +8 -4
  78. package/dist/entries/credits.js +7 -7
  79. package/dist/entries/llm-models.d.cts +1 -1
  80. package/dist/entries/llm-models.d.ts +1 -1
  81. package/dist/entries/model-catalog.cjs +94 -78
  82. package/dist/entries/model-catalog.d.cts +2 -2
  83. package/dist/entries/model-catalog.d.ts +2 -2
  84. package/dist/entries/model-catalog.js +4 -4
  85. package/dist/entries/models.cjs +293 -293
  86. package/dist/entries/models.d.cts +3 -3
  87. package/dist/entries/models.d.ts +3 -3
  88. package/dist/entries/models.js +4 -4
  89. package/dist/entries/nodes.cjs +206 -206
  90. package/dist/entries/nodes.d.cts +1 -1
  91. package/dist/entries/nodes.d.ts +1 -1
  92. package/dist/entries/nodes.js +8 -8
  93. package/dist/entries/pipeline.cjs +152 -152
  94. package/dist/entries/pipeline.d.cts +1 -1
  95. package/dist/entries/pipeline.d.ts +1 -1
  96. package/dist/entries/pipeline.js +3 -3
  97. package/dist/entries/ugc.cjs +71 -71
  98. package/dist/entries/ugc.js +4 -4
  99. package/dist/entries/video.cjs +117 -117
  100. package/dist/entries/video.js +4 -4
  101. package/dist/entries/workflow.cjs +110 -98
  102. package/dist/entries/workflow.d.cts +28 -2
  103. package/dist/entries/workflow.d.ts +28 -2
  104. package/dist/entries/workflow.js +1 -1
  105. package/dist/index.cjs +1212 -1184
  106. package/dist/index.d.cts +3 -3
  107. package/dist/index.d.ts +3 -3
  108. package/dist/index.js +18 -18
  109. package/dist/{model-catalog-D6Es7VG-.d.ts → model-catalog-BgSvskgY.d.cts} +52 -1
  110. package/dist/{model-catalog-D6Es7VG-.d.cts → model-catalog-BgSvskgY.d.ts} +52 -1
  111. package/dist/{model-constants-22k3fjp1.d.cts → model-constants-DHd9jwQ7.d.cts} +6 -1
  112. package/dist/{model-constants-22k3fjp1.d.ts → model-constants-DHd9jwQ7.d.ts} +6 -1
  113. package/package.json +1 -1
  114. package/src/__tests__/gpt-image-2-6.test.ts +7 -0
  115. package/src/__tests__/image-mask-mode.test.ts +34 -1
  116. package/src/__tests__/mask-edit-follows-source.test.ts +150 -0
  117. package/src/credit-identifiers.ts +8 -4
  118. package/src/entries/model-catalog.ts +4 -0
  119. package/src/entries/workflow.ts +1 -0
  120. package/src/model-catalog.ts +157 -11
  121. package/src/model-constants.ts +12 -2
  122. package/src/node-execution-state.ts +3 -1
  123. package/src/wired-image-size.ts +55 -0
  124. package/dist/chunk-A6HRY3WF.cjs.map +0 -1
  125. package/dist/chunk-BDXXOEBZ.cjs.map +0 -1
  126. package/dist/chunk-DS2TOM32.js.map +0 -1
  127. package/dist/chunk-G6GMY5BC.js.map +0 -1
  128. package/dist/chunk-G7ZYZQKO.cjs +0 -27
  129. package/dist/chunk-GWBQ3GPO.cjs.map +0 -1
  130. package/dist/chunk-HOKWJXHA.cjs.map +0 -1
  131. package/dist/chunk-JKZVRKN3.js.map +0 -1
  132. package/dist/chunk-KOLC7AF2.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { isSeedance2Provider, isMinimaxH3Provider, isWan3Provider, isKling4Provider, isViduQ4Provider, isGeminiOmniPerSecondProvider, PRICING_DEFAULT_RESOLUTION, isGeminiOmniProvider } from './chunk-G6GMY5BC.js';
2
- import { MODEL_CATALOG } from './chunk-KOLC7AF2.js';
1
+ import { isSeedance2Provider, isMinimaxH3Provider, isWan3Provider, isKling4Provider, isViduQ4Provider, isGeminiOmniPerSecondProvider, PRICING_DEFAULT_RESOLUTION, isGeminiOmniProvider } from './chunk-LLOIAGFB.js';
2
+ import { MODEL_CATALOG } from './chunk-A3FHTSLB.js';
3
3
 
4
4
  // src/video-ui-defaults.ts
5
5
  function uiAspectRatioFill(provider) {
@@ -19,5 +19,5 @@ function uiDurationFill(provider) {
19
19
  }
20
20
 
21
21
  export { uiAspectRatioFill, uiDurationFill, uiResolutionFill };
22
- //# sourceMappingURL=chunk-MHY47BLL.js.map
23
- //# sourceMappingURL=chunk-MHY47BLL.js.map
22
+ //# sourceMappingURL=chunk-7WGKP3EU.js.map
23
+ //# sourceMappingURL=chunk-7WGKP3EU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/video-ui-defaults.ts"],"names":[],"mappings":";;;;AA2CO,SAAS,kBAAkB,QAAA,EAAsC;AACtE,EAAA,IAAI,mBAAA,CAAoB,QAAQ,CAAA,IAAK,mBAAA,CAAoB,QAAQ,CAAA,IAAK,cAAA,CAAe,QAAQ,CAAA,EAAG,OAAO,UAAA;AAGvG,EAAA,IAAI,gBAAA,CAAiB,QAAQ,CAAA,EAAG,OAAO,MAAA;AACvC,EAAA,OAAO,MAAA;AACT;AAIO,SAAS,iBAAiB,QAAA,EAAsC;AACrE,EAAA,IAAI,cAAA,CAAe,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,6BAAA,CAA8B,QAAQ,CAAA,EAAG,OAAO,2BAA2B,QAAQ,CAAA;AAC/K,EAAA,IAAI,mBAAA,CAAoB,QAAQ,CAAA,EAAG,OAAO,cAAc,QAAQ,CAAA,EAAG,cAAc,CAAC,CAAA;AAClF,EAAA,OAAO,MAAA;AACT;AAUO,SAAS,eAAe,QAAA,EAAsC;AACnE,EAAA,IAAI,cAAA,CAAe,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,EAAG,OAAO,CAAA;AACjG,EAAA,IAAI,oBAAA,CAAqB,QAAQ,CAAA,EAAG,OAAO,CAAA;AAC3C,EAAA,OAAO,MAAA;AACT","file":"chunk-MHY47BLL.js","sourcesContent":["/**\n * UI-default fills for the unified video nodes — the ONE source of truth shared\n * by the backend DAG payload builder, the config-panel fail-safe snaps and the\n * node's hover/run strip.\n *\n * Several config panels RENDER a default without persisting it to node data, so\n * an untouched node submits `aspectRatio` / `resolution` undefined and the\n * enqueued job row (and the /v1/jobs echo) then disagrees with what actually\n * renders. Worse, the panels' generic snap writes `resolutions[0]` for a stale\n * value, which is the CHEAPEST tier under the repo's ascending-resolution\n * convention — not necessarily the tier the model renders and bills.\n *\n * These helpers were local to `backend/src/services/workflow-engine/payload-builder.ts`\n * until the Wan 3.0 launch gave the platform its first provider whose declared\n * billing default differs from `resolutions[0]`; three surfaces then had to\n * agree, so they live here.\n *\n * The resolution fill is per-family ON PURPOSE. Wan 3.0 (and Vidu Q4, whose\n * ascending list starts at 540p) reads its DECLARED\n * billing default (PRICING_DEFAULT_RESOLUTION = 720p) because its catalog list\n * is ascending, so an index-0 fill would write 480p — a tier both `runWan3`\n * (which renders 720P) and the credit identifier (which bills the 720p row)\n * disagree with. The Seedance family keeps its historical first-catalog-tier\n * fill, deliberately: switching it to PRICING_DEFAULT_RESOLUTION would reprice\n * live seedance-2-5 runs, whose declared default (720p) differs from the 480p\n * this has always filled. That 480p-fill vs 720p-billing-default divergence on\n * seedance-2-5 is a KNOWN pre-existing gap, out of scope here — do not \"align\"\n * the branches without repricing it deliberately.\n */\n\nimport {\n PRICING_DEFAULT_RESOLUTION,\n isSeedance2Provider,\n isMinimaxH3Provider,\n isWan3Provider,\n isViduQ4Provider,\n isKling4Provider,\n isGeminiOmniProvider,\n isGeminiOmniPerSecondProvider,\n} from \"./model-constants.js\"\nimport { MODEL_CATALOG } from \"./model-catalog.js\"\n\n/** `adaptive` is the aspect default for Seedance 2, MiniMax H3 and Wan 3.0. */\nexport function uiAspectRatioFill(provider: string): string | undefined {\n if (isSeedance2Provider(provider) || isMinimaxH3Provider(provider) || isWan3Provider(provider)) return \"adaptive\"\n // Kling 4.0: `auto` follows the materials (frames / references) and renders\n // 16:9 with none — KIE's own default when the field is omitted.\n if (isKling4Provider(provider)) return \"auto\"\n return undefined\n}\n\n/** See the file docstring — per-family on purpose; never a generic\n * PRICING_DEFAULT_RESOLUTION read (that would reprice seedance-2-5). */\nexport function uiResolutionFill(provider: string): string | undefined {\n if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4Provider(provider) || isGeminiOmniPerSecondProvider(provider)) return PRICING_DEFAULT_RESOLUTION[provider]\n if (isSeedance2Provider(provider)) return MODEL_CATALOG[provider]?.resolutions?.[0]\n return undefined\n}\n\n/**\n * Duration the node RENDERS and BILLS when `data.duration` is unset, for the\n * families whose credit identifier declares a duration fallback that is NOT\n * `durations[0]`. Wan 3.0's bare identifier is the 5s tier while its ladder\n * starts at 2s; Vidu Q4's is the 5s tier while its ladder starts at 3s; the\n * Gemini Omni family's is the 8s tier while its ladder starts at 4s. Everyone else falls back to the first listed duration, so this returns\n * undefined and the caller keeps `durations[0]`.\n */\nexport function uiDurationFill(provider: string): number | undefined {\n if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4Provider(provider)) return 5\n if (isGeminiOmniProvider(provider)) return 8\n return undefined\n}\n"]}
1
+ {"version":3,"sources":["../src/video-ui-defaults.ts"],"names":[],"mappings":";;;;AA2CO,SAAS,kBAAkB,QAAA,EAAsC;AACtE,EAAA,IAAI,mBAAA,CAAoB,QAAQ,CAAA,IAAK,mBAAA,CAAoB,QAAQ,CAAA,IAAK,cAAA,CAAe,QAAQ,CAAA,EAAG,OAAO,UAAA;AAGvG,EAAA,IAAI,gBAAA,CAAiB,QAAQ,CAAA,EAAG,OAAO,MAAA;AACvC,EAAA,OAAO,MAAA;AACT;AAIO,SAAS,iBAAiB,QAAA,EAAsC;AACrE,EAAA,IAAI,cAAA,CAAe,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,6BAAA,CAA8B,QAAQ,CAAA,EAAG,OAAO,2BAA2B,QAAQ,CAAA;AAC/K,EAAA,IAAI,mBAAA,CAAoB,QAAQ,CAAA,EAAG,OAAO,cAAc,QAAQ,CAAA,EAAG,cAAc,CAAC,CAAA;AAClF,EAAA,OAAO,MAAA;AACT;AAUO,SAAS,eAAe,QAAA,EAAsC;AACnE,EAAA,IAAI,cAAA,CAAe,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,EAAG,OAAO,CAAA;AACjG,EAAA,IAAI,oBAAA,CAAqB,QAAQ,CAAA,EAAG,OAAO,CAAA;AAC3C,EAAA,OAAO,MAAA;AACT","file":"chunk-7WGKP3EU.js","sourcesContent":["/**\n * UI-default fills for the unified video nodes — the ONE source of truth shared\n * by the backend DAG payload builder, the config-panel fail-safe snaps and the\n * node's hover/run strip.\n *\n * Several config panels RENDER a default without persisting it to node data, so\n * an untouched node submits `aspectRatio` / `resolution` undefined and the\n * enqueued job row (and the /v1/jobs echo) then disagrees with what actually\n * renders. Worse, the panels' generic snap writes `resolutions[0]` for a stale\n * value, which is the CHEAPEST tier under the repo's ascending-resolution\n * convention — not necessarily the tier the model renders and bills.\n *\n * These helpers were local to `backend/src/services/workflow-engine/payload-builder.ts`\n * until the Wan 3.0 launch gave the platform its first provider whose declared\n * billing default differs from `resolutions[0]`; three surfaces then had to\n * agree, so they live here.\n *\n * The resolution fill is per-family ON PURPOSE. Wan 3.0 (and Vidu Q4, whose\n * ascending list starts at 540p) reads its DECLARED\n * billing default (PRICING_DEFAULT_RESOLUTION = 720p) because its catalog list\n * is ascending, so an index-0 fill would write 480p — a tier both `runWan3`\n * (which renders 720P) and the credit identifier (which bills the 720p row)\n * disagree with. The Seedance family keeps its historical first-catalog-tier\n * fill, deliberately: switching it to PRICING_DEFAULT_RESOLUTION would reprice\n * live seedance-2-5 runs, whose declared default (720p) differs from the 480p\n * this has always filled. That 480p-fill vs 720p-billing-default divergence on\n * seedance-2-5 is a KNOWN pre-existing gap, out of scope here — do not \"align\"\n * the branches without repricing it deliberately.\n */\n\nimport {\n PRICING_DEFAULT_RESOLUTION,\n isSeedance2Provider,\n isMinimaxH3Provider,\n isWan3Provider,\n isViduQ4Provider,\n isKling4Provider,\n isGeminiOmniProvider,\n isGeminiOmniPerSecondProvider,\n} from \"./model-constants.js\"\nimport { MODEL_CATALOG } from \"./model-catalog.js\"\n\n/** `adaptive` is the aspect default for Seedance 2, MiniMax H3 and Wan 3.0. */\nexport function uiAspectRatioFill(provider: string): string | undefined {\n if (isSeedance2Provider(provider) || isMinimaxH3Provider(provider) || isWan3Provider(provider)) return \"adaptive\"\n // Kling 4.0: `auto` follows the materials (frames / references) and renders\n // 16:9 with none — KIE's own default when the field is omitted.\n if (isKling4Provider(provider)) return \"auto\"\n return undefined\n}\n\n/** See the file docstring — per-family on purpose; never a generic\n * PRICING_DEFAULT_RESOLUTION read (that would reprice seedance-2-5). */\nexport function uiResolutionFill(provider: string): string | undefined {\n if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4Provider(provider) || isGeminiOmniPerSecondProvider(provider)) return PRICING_DEFAULT_RESOLUTION[provider]\n if (isSeedance2Provider(provider)) return MODEL_CATALOG[provider]?.resolutions?.[0]\n return undefined\n}\n\n/**\n * Duration the node RENDERS and BILLS when `data.duration` is unset, for the\n * families whose credit identifier declares a duration fallback that is NOT\n * `durations[0]`. Wan 3.0's bare identifier is the 5s tier while its ladder\n * starts at 2s; Vidu Q4's is the 5s tier while its ladder starts at 3s; the\n * Gemini Omni family's is the 8s tier while its ladder starts at 4s. Everyone else falls back to the first listed duration, so this returns\n * undefined and the caller keeps `durations[0]`.\n */\nexport function uiDurationFill(provider: string): number | undefined {\n if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4Provider(provider)) return 5\n if (isGeminiOmniProvider(provider)) return 8\n return undefined\n}\n"]}
@@ -129,6 +129,23 @@ var GPT_IMAGE_2_6_RATIOS = [
129
129
  "1:3"
130
130
  ];
131
131
  var GPT_IMAGE_2_6_ECONOMY_RATIOS = ["auto", "1:1", "16:9", "9:16", "3:2", "2:3", "21:9", "4:3"];
132
+ var GPT_IMAGE_2_6_OUTPUT_SIZES = {
133
+ "1:1": { "1K": [1024, 1024], "2K": [2048, 2048], "4K": [2880, 2880] },
134
+ "3:2": { "1K": [1536, 1024], "2K": [2048, 1360], "4K": [3520, 2336] },
135
+ "2:3": { "1K": [1024, 1536], "2K": [1360, 2048], "4K": [2336, 3520] },
136
+ "4:3": { "1K": [1024, 768], "2K": [2048, 1536], "4K": [3312, 2480] },
137
+ "3:4": { "1K": [768, 1024], "2K": [1536, 2048], "4K": [2480, 3312] },
138
+ "5:4": { "1K": [1280, 1024], "2K": [2560, 2048], "4K": [3216, 2576] },
139
+ "4:5": { "1K": [1024, 1280], "2K": [2048, 2560], "4K": [2576, 3216] },
140
+ "16:9": { "1K": [1536, 864], "2K": [2048, 1152], "4K": [3840, 2160] },
141
+ "9:16": { "1K": [864, 1536], "2K": [1152, 2048], "4K": [2160, 3840] },
142
+ "2:1": { "1K": [2048, 1024], "2K": [2688, 1344], "4K": [3840, 1920] },
143
+ "1:2": { "1K": [1024, 2048], "2K": [1344, 2688], "4K": [1920, 3840] },
144
+ "21:9": { "1K": [2016, 864], "2K": [2688, 1152], "4K": [3840, 1648] },
145
+ "9:21": { "1K": [864, 2016], "2K": [1152, 2688], "4K": [1648, 3840] },
146
+ "3:1": { "1K": [1536, 512], "2K": [3072, 1024], "4K": [3840, 1280] },
147
+ "1:3": { "1K": [512, 1536], "2K": [1024, 3072], "4K": [1280, 3840] }
148
+ };
132
149
  var GPT_IMAGE_2_6_VALUE_LABELS = {
133
150
  "3:2": "3:2 (Landscape)",
134
151
  "2:3": "2:3 (Portrait)",
@@ -749,11 +766,13 @@ var IMAGE_MODELS = {
749
766
  maker: "openai",
750
767
  label: "GPT Image 2.6 Flare (I2I)",
751
768
  series: "GPT Image",
752
- 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.",
753
- useCases: ["edit", "high-res"],
754
- features: ["reference-image"],
769
+ 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.",
770
+ useCases: ["edit", "inpaint", "high-res"],
771
+ features: ["reference-image", "mask"],
755
772
  aspectRatios: GPT_IMAGE_2_6_RATIOS,
756
773
  autoAspectFromSourceImage: true,
774
+ outputSizes: GPT_IMAGE_2_6_OUTPUT_SIZES,
775
+ maskEditMatchesSource: true,
757
776
  resolutions: ["1K", "2K", "4K"],
758
777
  qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
759
778
  defaultQuality: "medium",
@@ -857,11 +876,13 @@ var IMAGE_MODELS = {
857
876
  maker: "openai",
858
877
  label: "GPT Image 2.6 Sunburst (I2I)",
859
878
  series: "GPT Image",
860
- 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.",
861
- useCases: ["edit", "high-res"],
862
- features: ["reference-image"],
879
+ 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.",
880
+ useCases: ["edit", "inpaint", "high-res"],
881
+ features: ["reference-image", "mask"],
863
882
  aspectRatios: GPT_IMAGE_2_6_RATIOS,
864
883
  autoAspectFromSourceImage: true,
884
+ outputSizes: GPT_IMAGE_2_6_OUTPUT_SIZES,
885
+ maskEditMatchesSource: true,
865
886
  resolutions: ["1K", "2K", "4K"],
866
887
  qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
867
888
  defaultQuality: "medium",
@@ -3618,6 +3639,41 @@ var MODEL_INPUT_ADJUSTMENT_FIELDS = [
3618
3639
  var IMAGE_GIF_FRAME_SIZE = 512;
3619
3640
  var MASKLESS_OUTPUT_FORMATS = ["gif", "svg"];
3620
3641
  var TRANSPARENT_OUTPUT_FORMATS = ["png", "webp"];
3642
+ function maskEditMatchesSource(modelId, masked) {
3643
+ return masked === true && !!modelId && MODEL_CATALOG[modelId]?.maskEditMatchesSource === true;
3644
+ }
3645
+ function sourceImageSizeNeeded(modelId, aspectRatio, masked) {
3646
+ return autoAspectNeedsSourceImage(modelId, aspectRatio) || maskEditMatchesSource(modelId, masked);
3647
+ }
3648
+ function maskedEditResolution(modelId, levers, sourceImage) {
3649
+ if (!maskEditMatchesSource(modelId, true) || !usableSize(sourceImage)) return void 0;
3650
+ const str = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
3651
+ return normalizeModelInput(
3652
+ modelId,
3653
+ { aspectRatio: str(levers.aspectRatio), resolution: str(levers.resolution), background: str(levers.background), outputFormat: str(levers.outputFormat) },
3654
+ { sourceImage, masked: true }
3655
+ ).resolution;
3656
+ }
3657
+ function resolutionNearestSource(modelId, aspectRatio, source) {
3658
+ const m = MODEL_CATALOG[modelId];
3659
+ const table = m?.outputSizes;
3660
+ if (!table || typeof aspectRatio !== "string" || !usableSize(source)) return void 0;
3661
+ if (!Object.prototype.hasOwnProperty.call(table, aspectRatio)) return void 0;
3662
+ const sizes = table[aspectRatio];
3663
+ const long = Math.max(source.width, source.height);
3664
+ let best;
3665
+ let bestDist = Infinity;
3666
+ for (const resolution of m.resolutions ?? Object.keys(sizes)) {
3667
+ const px = Object.prototype.hasOwnProperty.call(sizes, resolution) ? sizes[resolution] : void 0;
3668
+ if (!px) continue;
3669
+ const dist = Math.abs(Math.log(Math.max(px[0], px[1]) / long));
3670
+ if (dist <= bestDist + ASPECT_TIE_EPSILON) {
3671
+ bestDist = dist;
3672
+ best = resolution;
3673
+ }
3674
+ }
3675
+ return best;
3676
+ }
3621
3677
  function isAutoAspectToken(value) {
3622
3678
  return typeof value === "string" && value.trim().toLowerCase() === "auto";
3623
3679
  }
@@ -3701,8 +3757,23 @@ function normalizeModelInput(modelId, input, context = {}) {
3701
3757
  out.gifFrameDurationMs = format.levers.gifFrameDurationMs;
3702
3758
  out.svgLevel = format.levers.svgLevel;
3703
3759
  const gif = format.levers.outputFormat === "gif";
3704
- const sourceRatio = !gif && autoAspectNeedsSourceImage(modelId, input.aspectRatio) && usableSize(context.sourceImage) ? nearestCatalogAspectRatio(context.sourceImage.width, context.sourceImage.height, m.aspectRatios ?? []) : void 0;
3705
- if (gif) {
3760
+ const followsSource = !gif && maskEditMatchesSource(modelId, context.masked);
3761
+ const askedRatio = followsSource ? "auto" : input.aspectRatio;
3762
+ const sourceRatio = !gif && autoAspectNeedsSourceImage(modelId, askedRatio) && usableSize(context.sourceImage) ? nearestCatalogAspectRatio(context.sourceImage.width, context.sourceImage.height, m.aspectRatios ?? []) : void 0;
3763
+ if (followsSource && input.aspectRatio !== void 0 && !isAutoAspectToken(input.aspectRatio)) {
3764
+ const to = sourceRatio ?? "auto";
3765
+ if (to !== input.aspectRatio) {
3766
+ adjustments.push({
3767
+ field: "aspectRatio",
3768
+ from: input.aspectRatio,
3769
+ to,
3770
+ 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".`
3771
+ });
3772
+ }
3773
+ out.aspectRatio = to;
3774
+ } else if (followsSource && input.aspectRatio === void 0) {
3775
+ out.aspectRatio = sourceRatio ?? "auto";
3776
+ } else if (gif) {
3706
3777
  if (input.aspectRatio !== void 0 && input.aspectRatio !== "1:1" && !isAutoAspectToken(input.aspectRatio)) {
3707
3778
  adjustments.push({
3708
3779
  field: "aspectRatio",
@@ -3712,12 +3783,12 @@ function normalizeModelInput(modelId, input, context = {}) {
3712
3783
  });
3713
3784
  }
3714
3785
  out.aspectRatio = input.aspectRatio === void 0 ? void 0 : "1:1";
3715
- } else if (sourceRatio !== void 0 && input.aspectRatio !== void 0) {
3786
+ } else if (sourceRatio !== void 0 && askedRatio !== void 0) {
3716
3787
  const { width, height } = context.sourceImage;
3717
3788
  const why = m.autoAspectFromSourceImage === true ? `${m.label}'s own "auto" does not keep the photo's shape` : `${m.label} has no "auto" aspect ratio`;
3718
3789
  adjustments.push({
3719
3790
  field: "aspectRatio",
3720
- from: input.aspectRatio,
3791
+ from: input.aspectRatio ?? askedRatio,
3721
3792
  to: sourceRatio,
3722
3793
  reason: `${why} \u2014 using "${sourceRatio}", the supported ratio closest to the source image's shape (${width}x${height}).`
3723
3794
  });
@@ -3725,7 +3796,21 @@ function normalizeModelInput(modelId, input, context = {}) {
3725
3796
  } else {
3726
3797
  out.aspectRatio = snap("aspectRatio", input.aspectRatio, m.aspectRatios);
3727
3798
  }
3728
- if (gif) {
3799
+ if (followsSource) {
3800
+ const asked = snap("resolution", input.resolution, m.resolutions, defaultResolutionFor(modelId));
3801
+ const nearest = resolutionNearestSource(modelId, out.aspectRatio, context.sourceImage);
3802
+ const from = asked ?? m.defaultResolution ?? m.resolutions?.[0];
3803
+ if (nearest !== void 0 && from !== void 0 && nearest !== from) {
3804
+ const { width, height } = context.sourceImage;
3805
+ adjustments.push({
3806
+ field: "resolution",
3807
+ from,
3808
+ to: nearest,
3809
+ 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.`
3810
+ });
3811
+ }
3812
+ out.resolution = nearest ?? asked;
3813
+ } else if (gif) {
3729
3814
  if (input.resolution !== void 0) {
3730
3815
  adjustments.push({
3731
3816
  field: "resolution",
@@ -4161,6 +4246,6 @@ function modelIdsByKindMode(kind, modes, opts = {}) {
4161
4246
  return ids;
4162
4247
  }
4163
4248
 
4164
- export { FLUX2_RES_MP, IMAGE_GIF_FRAME_SIZE, IMAGE_OUTPUT_FORMAT_LABELS, IMAGE_SVG_LEVEL_LABELS, MASKLESS_OUTPUT_FORMATS, MODEL_CATALOG, MODEL_INPUT_ADJUSTMENT_FIELDS, MODEL_KINDS, MODEL_MAKERS, MODEL_RECOMMENDATIONS, SEEDANCE_DRAFT_FINALIZE_MAX_SEC, SEEDANCE_DRAFT_FINALIZE_MIN_SEC, SEEDANCE_DRAFT_FINALIZE_PROVIDER, SEEDANCE_DRAFT_FINALIZE_RESOLUTION, SEEDANCE_DRAFT_MODELS, SEEDANCE_DRAFT_RESOLUTION, SPEECH_UNIT_PRICE_NOTE, TRANSPARENT_OUTPUT_FORMATS, VIDEO_DURATION_AUTO, aspectRatioOptionsByKind, autoAspectNeedsSourceImage, backgroundOptionsByKind, buildModelMenu, creditRangesAll, defaultResolutionFor, durationsByMode, fitAspectRatioToModel, getAspectRatioOptions, getCreditRange, getDurationsForModel, getModel, getQualityOptions, getResolutionOptions, groupByFamily, groupByKindAndFamily, hasFeature, isAutoAspectToken, isAutoVideoDuration, isFlux2Model, isModelMakerId, isSeedanceDraftCapable, listModels, modelIdsByKindMode, modelMakerOf, modelTakesSeed, modelsWithFeature, nearestCatalogAspectRatio, normalizeModelInput, normalizeVideoRequestParams, outputFormatOptionsByKind, qualityOptionsByKind, resolutionAtAspectRatio, resolutionOptionsByKind, resolutionsAtAspectRatio, seedanceDraftFinalizeBillableSec, seedanceDraftFinalizeCreditId, svgLevelOptionsByKind, validateModelInput };
4165
- //# sourceMappingURL=chunk-KOLC7AF2.js.map
4166
- //# sourceMappingURL=chunk-KOLC7AF2.js.map
4249
+ export { FLUX2_RES_MP, IMAGE_GIF_FRAME_SIZE, IMAGE_OUTPUT_FORMAT_LABELS, IMAGE_SVG_LEVEL_LABELS, MASKLESS_OUTPUT_FORMATS, MODEL_CATALOG, MODEL_INPUT_ADJUSTMENT_FIELDS, MODEL_KINDS, MODEL_MAKERS, MODEL_RECOMMENDATIONS, SEEDANCE_DRAFT_FINALIZE_MAX_SEC, SEEDANCE_DRAFT_FINALIZE_MIN_SEC, SEEDANCE_DRAFT_FINALIZE_PROVIDER, SEEDANCE_DRAFT_FINALIZE_RESOLUTION, SEEDANCE_DRAFT_MODELS, SEEDANCE_DRAFT_RESOLUTION, SPEECH_UNIT_PRICE_NOTE, TRANSPARENT_OUTPUT_FORMATS, VIDEO_DURATION_AUTO, aspectRatioOptionsByKind, autoAspectNeedsSourceImage, backgroundOptionsByKind, buildModelMenu, creditRangesAll, defaultResolutionFor, durationsByMode, fitAspectRatioToModel, getAspectRatioOptions, getCreditRange, getDurationsForModel, getModel, getQualityOptions, getResolutionOptions, groupByFamily, groupByKindAndFamily, hasFeature, isAutoAspectToken, isAutoVideoDuration, isFlux2Model, isModelMakerId, isSeedanceDraftCapable, listModels, maskEditMatchesSource, maskedEditResolution, modelIdsByKindMode, modelMakerOf, modelTakesSeed, modelsWithFeature, nearestCatalogAspectRatio, normalizeModelInput, normalizeVideoRequestParams, outputFormatOptionsByKind, qualityOptionsByKind, resolutionAtAspectRatio, resolutionNearestSource, resolutionOptionsByKind, resolutionsAtAspectRatio, seedanceDraftFinalizeBillableSec, seedanceDraftFinalizeCreditId, sourceImageSizeNeeded, svgLevelOptionsByKind, validateModelInput };
4250
+ //# sourceMappingURL=chunk-A3FHTSLB.js.map
4251
+ //# sourceMappingURL=chunk-A3FHTSLB.js.map