@nodaro/shared 3.55.0 → 3.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/{chunk-3CHOZ573.js → chunk-2AR3OXAA.js} +276 -17
  2. package/dist/chunk-2AR3OXAA.js.map +1 -0
  3. package/dist/{chunk-ZKHQSG76.js → chunk-2J6NTA5I.js} +4 -4
  4. package/dist/{chunk-ZKHQSG76.js.map → chunk-2J6NTA5I.js.map} +1 -1
  5. package/dist/{chunk-AGTCHDG5.cjs → chunk-33P5FI2U.cjs} +6 -6
  6. package/dist/{chunk-AGTCHDG5.cjs.map → chunk-33P5FI2U.cjs.map} +1 -1
  7. package/dist/{chunk-HG3KKCJJ.js → chunk-4JODLC2N.js} +3 -3
  8. package/dist/{chunk-HG3KKCJJ.js.map → chunk-4JODLC2N.js.map} +1 -1
  9. package/dist/{chunk-N3WL6IOJ.js → chunk-4O5STV7N.js} +55 -5
  10. package/dist/chunk-4O5STV7N.js.map +1 -0
  11. package/dist/chunk-4ONS6QRT.js +42 -0
  12. package/dist/chunk-4ONS6QRT.js.map +1 -0
  13. package/dist/{chunk-E4YES25K.js → chunk-55FQBILM.js} +4 -4
  14. package/dist/{chunk-E4YES25K.js.map → chunk-55FQBILM.js.map} +1 -1
  15. package/dist/{chunk-ZWB3NG4M.js → chunk-62ZQQA7L.js} +3 -3
  16. package/dist/{chunk-ZWB3NG4M.js.map → chunk-62ZQQA7L.js.map} +1 -1
  17. package/dist/{chunk-HEF4BIMA.js → chunk-6GGHM33Z.js} +4 -4
  18. package/dist/{chunk-HEF4BIMA.js.map → chunk-6GGHM33Z.js.map} +1 -1
  19. package/dist/{chunk-KMSEU6FK.js → chunk-7DGJDISO.js} +3 -3
  20. package/dist/{chunk-KMSEU6FK.js.map → chunk-7DGJDISO.js.map} +1 -1
  21. package/dist/{chunk-2OYV6K7D.cjs → chunk-7JM5EZF3.cjs} +13 -13
  22. package/dist/{chunk-2OYV6K7D.cjs.map → chunk-7JM5EZF3.cjs.map} +1 -1
  23. package/dist/chunk-AKDJKMAL.cjs +48 -0
  24. package/dist/chunk-AKDJKMAL.cjs.map +1 -0
  25. package/dist/{chunk-HZL7QMXK.js → chunk-AWS4BWEC.js} +7 -3
  26. package/dist/chunk-AWS4BWEC.js.map +1 -0
  27. package/dist/{chunk-5DVDHL7Y.js → chunk-AZDVL7IM.js} +20 -6
  28. package/dist/chunk-AZDVL7IM.js.map +1 -0
  29. package/dist/{chunk-2R74OU76.cjs → chunk-CGZLENU4.cjs} +276 -16
  30. package/dist/chunk-CGZLENU4.cjs.map +1 -0
  31. package/dist/{chunk-G7IUQKRU.cjs → chunk-CLKU3ZIU.cjs} +51 -51
  32. package/dist/{chunk-G7IUQKRU.cjs.map → chunk-CLKU3ZIU.cjs.map} +1 -1
  33. package/dist/{chunk-MCIBQ5BF.js → chunk-DURFRWAW.js} +9 -9
  34. package/dist/{chunk-MCIBQ5BF.js.map → chunk-DURFRWAW.js.map} +1 -1
  35. package/dist/{chunk-C5S75476.js → chunk-EAKO7PGC.js} +8 -4
  36. package/dist/{chunk-C5S75476.js.map → chunk-EAKO7PGC.js.map} +1 -1
  37. package/dist/{chunk-IPCWYKX5.cjs → chunk-EWARI452.cjs} +60 -46
  38. package/dist/chunk-EWARI452.cjs.map +1 -0
  39. package/dist/{chunk-C6IQCKJT.cjs → chunk-FCQYMPUQ.cjs} +4 -4
  40. package/dist/{chunk-C6IQCKJT.cjs.map → chunk-FCQYMPUQ.cjs.map} +1 -1
  41. package/dist/{chunk-WVACGZYV.cjs → chunk-H7VMJBNZ.cjs} +8 -8
  42. package/dist/{chunk-WVACGZYV.cjs.map → chunk-H7VMJBNZ.cjs.map} +1 -1
  43. package/dist/{chunk-SEEQ3H22.cjs → chunk-HWJE4FNS.cjs} +59 -6
  44. package/dist/chunk-HWJE4FNS.cjs.map +1 -0
  45. package/dist/{chunk-3633VD2M.cjs → chunk-IKP4GOWZ.cjs} +8 -8
  46. package/dist/{chunk-3633VD2M.cjs.map → chunk-IKP4GOWZ.cjs.map} +1 -1
  47. package/dist/{chunk-5R6LTKE5.cjs → chunk-ILMHITHK.cjs} +5 -5
  48. package/dist/{chunk-5R6LTKE5.cjs.map → chunk-ILMHITHK.cjs.map} +1 -1
  49. package/dist/chunk-IOET54EV.js +39 -0
  50. package/dist/chunk-IOET54EV.js.map +1 -0
  51. package/dist/{chunk-ZAK276QF.js → chunk-JHTYULY2.js} +4 -4
  52. package/dist/{chunk-ZAK276QF.js.map → chunk-JHTYULY2.js.map} +1 -1
  53. package/dist/{chunk-OVIIJVXH.cjs → chunk-JO3XSUO2.cjs} +21 -21
  54. package/dist/{chunk-OVIIJVXH.cjs.map → chunk-JO3XSUO2.cjs.map} +1 -1
  55. package/dist/{chunk-UWMXMLMV.js → chunk-MROKQP4U.js} +3 -3
  56. package/dist/{chunk-UWMXMLMV.js.map → chunk-MROKQP4U.js.map} +1 -1
  57. package/dist/{chunk-J4CVGAAV.cjs → chunk-NZRG5CXQ.cjs} +7 -2
  58. package/dist/chunk-NZRG5CXQ.cjs.map +1 -0
  59. package/dist/{chunk-KM35K2M5.cjs → chunk-O7DXNX5J.cjs} +92 -25
  60. package/dist/chunk-O7DXNX5J.cjs.map +1 -0
  61. package/dist/chunk-OWNPYQSH.cjs +283 -0
  62. package/dist/chunk-OWNPYQSH.cjs.map +1 -0
  63. package/dist/{chunk-FIYVKW7F.cjs → chunk-PFXPAWPQ.cjs} +12 -12
  64. package/dist/{chunk-FIYVKW7F.cjs.map → chunk-PFXPAWPQ.cjs.map} +1 -1
  65. package/dist/chunk-QSWUSXRL.cjs +53 -0
  66. package/dist/chunk-QSWUSXRL.cjs.map +1 -0
  67. package/dist/{chunk-MGJR5OXO.js → chunk-RX7WII6I.js} +5 -5
  68. package/dist/{chunk-MGJR5OXO.js.map → chunk-RX7WII6I.js.map} +1 -1
  69. package/dist/chunk-S7FCFQ6X.js +255 -0
  70. package/dist/chunk-S7FCFQ6X.js.map +1 -0
  71. package/dist/{chunk-YBZQXZ6A.js → chunk-ST4WQ6ND.js} +68 -8
  72. package/dist/chunk-ST4WQ6ND.js.map +1 -0
  73. package/dist/{chunk-LKCPFD5X.js → chunk-SWVGHAYO.js} +5 -3
  74. package/dist/chunk-SWVGHAYO.js.map +1 -0
  75. package/dist/{chunk-MTUNORQB.cjs → chunk-TSKYEREJ.cjs} +11 -11
  76. package/dist/{chunk-MTUNORQB.cjs.map → chunk-TSKYEREJ.cjs.map} +1 -1
  77. package/dist/{chunk-LYWJAXPT.js → chunk-UMPZR56R.js} +3 -3
  78. package/dist/{chunk-LYWJAXPT.js.map → chunk-UMPZR56R.js.map} +1 -1
  79. package/dist/{chunk-6HUWQLF2.cjs → chunk-WKCFTWLO.cjs} +6 -6
  80. package/dist/{chunk-6HUWQLF2.cjs.map → chunk-WKCFTWLO.cjs.map} +1 -1
  81. package/dist/chunk-XPUGMYAJ.cjs +27 -0
  82. package/dist/{chunk-HD45Y7QU.cjs.map → chunk-XPUGMYAJ.cjs.map} +1 -1
  83. package/dist/{chunk-G5NTNQ7W.cjs → chunk-XROE3CAS.cjs} +5 -3
  84. package/dist/chunk-XROE3CAS.cjs.map +1 -0
  85. package/dist/{chunk-SZUDEFX2.cjs → chunk-ZXDH3L3P.cjs} +43 -39
  86. package/dist/{chunk-SZUDEFX2.cjs.map → chunk-ZXDH3L3P.cjs.map} +1 -1
  87. package/dist/{chunk-25KAGSPT.js → chunk-ZYITB47P.js} +3 -3
  88. package/dist/{chunk-25KAGSPT.js.map → chunk-ZYITB47P.js.map} +1 -1
  89. package/dist/entries/apps.cjs +43 -42
  90. package/dist/entries/apps.js +8 -7
  91. package/dist/entries/credits.cjs +151 -150
  92. package/dist/entries/credits.d.cts +4 -1
  93. package/dist/entries/credits.d.ts +4 -1
  94. package/dist/entries/credits.js +8 -7
  95. package/dist/entries/entities.cjs +125 -125
  96. package/dist/entries/entities.d.cts +1 -1
  97. package/dist/entries/entities.d.ts +1 -1
  98. package/dist/entries/entities.js +1 -1
  99. package/dist/entries/llm-models.d.cts +1 -1
  100. package/dist/entries/llm-models.d.ts +1 -1
  101. package/dist/entries/model-catalog.cjs +127 -66
  102. package/dist/entries/model-catalog.d.cts +61 -9
  103. package/dist/entries/model-catalog.d.ts +61 -9
  104. package/dist/entries/model-catalog.js +5 -4
  105. package/dist/entries/models.cjs +304 -276
  106. package/dist/entries/models.d.cts +3 -3
  107. package/dist/entries/models.d.ts +3 -3
  108. package/dist/entries/models.js +4 -4
  109. package/dist/entries/nodes.cjs +208 -207
  110. package/dist/entries/nodes.d.cts +1 -1
  111. package/dist/entries/nodes.d.ts +1 -1
  112. package/dist/entries/nodes.js +10 -9
  113. package/dist/entries/pipeline.cjs +161 -149
  114. package/dist/entries/pipeline.d.cts +165 -26
  115. package/dist/entries/pipeline.d.ts +165 -26
  116. package/dist/entries/pipeline.js +3 -3
  117. package/dist/entries/runtime-config.cjs +116 -0
  118. package/dist/entries/runtime-config.cjs.map +1 -0
  119. package/dist/entries/runtime-config.d.cts +308 -0
  120. package/dist/entries/runtime-config.d.ts +308 -0
  121. package/dist/entries/runtime-config.js +3 -0
  122. package/dist/entries/runtime-config.js.map +1 -0
  123. package/dist/entries/ugc.cjs +71 -71
  124. package/dist/entries/ugc.js +4 -4
  125. package/dist/entries/video.cjs +117 -117
  126. package/dist/entries/video.js +4 -4
  127. package/dist/entries/workflow.cjs +150 -146
  128. package/dist/entries/workflow.d.cts +8 -1
  129. package/dist/entries/workflow.d.ts +8 -1
  130. package/dist/entries/workflow.js +2 -2
  131. package/dist/index.cjs +3156 -2942
  132. package/dist/index.d.cts +6 -5
  133. package/dist/index.d.ts +6 -5
  134. package/dist/index.js +23 -21
  135. package/dist/{model-catalog-Dm2UiwUe.d.ts → model-catalog-vQ3NWn24.d.cts} +33 -2
  136. package/dist/{model-catalog-Dm2UiwUe.d.cts → model-catalog-vQ3NWn24.d.ts} +33 -2
  137. package/dist/{model-constants-DZUGVDOw.d.ts → model-constants-QZVHZX25.d.cts} +35 -6
  138. package/dist/{model-constants-DZUGVDOw.d.cts → model-constants-QZVHZX25.d.ts} +35 -6
  139. package/package.json +6 -1
  140. package/src/__tests__/fixtures/root-exports.baseline.json +2 -0
  141. package/src/__tests__/gpt-image-2-6.test.ts +277 -0
  142. package/src/__tests__/image-model-roles.test.ts +28 -9
  143. package/src/__tests__/runtime-config.test.ts +398 -0
  144. package/src/__tests__/voice-library-values.test.ts +24 -0
  145. package/src/credit-identifiers.ts +42 -0
  146. package/src/entries/model-catalog.ts +17 -0
  147. package/src/entries/models.ts +9 -0
  148. package/src/entries/runtime-config.ts +51 -0
  149. package/src/entries/workflow.ts +1 -1
  150. package/src/gpt-image-2-6.ts +104 -0
  151. package/src/image-model-roles.ts +31 -10
  152. package/src/index.ts +1 -0
  153. package/src/model-catalog.ts +302 -14
  154. package/src/model-constants.ts +84 -3
  155. package/src/node-default-mappings.ts +4 -0
  156. package/src/node-refs.ts +11 -0
  157. package/src/pipeline-types.ts +2 -0
  158. package/src/reference-board-templates.ts +2 -0
  159. package/src/runtime-config/contract.ts +492 -0
  160. package/src/runtime-config/worlds.ts +77 -0
  161. package/src/voices.ts +175 -2
  162. package/dist/chunk-2R74OU76.cjs.map +0 -1
  163. package/dist/chunk-3CHOZ573.js.map +0 -1
  164. package/dist/chunk-5DVDHL7Y.js.map +0 -1
  165. package/dist/chunk-ATWLKUAI.cjs +0 -34
  166. package/dist/chunk-ATWLKUAI.cjs.map +0 -1
  167. package/dist/chunk-DUL5ZLTJ.js +0 -29
  168. package/dist/chunk-DUL5ZLTJ.js.map +0 -1
  169. package/dist/chunk-G5NTNQ7W.cjs.map +0 -1
  170. package/dist/chunk-HD45Y7QU.cjs +0 -27
  171. package/dist/chunk-HZL7QMXK.js.map +0 -1
  172. package/dist/chunk-IPCWYKX5.cjs.map +0 -1
  173. package/dist/chunk-J4CVGAAV.cjs.map +0 -1
  174. package/dist/chunk-KM35K2M5.cjs.map +0 -1
  175. package/dist/chunk-LKCPFD5X.js.map +0 -1
  176. package/dist/chunk-N3WL6IOJ.js.map +0 -1
  177. package/dist/chunk-SEEQ3H22.cjs.map +0 -1
  178. package/dist/chunk-YBZQXZ6A.js.map +0 -1
@@ -0,0 +1,104 @@
1
+ /**
2
+ * What makes GPT Image 2.6 Flare and Sunburst price differently from every
3
+ * other image model: a quality setting AND a size, and on an edit the number of
4
+ * input images as well. Economy is a flat price and is not listed here.
5
+ *
6
+ * Only the ids and levers live in this published package. The rates and the
7
+ * formula are `backend/src/ee/billing/gpt-image-2-6-pricing.ts`.
8
+ */
9
+
10
+ export const GPT_IMAGE_2_6_TIERED_T2I = ["gpt-image-2-6-flare", "gpt-image-2-6-sunburst"] as const
11
+ export const GPT_IMAGE_2_6_TIERED_I2I = ["gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst-i2i"] as const
12
+ export type GptImage26TieredModel =
13
+ | (typeof GPT_IMAGE_2_6_TIERED_T2I)[number]
14
+ | (typeof GPT_IMAGE_2_6_TIERED_I2I)[number]
15
+
16
+ export const GPT_IMAGE_2_6_QUALITIES = ["auto", "low", "medium", "high", "xhigh", "max"] as const
17
+ export type GptImage26Quality = (typeof GPT_IMAGE_2_6_QUALITIES)[number]
18
+ /**
19
+ * The quality whose price is known only after the run: KIE picks the level. It
20
+ * is reserved at the Max row and settled on what KIE really billed; every other
21
+ * quality keeps its fixed row.
22
+ */
23
+ export const GPT_IMAGE_2_6_METERED_QUALITY: GptImage26Quality = "auto"
24
+ export const GPT_IMAGE_2_6_RESOLUTIONS = ["1K", "2K", "4K"] as const
25
+ export type GptImage26Resolution = (typeof GPT_IMAGE_2_6_RESOLUTIONS)[number]
26
+
27
+ export const GPT_IMAGE_2_6_DEFAULT_QUALITY: GptImage26Quality = "medium"
28
+ export const GPT_IMAGE_2_6_DEFAULT_RESOLUTION: GptImage26Resolution = "1K"
29
+ /** The most input images an edit is priced for (`REF_IMAGE_MAX_LIMITS`). */
30
+ export const GPT_IMAGE_2_6_MAX_INPUT_IMAGES = 16
31
+
32
+ export function isGptImage26I2i(model: string): boolean {
33
+ return (GPT_IMAGE_2_6_TIERED_I2I as readonly string[]).includes(model)
34
+ }
35
+
36
+ export function isGptImage26Tiered(model: string): model is GptImage26TieredModel {
37
+ return isGptImage26I2i(model) || (GPT_IMAGE_2_6_TIERED_T2I as readonly string[]).includes(model)
38
+ }
39
+
40
+ /** True for a run whose charge is settled on KIE's own bill: Flare or Sunburst at quality Auto. */
41
+ export function isGptImage26AutoRun(provider: unknown, quality: unknown): boolean {
42
+ return typeof provider === "string" && isGptImage26Tiered(provider) && quality === GPT_IMAGE_2_6_METERED_QUALITY
43
+ }
44
+
45
+ /**
46
+ * The images a Generate Image run sends to KIE on GPT Image 2.6: its references
47
+ * and, when it edits a base image, that image too (the worker puts it first,
48
+ * unless it is already one of the references). Any other model is priced on its
49
+ * references alone.
50
+ */
51
+ export function gptImage26SentImages(
52
+ provider: string | undefined,
53
+ references: readonly string[],
54
+ baseImageUrl: unknown,
55
+ ): number {
56
+ const countsBase =
57
+ provider !== undefined &&
58
+ isGptImage26Tiered(provider) &&
59
+ typeof baseImageUrl === "string" &&
60
+ baseImageUrl.length > 0 &&
61
+ !references.includes(baseImageUrl)
62
+ return references.length + (countsBase ? 1 : 0)
63
+ }
64
+
65
+ /**
66
+ * The most pictures a saved moodboard holds. A run sends them as references in
67
+ * the seats the node's own images leave free. An estimate cannot read the
68
+ * moodboard, so it counts this many.
69
+ */
70
+ export const GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES = 12
71
+
72
+ function namesMoodboard(direction: unknown): boolean {
73
+ if (direction === null || typeof direction !== "object") return false
74
+ const style = (direction as Record<string, unknown>).style
75
+ return (Array.isArray(style) ? style : [style]).some(
76
+ (value) => typeof value === "string" && value.startsWith("moodboard:"),
77
+ )
78
+ }
79
+
80
+ /**
81
+ * The input images a workflow estimate counts for one node on a model priced
82
+ * per input image: every list on the node, its source or base image, what is
83
+ * wired in, a moodboard its direction names, and an image-to-image model's own
84
+ * source. An estimate may over-quote, never under.
85
+ */
86
+ export function gptImage26EstimatedImages(
87
+ model: string,
88
+ data: Record<string, unknown>,
89
+ wiredImages: number,
90
+ ): number {
91
+ const listed = (v: unknown) => (Array.isArray(v) ? v.length : 0)
92
+ const single = (v: unknown) => (typeof v === "string" && v.length > 0 ? 1 : 0)
93
+ return (
94
+ listed(data.referenceImageUrls) +
95
+ listed(data.characterDefinitionIds) +
96
+ listed(data.extraRefs) +
97
+ single(data.referenceImageUrl) +
98
+ single(data.baseImageUrl) +
99
+ single(data.sourceImageUrl) +
100
+ wiredImages +
101
+ (namesMoodboard(data.direction) ? GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES : 0) +
102
+ (isGptImage26I2i(model) ? 1 : 0)
103
+ )
104
+ }
@@ -12,19 +12,20 @@ import { MODEL_CATALOG } from "./model-catalog.js"
12
12
  * Decided on 2026-10-08 from a blind five-model comparison, quality
13
13
  * first and price second:
14
14
  * - characters, general text-to-image and video anchors on GPT Image 2;
15
- * - edits on GPT Image 2.5 Flare.
15
+ * - edits on the current GPT Image Flare (2.6 since 2026-11-09), which renders
16
+ * at its default Medium when a run names no quality.
16
17
  * With reference images attached, GPT Image 2 runs as its i2i sibling (the
17
18
  * provider swaps it), so `character` covers identity-from-reference too.
18
19
  *
19
20
  * Nano Banana Pro is no longer a default. It remains a FALLBACK only: last in
20
- * the ratio chain below (it is the one model here that draws 4:5 and 5:4), the
21
- * GPT-family safety-block retry, and the swimwear dressing model.
21
+ * the ratio chain below, the GPT-family safety-block retry, and the swimwear
22
+ * dressing model.
22
23
  */
23
24
  export const IMAGE_MODEL_ROLE_DEFAULTS = {
24
25
  character: "gpt-image-2",
25
26
  general: "gpt-image-2",
26
27
  anchor: "gpt-image-2",
27
- edit: "gpt-image-2-5-flare-i2i",
28
+ edit: "gpt-image-2-6-flare-i2i",
28
29
  } as const
29
30
 
30
31
  export type ImageModelRole = keyof typeof IMAGE_MODEL_ROLE_DEFAULTS
@@ -32,14 +33,15 @@ export type ImageModelRole = keyof typeof IMAGE_MODEL_ROLE_DEFAULTS
32
33
  /**
33
34
  * Where a role's model goes when it cannot draw the requested aspect ratio.
34
35
  * GPT Image 2 draws only auto / 1:1 / 16:9 / 9:16 / 4:3 / 3:4, so 21:9, 3:2,
35
- * 2:3 and the other wide or in-between ratios move to GPT Image 2.5 Sunburst,
36
- * and 4:5 / 5:4 (which neither GPT generation draws) to Nano Banana Pro.
36
+ * 2:3, 4:5, 5:4 and the other wide or in-between ratios move to GPT Image 2.6
37
+ * Sunburst. GPT Image 2.5 Sunburst stays behind it for the ratios only 2.5
38
+ * draws, and Nano Banana Pro comes last.
37
39
  */
38
40
  export const IMAGE_MODEL_RATIO_FALLBACKS: Readonly<Record<ImageModelRole, readonly string[]>> = {
39
- character: ["gpt-image-2-5-sunburst", "nano-banana-pro"],
40
- general: ["gpt-image-2-5-sunburst", "nano-banana-pro"],
41
- anchor: ["gpt-image-2-5-sunburst", "nano-banana-pro"],
42
- edit: ["gpt-image-2-5-sunburst-i2i", "nano-banana-pro"],
41
+ character: ["gpt-image-2-6-sunburst", "gpt-image-2-5-sunburst", "nano-banana-pro"],
42
+ general: ["gpt-image-2-6-sunburst", "gpt-image-2-5-sunburst", "nano-banana-pro"],
43
+ anchor: ["gpt-image-2-6-sunburst", "gpt-image-2-5-sunburst", "nano-banana-pro"],
44
+ edit: ["gpt-image-2-6-sunburst-i2i", "gpt-image-2-5-sunburst-i2i", "nano-banana-pro"],
43
45
  }
44
46
 
45
47
  /** True when the model's catalog entry lists the ratio (or no ratio was asked for). */
@@ -60,3 +62,22 @@ export function defaultImageModel(role: ImageModelRole, aspectRatio?: string | n
60
62
  if (imageModelDrawsRatio(primary, aspectRatio)) return primary
61
63
  return IMAGE_MODEL_RATIO_FALLBACKS[role].find((id) => imageModelDrawsRatio(id, aspectRatio)) ?? primary
62
64
  }
65
+
66
+ /**
67
+ * The model an image node that names none runs on, by node type: the same
68
+ * default its route and its workflow branch apply. For the node types that
69
+ * have one; undefined for any other.
70
+ */
71
+ export function defaultImageModelForNode(nodeType: string, aspectRatio?: string | null): string | undefined {
72
+ switch (nodeType) {
73
+ case "generate-image":
74
+ return defaultImageModel("general", aspectRatio)
75
+ case "image-to-image":
76
+ case "modify-image":
77
+ return defaultImageModel("edit", aspectRatio)
78
+ case "reference-board":
79
+ return defaultImageModel("character", aspectRatio)
80
+ default:
81
+ return undefined
82
+ }
83
+ }
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from "./entries/models.js"
17
17
  export * from "./entries/nodes.js"
18
18
  export * from "./entries/organizations.js"
19
19
  export * from "./entries/pipeline.js"
20
+ export * from "./entries/runtime-config.js"
20
21
  export * from "./entries/scene3d.js"
21
22
  export * from "./entries/social.js"
22
23
  export * from "./entries/types.js"
@@ -335,6 +335,26 @@ export interface ModelCatalogEntry {
335
335
  */
336
336
  unlistedResolutionRendersAs?: string
337
337
  qualities?: readonly string[]
338
+ /**
339
+ * The quality a run renders at when none is named, where that is not the
340
+ * first listed. A value the model does not take snaps to it, as does a panel.
341
+ */
342
+ defaultQuality?: string
343
+ /**
344
+ * The image background settings this model takes (`auto`, `opaque`,
345
+ * `transparent`). Absent: no such setting, and a value sent is dropped.
346
+ */
347
+ backgrounds?: readonly string[]
348
+ /**
349
+ * The one resolution a transparent background renders at, where the provider
350
+ * limits it. `normalizeModelInput` moves the size there and says so.
351
+ */
352
+ transparentResolution?: string
353
+ /**
354
+ * The provider takes the background setting, whatever its value, only at
355
+ * `transparentResolution`. Above it nothing is sent.
356
+ */
357
+ backgroundOnlyAtTransparentResolution?: true
338
358
  durations?: readonly number[]
339
359
  /**
340
360
  * The length (seconds) this model renders when the request names no duration
@@ -381,6 +401,13 @@ export interface ModelCatalogEntry {
381
401
  * Frontend pickers ignore this flag.
382
402
  */
383
403
  mcpHidden?: boolean
404
+ /**
405
+ * Left out of the public docs' model tables and the model lists in the MCP
406
+ * tool descriptions, while a provider can't serve this model. Not an
407
+ * availability switch: what hides a model from every menu and refuses a run
408
+ * is the admin's `model_pricing.is_enabled` (backend lib/model-switch.ts).
409
+ */
410
+ docsHidden?: boolean
384
411
  /**
385
412
  * The provider's safety filter is known to be non-deterministic on this
386
413
  * model — the platform retries a blocked request once; `fallback` names
@@ -407,14 +434,14 @@ export interface ModelRecommendation {
407
434
 
408
435
  export const MODEL_RECOMMENDATIONS: readonly ModelRecommendation[] = [
409
436
  // image
410
- { intent: "best for typography / logos / text-heavy", modelIds: ["gpt-image-2", "gpt-image-2-5-flare"], note: "GPT Image 2 for exact copy, labels and non-Latin text; GPT Image 2.5 Flare is close and faster." },
437
+ { intent: "best for typography / logos / text-heavy", modelIds: ["gpt-image-2", "gpt-image-2-6-flare"], note: "GPT Image 2 for exact copy, labels and non-Latin text; GPT Image 2.6 Flare for posters and layouts, and faster." },
411
438
  // Notes name the RANKING, not the price — the price sits in the generated
412
439
  // table directly below them and in `pricing`, so restating it here just
413
440
  // creates a copy that rots (this one said "1 credit" long after it was 2).
414
441
  { intent: "cheapest realistic image", modelIds: ["z-image", "qwen", "imagen4-fast"], note: "Z-Image is the cheapest. Qwen / Imagen4 Fast for slightly higher quality." },
415
- { intent: "highest fidelity image", modelIds: ["gpt-image-2", "gpt-image-2-5-sunburst", "imagen4-ultra"], note: "GPT Image 2 for characters and identity; GPT Image 2.5 Sunburst for wide or in-between ratios GPT Image 2 can't draw." },
416
- { intent: "image edit / restyle", modelIds: ["gpt-image-2-5-flare-i2i", "gpt-image-2-i2i", "seedream-5-pro-i2i"], note: "GPT Image 2.5 Flare keeps pose, framing and product detail; GPT Image 2 i2i for identity-critical edits; Seedream 5 Pro for instruction-based edits." },
417
- { intent: "highest-resolution image", modelIds: ["topaz-image-upscale", "gpt-image-2", "gpt-image-2-5-sunburst"], note: "Generate at the model's top tier, then Topaz upscale 4x (Topaz's only lever is the 1x/2x/4x factor)." },
442
+ { intent: "highest fidelity image", modelIds: ["gpt-image-2", "gpt-image-2-6-sunburst", "imagen4-ultra"], note: "GPT Image 2 for characters and identity; GPT Image 2.6 Sunburst for wide or in-between ratios GPT Image 2 can't draw." },
443
+ { intent: "image edit / restyle", modelIds: ["gpt-image-2-6-flare-i2i", "gpt-image-2-i2i", "seedream-5-pro-i2i"], note: "GPT Image 2.6 Flare changes what you ask and keeps the rest; GPT Image 2 i2i for identity-critical edits; Seedream 5 Pro for instruction-based edits." },
444
+ { intent: "highest-resolution image", modelIds: ["topaz-image-upscale", "gpt-image-2", "gpt-image-2-6-sunburst"], note: "Generate at the model's top tier, then Topaz upscale 4x (Topaz's only lever is the 1x/2x/4x factor)." },
418
445
  { intent: "background removal / cutout", modelIds: ["recraft-remove-bg"], note: "Cheap, no prompt needed." },
419
446
  // video
420
447
  { intent: "best cinematic video", modelIds: ["veo3", "kling-3.0", "seedance-2"], note: "VEO 3.1 Quality for premium narrative; Kling 3.0 for music-synced motion; Seedance 2 for reference-driven consistency." },
@@ -459,6 +486,24 @@ const GPT_IMAGE_2_5_RATIOS = [
459
486
  "auto", "1:1", "3:2", "2:3", "4:3", "3:4", "16:9", "9:16",
460
487
  "21:9", "27:16", "16:27", "9:8", "8:9",
461
488
  ] as const
489
+ // GPT Image 2.6 Flare and Sunburst: auto plus fifteen ratios, Economy a shorter
490
+ // list of its own (docs.kie.ai/market/gpt/gpt-image-2-6-*).
491
+ const GPT_IMAGE_2_6_RATIOS = [
492
+ "auto", "1:1", "3:2", "2:3", "4:3", "3:4", "5:4", "4:5", "16:9", "9:16",
493
+ "2:1", "1:2", "21:9", "9:21", "3:1", "1:3",
494
+ ] as const
495
+ const GPT_IMAGE_2_6_ECONOMY_RATIOS = ["auto", "1:1", "16:9", "9:16", "3:2", "2:3", "21:9", "4:3"] as const
496
+ const GPT_IMAGE_2_6_VALUE_LABELS = {
497
+ "3:2": "3:2 (Landscape)", "2:3": "2:3 (Portrait)",
498
+ "5:4": "5:4 (Near-square)", "4:5": "4:5 (Near-square)",
499
+ "2:1": "2:1 (Wide)", "1:2": "1:2 (Vertical)",
500
+ "9:21": "9:21 (Ultra-tall)", "3:1": "3:1 (Banner)", "1:3": "1:3 (Vertical banner)",
501
+ // Auto takes the shared label; it is an aspect ratio on these models too.
502
+ "low": "Low", "medium": "Medium", "high": "High", "xhigh": "Extra High", "max": "Max",
503
+ } as const
504
+ // The GPT Image background setting. KIE renders a transparent one at 1K only
505
+ // (`transparentResolution`), which normalizeModelInput enforces.
506
+ const GPT_IMAGE_BACKGROUNDS = ["auto", "opaque", "transparent"] as const
462
507
  const IMAGEN4_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4"] as const
463
508
  const IDEOGRAM_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4"] as const
464
509
  const SEEDREAM_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "21:9"] as const
@@ -718,8 +763,8 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
718
763
  maker: "black-forest-labs",
719
764
  label: "Flux 2 Klein (Open)",
720
765
  series: "Flux",
721
- description: "Open Flux 2 9B from BFL — fast, no safety filter. Runs direct on Replicate.",
722
- useCases: ["realistic", "fast", "unfiltered"],
766
+ description: "Open Flux 2 9B from BFL — fast. Runs direct on Replicate.",
767
+ useCases: ["realistic", "fast"],
723
768
  features: ["reference-image"],
724
769
  aspectRatios: FLUX_RATIOS,
725
770
  resolutions: ["0.5 MP", "1 MP", "2 MP", "4 MP"],
@@ -737,8 +782,8 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
737
782
  maker: "black-forest-labs",
738
783
  label: "Kontext Multi (Open)",
739
784
  series: "Flux",
740
- description: "Multi-image Flux Kontext Pro via Replicate — up to 4 input images, no safety filter.",
741
- useCases: ["edit", "multi-reference", "unfiltered"],
785
+ description: "Multi-image Flux Kontext Pro via Replicate — up to 4 input images.",
786
+ useCases: ["edit", "multi-reference"],
742
787
  features: ["reference-image"],
743
788
  aspectRatios: KONTEXT_RATIOS,
744
789
  pricing: [{ identifier: "kontext-multi", credits: 30 }],
@@ -751,8 +796,8 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
751
796
  maker: "black-forest-labs",
752
797
  label: "Flux 2 Pro (Safety Tolerance)",
753
798
  series: "Flux",
754
- description: "BFL Flux 2 Pro flagship via Replicate — exposes the `safety_tolerance` lever pinned to 5 (max for Pro). Accepts up to 4 reference images.",
755
- useCases: ["realistic", "high-quality", "unfiltered", "reference"],
799
+ description: "BFL Flux 2 Pro flagship via Replicate. Accepts up to 4 reference images.",
800
+ useCases: ["realistic", "high-quality", "reference"],
756
801
  features: ["reference-image"],
757
802
  aspectRatios: FLUX_RATIOS,
758
803
  resolutions: ["0.5 MP", "1 MP", "2 MP", "4 MP"],
@@ -770,8 +815,8 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
770
815
  maker: "black-forest-labs",
771
816
  label: "Flux 2 Max (Safety Tolerance)",
772
817
  series: "Flux",
773
- description: "BFL Flux 2 Max — even larger sibling of Pro via Replicate, safety_tolerance=5, up to 8 reference images. Variable pricing by MP and ref count.",
774
- useCases: ["realistic", "high-quality", "unfiltered", "multi-reference"],
818
+ description: "BFL Flux 2 Max — even larger sibling of Pro via Replicate, up to 8 reference images. Variable pricing by MP and ref count.",
819
+ useCases: ["realistic", "high-quality", "multi-reference"],
775
820
  features: ["reference-image"],
776
821
  aspectRatios: FLUX_RATIOS,
777
822
  resolutions: ["0.5 MP", "1 MP", "2 MP", "4 MP"],
@@ -878,6 +923,9 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
878
923
  features: ["reference-image"],
879
924
  aspectRatios: GPT_IMAGE_2_5_RATIOS,
880
925
  resolutions: ["1K", "2K", "4K"],
926
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
927
+ transparentResolution: "1K",
928
+ backgroundOnlyAtTransparentResolution: true,
881
929
  pricing: [
882
930
  { identifier: "gpt-image-2-5-flare", credits: 15, note: "1K default" },
883
931
  { identifier: "gpt-image-2-5-flare:2K", credits: 25, note: "2K" },
@@ -903,6 +951,9 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
903
951
  features: ["reference-image"],
904
952
  aspectRatios: GPT_IMAGE_2_5_RATIOS,
905
953
  resolutions: ["1K", "2K", "4K"],
954
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
955
+ transparentResolution: "1K",
956
+ backgroundOnlyAtTransparentResolution: true,
906
957
  pricing: [
907
958
  { identifier: "gpt-image-2-5-flare-i2i", credits: 15, note: "1K default" },
908
959
  { identifier: "gpt-image-2-5-flare-i2i:2K", credits: 25, note: "2K" },
@@ -928,6 +979,9 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
928
979
  features: ["reference-image"],
929
980
  aspectRatios: GPT_IMAGE_2_5_RATIOS,
930
981
  resolutions: ["1K", "2K", "4K"],
982
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
983
+ transparentResolution: "1K",
984
+ backgroundOnlyAtTransparentResolution: true,
931
985
  pricing: [
932
986
  { identifier: "gpt-image-2-5-sunburst", credits: 15, note: "1K default" },
933
987
  { identifier: "gpt-image-2-5-sunburst:2K", credits: 25, note: "2K" },
@@ -953,6 +1007,9 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
953
1007
  features: ["reference-image"],
954
1008
  aspectRatios: GPT_IMAGE_2_5_RATIOS,
955
1009
  resolutions: ["1K", "2K", "4K"],
1010
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1011
+ transparentResolution: "1K",
1012
+ backgroundOnlyAtTransparentResolution: true,
956
1013
  pricing: [
957
1014
  { identifier: "gpt-image-2-5-sunburst-i2i", credits: 15, note: "1K default" },
958
1015
  { identifier: "gpt-image-2-5-sunburst-i2i:2K", credits: 25, note: "2K" },
@@ -965,6 +1022,185 @@ const IMAGE_MODELS: Record<string, ModelCatalogEntry> = {
965
1022
  },
966
1023
  safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
967
1024
  },
1025
+ "gpt-image-2-6-flare": {
1026
+ id: "gpt-image-2-6-flare",
1027
+ kind: "image",
1028
+ modes: ["t2i"] as const,
1029
+ family: "OpenAI",
1030
+ maker: "openai",
1031
+ label: "GPT Image 2.6 Flare",
1032
+ series: "GPT Image",
1033
+ description: "Fast GPT Image 2.6 - pick it for speed: posters, product shots and quick iteration, with stronger layouts. Up to 4K, quality from low to max or auto (priced up to the max), a transparent background at 1K.",
1034
+ useCases: ["typography", "high-res", "general", "draft"],
1035
+ features: ["reference-image"],
1036
+ aspectRatios: GPT_IMAGE_2_6_RATIOS,
1037
+ resolutions: ["1K", "2K", "4K"],
1038
+ qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
1039
+ defaultQuality: "medium",
1040
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1041
+ transparentResolution: "1K",
1042
+ pricing: [
1043
+ { identifier: "gpt-image-2-6-flare", credits: 20, note: "medium, 1K default" },
1044
+ { identifier: "gpt-image-2-6-flare:low:1K", credits: 12, note: "low, 1K" },
1045
+ { identifier: "gpt-image-2-6-flare:low:2K", credits: 23, note: "low, 2K" },
1046
+ { identifier: "gpt-image-2-6-flare:low:4K", credits: 38, note: "low, 4K" },
1047
+ { identifier: "gpt-image-2-6-flare:medium:1K", credits: 20, note: "medium, 1K" },
1048
+ { identifier: "gpt-image-2-6-flare:medium:2K", credits: 40, note: "medium, 2K" },
1049
+ { identifier: "gpt-image-2-6-flare:medium:4K", credits: 67, note: "medium, 4K" },
1050
+ { identifier: "gpt-image-2-6-flare:high:1K", credits: 24, note: "high, 1K" },
1051
+ { identifier: "gpt-image-2-6-flare:high:2K", credits: 49, note: "high, 2K" },
1052
+ { identifier: "gpt-image-2-6-flare:high:4K", credits: 81, note: "high, 4K" },
1053
+ { identifier: "gpt-image-2-6-flare:xhigh:1K", credits: 43, note: "extra high, 1K" },
1054
+ { identifier: "gpt-image-2-6-flare:xhigh:2K", credits: 86, note: "extra high, 2K" },
1055
+ { identifier: "gpt-image-2-6-flare:xhigh:4K", credits: 143, note: "extra high, 4K" },
1056
+ { identifier: "gpt-image-2-6-flare:max:1K", credits: 96, note: "max, 1K" },
1057
+ { identifier: "gpt-image-2-6-flare:max:2K", credits: 193, note: "max, 2K" },
1058
+ { identifier: "gpt-image-2-6-flare:max:4K", credits: 321, note: "max, 4K" },
1059
+ { identifier: "gpt-image-2-6-flare:auto:1K", credits: 96, note: "auto, 1K: the most it can cost, settled on what it really cost" },
1060
+ { identifier: "gpt-image-2-6-flare:auto:2K", credits: 193, note: "auto, 2K: the most it can cost, settled on what it really cost" },
1061
+ { identifier: "gpt-image-2-6-flare:auto:4K", credits: 321, note: "auto, 4K: the most it can cost, settled on what it really cost" },
1062
+ ],
1063
+ valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
1064
+ safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
1065
+ },
1066
+ "gpt-image-2-6-flare-i2i": {
1067
+ id: "gpt-image-2-6-flare-i2i",
1068
+ kind: "image",
1069
+ modes: ["i2i"] as const,
1070
+ family: "OpenAI",
1071
+ maker: "openai",
1072
+ label: "GPT Image 2.6 Flare (I2I)",
1073
+ series: "GPT Image",
1074
+ description: "Fast GPT Image 2.6 edits - up to 16 input images, priced per image. Pick it while iterating.",
1075
+ useCases: ["edit", "high-res"],
1076
+ features: ["reference-image"],
1077
+ aspectRatios: GPT_IMAGE_2_6_RATIOS,
1078
+ resolutions: ["1K", "2K", "4K"],
1079
+ qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
1080
+ defaultQuality: "medium",
1081
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1082
+ transparentResolution: "1K",
1083
+ pricing: [
1084
+ { identifier: "gpt-image-2-6-flare-i2i", credits: 20, note: "medium, 1K default" },
1085
+ { identifier: "gpt-image-2-6-flare-i2i:low:1K:1ref", credits: 17, note: "low, 1K, one input image (the least)" },
1086
+ { identifier: "gpt-image-2-6-flare-i2i:medium:1K:1ref", credits: 26, note: "medium, 1K, one input image" },
1087
+ { identifier: "gpt-image-2-6-flare-i2i:high:4K:16ref", credits: 169, note: "high, 4K, sixteen input images" },
1088
+ { identifier: "gpt-image-2-6-flare-i2i:max:4K:16ref", credits: 409, note: "max, 4K, sixteen input images (the most)" },
1089
+ { identifier: "gpt-image-2-6-flare-i2i:auto:1K:1ref", credits: 101, note: "auto, 1K, one input image: the most it can cost, settled on what it really cost" },
1090
+ ],
1091
+ valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
1092
+ safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
1093
+ },
1094
+ "gpt-image-2-6-sunburst": {
1095
+ id: "gpt-image-2-6-sunburst",
1096
+ kind: "image",
1097
+ modes: ["t2i"] as const,
1098
+ family: "OpenAI",
1099
+ maker: "openai",
1100
+ label: "GPT Image 2.6 Sunburst",
1101
+ series: "GPT Image",
1102
+ description: "Precision GPT Image 2.6 - pick it when every detail counts: the strongest consistency across edits and the finest detail. Up to 4K, quality from low to max or auto (priced up to the max), a transparent background at 1K.",
1103
+ useCases: ["typography", "high-res", "general"],
1104
+ features: ["reference-image"],
1105
+ aspectRatios: GPT_IMAGE_2_6_RATIOS,
1106
+ resolutions: ["1K", "2K", "4K"],
1107
+ qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
1108
+ defaultQuality: "medium",
1109
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1110
+ transparentResolution: "1K",
1111
+ pricing: [
1112
+ { identifier: "gpt-image-2-6-sunburst", credits: 20, note: "medium, 1K default" },
1113
+ { identifier: "gpt-image-2-6-sunburst:low:1K", credits: 12, note: "low, 1K" },
1114
+ { identifier: "gpt-image-2-6-sunburst:low:2K", credits: 23, note: "low, 2K" },
1115
+ { identifier: "gpt-image-2-6-sunburst:low:4K", credits: 38, note: "low, 4K" },
1116
+ { identifier: "gpt-image-2-6-sunburst:medium:1K", credits: 20, note: "medium, 1K" },
1117
+ { identifier: "gpt-image-2-6-sunburst:medium:2K", credits: 40, note: "medium, 2K" },
1118
+ { identifier: "gpt-image-2-6-sunburst:medium:4K", credits: 67, note: "medium, 4K" },
1119
+ { identifier: "gpt-image-2-6-sunburst:high:1K", credits: 24, note: "high, 1K" },
1120
+ { identifier: "gpt-image-2-6-sunburst:high:2K", credits: 49, note: "high, 2K" },
1121
+ { identifier: "gpt-image-2-6-sunburst:high:4K", credits: 81, note: "high, 4K" },
1122
+ { identifier: "gpt-image-2-6-sunburst:xhigh:1K", credits: 43, note: "extra high, 1K" },
1123
+ { identifier: "gpt-image-2-6-sunburst:xhigh:2K", credits: 86, note: "extra high, 2K" },
1124
+ { identifier: "gpt-image-2-6-sunburst:xhigh:4K", credits: 143, note: "extra high, 4K" },
1125
+ { identifier: "gpt-image-2-6-sunburst:max:1K", credits: 96, note: "max, 1K" },
1126
+ { identifier: "gpt-image-2-6-sunburst:max:2K", credits: 193, note: "max, 2K" },
1127
+ { identifier: "gpt-image-2-6-sunburst:max:4K", credits: 321, note: "max, 4K" },
1128
+ { identifier: "gpt-image-2-6-sunburst:auto:1K", credits: 96, note: "auto, 1K: the most it can cost, settled on what it really cost" },
1129
+ { identifier: "gpt-image-2-6-sunburst:auto:2K", credits: 193, note: "auto, 2K: the most it can cost, settled on what it really cost" },
1130
+ { identifier: "gpt-image-2-6-sunburst:auto:4K", credits: 321, note: "auto, 4K: the most it can cost, settled on what it really cost" },
1131
+ ],
1132
+ valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
1133
+ safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
1134
+ },
1135
+ "gpt-image-2-6-sunburst-i2i": {
1136
+ id: "gpt-image-2-6-sunburst-i2i",
1137
+ kind: "image",
1138
+ modes: ["i2i"] as const,
1139
+ family: "OpenAI",
1140
+ maker: "openai",
1141
+ label: "GPT Image 2.6 Sunburst (I2I)",
1142
+ series: "GPT Image",
1143
+ description: "Precision GPT Image 2.6 edits - up to 16 input images, priced per image. Pick it for finished, detail-critical edits.",
1144
+ useCases: ["edit", "high-res"],
1145
+ features: ["reference-image"],
1146
+ aspectRatios: GPT_IMAGE_2_6_RATIOS,
1147
+ resolutions: ["1K", "2K", "4K"],
1148
+ qualities: ["auto", "low", "medium", "high", "xhigh", "max"],
1149
+ defaultQuality: "medium",
1150
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1151
+ transparentResolution: "1K",
1152
+ pricing: [
1153
+ { identifier: "gpt-image-2-6-sunburst-i2i", credits: 20, note: "medium, 1K default" },
1154
+ { identifier: "gpt-image-2-6-sunburst-i2i:low:1K:1ref", credits: 17, note: "low, 1K, one input image (the least)" },
1155
+ { identifier: "gpt-image-2-6-sunburst-i2i:medium:1K:1ref", credits: 26, note: "medium, 1K, one input image" },
1156
+ { identifier: "gpt-image-2-6-sunburst-i2i:high:4K:16ref", credits: 169, note: "high, 4K, sixteen input images" },
1157
+ { identifier: "gpt-image-2-6-sunburst-i2i:max:4K:16ref", credits: 409, note: "max, 4K, sixteen input images (the most)" },
1158
+ { identifier: "gpt-image-2-6-sunburst-i2i:auto:1K:1ref", credits: 101, note: "auto, 1K, one input image: the most it can cost, settled on what it really cost" },
1159
+ ],
1160
+ valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
1161
+ safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
1162
+ },
1163
+ // Economy is withheld since 2026-11-09: KIE answers every Economy request with
1164
+ // an internal error, on its own playground too. Migration 611 switched the two
1165
+ // ids off (`model_pricing.is_enabled`), which hides them from every menu and
1166
+ // refuses a run. Turning the two rows on at /admin/models brings them back;
1167
+ // `docsHidden` keeps them out of the docs until it is removed here.
1168
+ "gpt-image-2-6-economy": {
1169
+ id: "gpt-image-2-6-economy",
1170
+ kind: "image",
1171
+ modes: ["t2i"] as const,
1172
+ family: "OpenAI",
1173
+ maker: "openai",
1174
+ label: "GPT Image 2.6 Economy",
1175
+ docsHidden: true,
1176
+ series: "GPT Image",
1177
+ description: "The same GPT Image 2.6 at a flat low price, 1K only - pick it for volume.",
1178
+ useCases: ["general", "draft"],
1179
+ features: ["reference-image"],
1180
+ aspectRatios: GPT_IMAGE_2_6_ECONOMY_RATIOS,
1181
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1182
+ pricing: [{ identifier: "gpt-image-2-6-economy", credits: 13, note: "1K flat" }],
1183
+ valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
1184
+ safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
1185
+ },
1186
+ "gpt-image-2-6-economy-i2i": {
1187
+ id: "gpt-image-2-6-economy-i2i",
1188
+ kind: "image",
1189
+ modes: ["i2i"] as const,
1190
+ family: "OpenAI",
1191
+ maker: "openai",
1192
+ label: "GPT Image 2.6 Economy (I2I)",
1193
+ docsHidden: true,
1194
+ series: "GPT Image",
1195
+ description: "Flat-price GPT Image 2.6 edits, 1K only, up to 16 input images - pick it for volume.",
1196
+ useCases: ["edit", "draft"],
1197
+ features: ["reference-image"],
1198
+ aspectRatios: GPT_IMAGE_2_6_ECONOMY_RATIOS,
1199
+ backgrounds: GPT_IMAGE_BACKGROUNDS,
1200
+ pricing: [{ identifier: "gpt-image-2-6-economy-i2i", credits: 13, note: "1K flat" }],
1201
+ valueLabels: GPT_IMAGE_2_6_VALUE_LABELS,
1202
+ safetyFilter: { stochastic: true, fallback: "nano-banana-pro" },
1203
+ },
968
1204
 
969
1205
  // ── Ideogram ──
970
1206
  // Ideogram models use a `rendering_speed` (TURBO / BALANCED / QUALITY)
@@ -3704,7 +3940,7 @@ function sameOptionValue(a: string | number, b: string | number): boolean {
3704
3940
 
3705
3941
  /** One correction `normalizeModelInput` made, for disclosure to the user. */
3706
3942
  export interface ModelInputAdjustment {
3707
- field: "aspectRatio" | "resolution" | "quality" | "duration"
3943
+ field: "aspectRatio" | "resolution" | "quality" | "duration" | "background"
3708
3944
  /** The value that was asked for. */
3709
3945
  from: string | number
3710
3946
  /** What it became — `undefined` means the lever was dropped entirely. */
@@ -3717,6 +3953,7 @@ export interface NormalizedModelInput {
3717
3953
  resolution?: string
3718
3954
  quality?: string
3719
3955
  duration?: number
3956
+ background?: string
3720
3957
  /** Empty when the input was already valid. */
3721
3958
  adjustments: ModelInputAdjustment[]
3722
3959
  }
@@ -3838,6 +4075,7 @@ export function normalizeModelInput(
3838
4075
  resolution?: string
3839
4076
  quality?: string
3840
4077
  duration?: number
4078
+ background?: string
3841
4079
  },
3842
4080
  context: ModelInputContext = {},
3843
4081
  ): NormalizedModelInput {
@@ -3904,7 +4142,8 @@ export function normalizeModelInput(
3904
4142
  m.resolutions,
3905
4143
  defaultResolutionFor(modelId),
3906
4144
  )
3907
- out.quality = snap("quality", input.quality, m.qualities)
4145
+ out.quality = snap("quality", input.quality, m.qualities, m.defaultQuality)
4146
+ out.background = snap("background", input.background, m.backgrounds)
3908
4147
  out.duration =
3909
4148
  m.autoDuration === true && isAutoVideoDuration(input.duration)
3910
4149
  ? input.duration
@@ -3933,6 +4172,42 @@ export function normalizeModelInput(
3933
4172
  }
3934
4173
  }
3935
4174
 
4175
+ // A transparent background only renders at the size the provider allows it.
4176
+ // Priced after this, so the run pays for the size it renders.
4177
+ if (
4178
+ out.background === "transparent" &&
4179
+ m.transparentResolution !== undefined &&
4180
+ out.resolution !== undefined &&
4181
+ out.resolution !== m.transparentResolution
4182
+ ) {
4183
+ adjustments.push({
4184
+ field: "resolution",
4185
+ from: out.resolution,
4186
+ to: m.transparentResolution,
4187
+ reason: `${m.label} only renders a transparent background at ${m.transparentResolution}.`,
4188
+ })
4189
+ out.resolution = m.transparentResolution
4190
+ }
4191
+
4192
+ // Above that size such a model takes no background setting at all. `auto` is
4193
+ // what it does anyway, so only `opaque` is a change worth saying.
4194
+ if (
4195
+ m.backgroundOnlyAtTransparentResolution &&
4196
+ out.background !== undefined &&
4197
+ out.resolution !== undefined &&
4198
+ out.resolution !== m.transparentResolution
4199
+ ) {
4200
+ if (out.background !== "auto") {
4201
+ adjustments.push({
4202
+ field: "background",
4203
+ from: out.background,
4204
+ to: undefined,
4205
+ reason: `${m.label} only takes a background setting at ${m.transparentResolution}.`,
4206
+ })
4207
+ }
4208
+ out.background = undefined
4209
+ }
4210
+
3936
4211
  return out
3937
4212
  }
3938
4213
 
@@ -4175,6 +4450,7 @@ const MODEL_VALUE_LABELS: Record<string, string> = {
4175
4450
  "2k": "2K",
4176
4451
  "8K": "8K (Ultra)",
4177
4452
  // qualities
4453
+ "low": "Low (Fast)",
4178
4454
  "medium": "Medium (Balanced)",
4179
4455
  "high": "High (Detailed)",
4180
4456
  "basic": "Basic (2K)",
@@ -4318,6 +4594,17 @@ export function qualityOptionsByKind(kind: ModelKind): Record<string, LabeledOpt
4318
4594
  return out
4319
4595
  }
4320
4596
 
4597
+ /** Same shape as `qualityOptionsByKind` but for `backgrounds`. */
4598
+ export function backgroundOptionsByKind(kind: ModelKind): Record<string, LabeledOption[]> {
4599
+ const out: Record<string, LabeledOption[]> = {}
4600
+ for (const m of Object.values(MODEL_CATALOG)) {
4601
+ if (m.kind !== kind) continue
4602
+ if (!m.backgrounds) continue
4603
+ out[m.id] = m.backgrounds.map((v) => ({ value: v, label: decorateLabel(m, v) }))
4604
+ }
4605
+ return out
4606
+ }
4607
+
4321
4608
  /** One shaped model row for a picker — capabilities derived from the catalog. */
4322
4609
  export interface ModelMenuOption {
4323
4610
  /** Catalog id (the API enum value). */
@@ -4398,6 +4685,7 @@ export function modelIdsByKindMode(
4398
4685
  .filter((m) => (kind === null ? true : m.kind === kind))
4399
4686
  .filter((m) => m.modes.some((md) => modes.includes(md)))
4400
4687
  .filter((m) => includeHidden || !m.mcpHidden)
4688
+ .filter((m) => !m.docsHidden)
4401
4689
  .map((m) => m.id)
4402
4690
  .sort()
4403
4691
  if (ids.length === 0) {