@cat-factory/binary-generators 0.2.6 → 0.3.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/contracts/nano-banana.openapi.d.ts.map +1 -1
- package/dist/contracts/nano-banana.openapi.js +35 -13
- package/dist/contracts/nano-banana.openapi.js.map +1 -1
- package/dist/generators/nano-banana.d.ts.map +1 -1
- package/dist/generators/nano-banana.js +7 -6
- package/dist/generators/nano-banana.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nano-banana.openapi.d.ts","sourceRoot":"","sources":["../../src/contracts/nano-banana.openapi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nano-banana.openapi.d.ts","sourceRoot":"","sources":["../../src/contracts/nano-banana.openapi.ts"],"names":[],"mappings":"AA2DA,0GAA0G;AAC1G,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAyZxB,CAAA"}
|
|
@@ -38,15 +38,22 @@
|
|
|
38
38
|
// without failing anything:
|
|
39
39
|
//
|
|
40
40
|
// - the three image model ids, and the resolutions each supports (Lite is 1K only);
|
|
41
|
-
// -
|
|
41
|
+
// - the per-model reference-image caps, which differ by KIND as well as by count;
|
|
42
42
|
// - the ten aspect ratios and the four `image_size` values;
|
|
43
|
-
// - the per-image prices in the generator's description, and the $60 / $120 per 1M output
|
|
43
|
+
// - the per-image prices in the generator's description, and the $30 / $60 / $120 per 1M output
|
|
44
44
|
// token rates behind them;
|
|
45
45
|
// - SynthID watermarking of every generated image.
|
|
46
46
|
//
|
|
47
47
|
// A vendor that changes one of these ships an integration that still compiles, still passes, and
|
|
48
48
|
// is wrong at dispatch. Re-read them against https://ai.google.dev/gemini-api/docs/image-generation
|
|
49
49
|
// when touching this file.
|
|
50
|
+
//
|
|
51
|
+
// THE PATH STAYS `/v1beta` DELIBERATELY. Google's version page says "the Interactions API and its
|
|
52
|
+
// core features are generally available in `v1`", but its image-generation page's own curl example
|
|
53
|
+
// still posts to `https://generativelanguage.googleapis.com/v1beta/interactions`, and no page
|
|
54
|
+
// shows an image request against `/v1`. An agent composes its request from THIS document alone, so
|
|
55
|
+
// transcribing a path the vendor's own worked example contradicts would trade a working call for a
|
|
56
|
+
// tidier one. Move it when a v1 image example exists to copy (read 2026-08-18).
|
|
50
57
|
/** The catalog-facing OpenAPI document for Nano Banana on `https://generativelanguage.googleapis.com`. */
|
|
51
58
|
export const NANO_BANANA_OPENAPI = {
|
|
52
59
|
openapi: '3.1.0',
|
|
@@ -88,6 +95,7 @@ export const NANO_BANANA_OPENAPI = {
|
|
|
88
95
|
},
|
|
89
96
|
},
|
|
90
97
|
'400': { $ref: '#/components/responses/BadRequest' },
|
|
98
|
+
'401': { $ref: '#/components/responses/Unauthenticated' },
|
|
91
99
|
'403': { $ref: '#/components/responses/PermissionDenied' },
|
|
92
100
|
'429': { $ref: '#/components/responses/RateLimited' },
|
|
93
101
|
'500': { $ref: '#/components/responses/ServerError' },
|
|
@@ -108,10 +116,19 @@ export const NANO_BANANA_OPENAPI = {
|
|
|
108
116
|
},
|
|
109
117
|
responses: {
|
|
110
118
|
BadRequest: {
|
|
111
|
-
description: 'The request was rejected. `INVALID_ARGUMENT` is a malformed body,
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
119
|
+
description: 'The request was rejected on its own contents. `INVALID_ARGUMENT` is a malformed body, ' +
|
|
120
|
+
'a field this API does not accept, or a combination it cannot serve (a larger ' +
|
|
121
|
+
'`image_size` on the lite model, say). It is NOT what a bad credential returns, which ' +
|
|
122
|
+
'is a 401: read `error.message` and fix the request. `FAILED_PRECONDITION` is billing ' +
|
|
123
|
+
'not enabled on the project, which every image model requires since none has a free ' +
|
|
124
|
+
'tier.',
|
|
125
|
+
content: { 'application/json': { schema: { $ref: '#/components/schemas/ErrorEnvelope' } } },
|
|
126
|
+
},
|
|
127
|
+
Unauthenticated: {
|
|
128
|
+
description: '`UNAUTHENTICATED`: the API key is missing, malformed or invalid. Retrying and ' +
|
|
129
|
+
'rewriting the request both fail identically, and no key can be invented: report the ' +
|
|
130
|
+
'credential as the gap. Distinct from the 403 below, which is a VALID key without an ' +
|
|
131
|
+
'entitlement.',
|
|
115
132
|
content: { 'application/json': { schema: { $ref: '#/components/schemas/ErrorEnvelope' } } },
|
|
116
133
|
},
|
|
117
134
|
PermissionDenied: {
|
|
@@ -145,9 +162,12 @@ export const NANO_BANANA_OPENAPI = {
|
|
|
145
162
|
input: {
|
|
146
163
|
type: 'array',
|
|
147
164
|
description: 'The prompt, as an ordered list of blocks. One `text` block is the brief; each ' +
|
|
148
|
-
'`image` block is a reference the model composes from or edits
|
|
149
|
-
'
|
|
150
|
-
'
|
|
165
|
+
'`image` block is a reference the model composes from or edits. How many, and of ' +
|
|
166
|
+
'what, is PER MODEL rather than one universal cap: ' +
|
|
167
|
+
'`gemini-3.1-flash-lite-image` takes up to 14 object references and neither ' +
|
|
168
|
+
'characters nor style; `gemini-3.1-flash-image` takes up to 10 objects, 4 ' +
|
|
169
|
+
'characters and 3 style references; `gemini-3-pro-image` takes up to 6 objects and ' +
|
|
170
|
+
'5 characters, and no style references at all.',
|
|
151
171
|
items: { $ref: '#/components/schemas/InputBlock' },
|
|
152
172
|
},
|
|
153
173
|
response_format: { $ref: '#/components/schemas/ImageResponseFormat' },
|
|
@@ -247,10 +267,12 @@ export const NANO_BANANA_OPENAPI = {
|
|
|
247
267
|
properties: {
|
|
248
268
|
thinking_level: {
|
|
249
269
|
type: 'string',
|
|
250
|
-
enum: ['minimal', '
|
|
251
|
-
description: 'How much the model reasons before drawing
|
|
252
|
-
'
|
|
253
|
-
'
|
|
270
|
+
enum: ['minimal', 'high'],
|
|
271
|
+
description: 'How much the model reasons before drawing, and documented for ' +
|
|
272
|
+
'`gemini-3.1-flash-image` alone. `minimal` is the default and is right for a brief ' +
|
|
273
|
+
'that already says what the picture is; `high` earns its keep on ' +
|
|
274
|
+
'composition-heavy work and on images with a lot of text in them. Those are the ' +
|
|
275
|
+
'only two levels: `low` and `medium` are not values this API accepts. The interim ' +
|
|
254
276
|
'images it draws while thinking are not charged, but the thinking TOKENS are.',
|
|
255
277
|
},
|
|
256
278
|
seed: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nano-banana.openapi.js","sourceRoot":"","sources":["../../src/contracts/nano-banana.openapi.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,YAAY;AACZ,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,gGAAgG;AAChG,2DAA2D;AAC3D,EAAE;AACF,+FAA+F;AAC/F,iFAAiF;AACjF,kGAAkG;AAClG,iEAAiE;AACjE,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,gGAAgG;AAChG,4EAA4E;AAC5E,iGAAiG;AACjG,gGAAgG;AAChG,kGAAkG;AAClG,8FAA8F;AAC9F,YAAY;AACZ,EAAE;AACF,iGAAiG;AACjG,6FAA6F;AAC7F,6FAA6F;AAC7F,kGAAkG;AAClG,EAAE;AACF,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,gGAAgG;AAChG,2BAA2B;AAC3B,EAAE;AACF,iGAAiG;AACjG,iGAAiG;AACjG,mGAAmG;AACnG,4BAA4B;AAC5B,EAAE;AACF,sFAAsF;AACtF
|
|
1
|
+
{"version":3,"file":"nano-banana.openapi.js","sourceRoot":"","sources":["../../src/contracts/nano-banana.openapi.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,YAAY;AACZ,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,gGAAgG;AAChG,2DAA2D;AAC3D,EAAE;AACF,+FAA+F;AAC/F,iFAAiF;AACjF,kGAAkG;AAClG,iEAAiE;AACjE,EAAE;AACF,gGAAgG;AAChG,+FAA+F;AAC/F,gGAAgG;AAChG,4EAA4E;AAC5E,iGAAiG;AACjG,gGAAgG;AAChG,kGAAkG;AAClG,8FAA8F;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E;wBACjF,KAAK,EAAE,EAAE,IAAI,EAAE,qCAAqC,EAAE;qBACvD;iBACF;aACF;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,uBAAuB;qBACrC;oBACD,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;iBACjC;aACF;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2EAA2E;gBACxF,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,4BAA4B,EAAE;4BACpE,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,0EAA0E;6BAC7E;4BACD,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,oEAAoE;oCACpE,yEAAyE;6BAC5E;4BACD,OAAO,EAAE;gCACP,IAAI,EAAE,OAAO;gCACb,WAAW,EAAE,mDAAmD;gCAChE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE;6BACtD;yBACF;qBACF;iBACF;aACF;SACF;KACF;CAC6B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nano-banana.d.ts","sourceRoot":"","sources":["../../src/generators/nano-banana.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,0BAA0B,mBAAmB,CAAA;AAE1D;;;;;;;GAOG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"nano-banana.d.ts","sourceRoot":"","sources":["../../src/generators/nano-banana.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,0BAA0B,mBAAmB,CAAA;AAE1D;;;;;;;GAOG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,mBAAmB,6CA+G9B,CAAA"}
|
|
@@ -73,7 +73,8 @@ export const nanoBananaGenerator = defineBinaryGenerator({
|
|
|
73
73
|
// APIs split the same work across two calls or lack a piece of it.
|
|
74
74
|
//
|
|
75
75
|
// - `reference-image` / `multi-reference`: `image` blocks in `input`, up to fourteen on one
|
|
76
|
-
// request
|
|
76
|
+
// request on the lite model and fewer on the others, which also differ in whether a
|
|
77
|
+
// CHARACTER or a STYLE reference counts at all. The contract states the per-model split.
|
|
77
78
|
// - `instruction-edit`: the same operation, an `image` block plus a `text` block saying what to
|
|
78
79
|
// change. Editing is not a separate endpoint here, which is what makes "the same character,
|
|
79
80
|
// now facing left" a request rather than a re-roll.
|
|
@@ -121,13 +122,13 @@ export const nanoBananaGenerator = defineBinaryGenerator({
|
|
|
121
122
|
document: NANO_BANANA_OPENAPI,
|
|
122
123
|
}),
|
|
123
124
|
],
|
|
124
|
-
description: `Generates and EDITS images from a written brief and up to fourteen reference images, and hands the bytes back on the same call. Two things make it worth reaching for: it renders long, legible text inside a picture better than most image APIs (signage, UI mockups, labelled diagrams, a title card that has to say the actual title), and it edits conversationally, so "the same character, now facing left, keep the armour" is a request rather than a re-roll.
|
|
125
|
+
description: `Generates and EDITS images from a written brief and up to fourteen reference images (the cap and the kinds allowed differ per model), and hands the bytes back on the same call. Two things make it worth reaching for: it renders long, legible text inside a picture better than most image APIs (signage, UI mockups, labelled diagrams, a title card that has to say the actual title), and it edits conversationally, so "the same character, now facing left, keep the armour" is a request rather than a re-roll.
|
|
125
126
|
|
|
126
127
|
## Which model
|
|
127
128
|
|
|
128
129
|
| Model | Resolutions | ~Cost / image | Use it for |
|
|
129
130
|
| --- | --- | --- | --- |
|
|
130
|
-
| **\`gemini-3.1-flash-lite-image\`** | 1K only | $0.
|
|
131
|
+
| **\`gemini-3.1-flash-lite-image\`** | 1K only | $0.0336 | Drafting and thumbnails, where several cheap tries beat one considered one. |
|
|
131
132
|
| **\`gemini-3.1-flash-image\`** | 512px, 1K, 2K, 4K | $0.045-0.151 | The default. Everything that is not specifically a typography or identity problem. |
|
|
132
133
|
| **\`gemini-3-pro-image\`** | 1K, 2K, 4K | $0.134-0.24 | The image you keep when it has words in it, or when a character has to survive into a set. |
|
|
133
134
|
|
|
@@ -135,7 +136,7 @@ Cost is per IMAGE and rises with resolution, so the size is the budget. \`image_
|
|
|
135
136
|
|
|
136
137
|
## Getting the same thing twice
|
|
137
138
|
|
|
138
|
-
Reference images, and a conversation.
|
|
139
|
+
Reference images, and a conversation. How many ride one request, and what they may BE, is per model rather than one universal cap: the lite model takes up to 14 object references and no characters or style; flash takes up to 10 objects, 4 characters and 3 style references; pro takes up to 6 objects and 5 characters, and no style references at all. That is how a character, a prop or a palette survives into a second generation, and it is also why a set built on style references cannot be finished on the pro model. Reusing a \`seed\` holds a composition while the prompt changes; it does not hold a subject.
|
|
139
140
|
|
|
140
141
|
## What it is not for
|
|
141
142
|
|
|
@@ -158,11 +159,11 @@ Reference images, and a conversation. Up to fourteen ride a single request (the
|
|
|
158
159
|
2. Size the request from the TARGET. \`image_size\` takes \`512px\`, \`1K\`, \`2K\` or \`4K\` and \`aspect_ratio\` takes one of ten fixed ratios, so pick the smallest bucket that covers what the step asked for and resize the bytes afterwards rather than expecting an exact pixel count.
|
|
159
160
|
3. Send the brief as one \`text\` block describing the PICTURE: subject, framing, materials, lighting, and the words to render if any. A paragraph beats a keyword list here, and text in the brief is rendered literally.
|
|
160
161
|
4. Set \`response_format\` deliberately: \`"type": "image"\` so the model does not answer in prose, and \`mime_type\` \`image/png\` for flat colour, transparency or anything a later step cuts up. \`image/jpeg\` only for a finished photographic image.
|
|
161
|
-
5. Leave \`thinking_level\` at \`minimal\` for a brief that already says what the picture is; raise it to \`high\` for dense composition or a lot of in-image text. The interim images it draws are not charged, but the thinking tokens are.
|
|
162
|
+
5. Leave \`thinking_level\` at \`minimal\` for a brief that already says what the picture is; raise it to \`high\` for dense composition or a lot of in-image text. Those two are the only levels, and the field is documented for \`gemini-3.1-flash-image\`. The interim images it draws are not charged, but the thinking tokens are.
|
|
162
163
|
6. **Check that you got an image.** A declined request is not an error status: it answers 200 with \`output_text\` explaining and NO \`output_image\`. Treat that as terminal and REWRITE the brief, since resubmitting the same words buys the same refusal at the same price.
|
|
163
164
|
7. Decode \`output_image.data\` from raw base64 (there is no \`data:\` prefix) and store the bytes, using \`output_image.mime_type\` as the content type rather than the one you asked for. Read \`usage.total_output_tokens\` for what it cost; it is the only accounting this API gives.
|
|
164
165
|
|
|
165
|
-
**Where this step's generation options land on this API.** The brief lists them once, in the platform's words; these are the fields that carry them here, and all of them ride the ONE request. Reference images are \`image\` blocks in \`input\`,
|
|
166
|
+
**Where this step's generation options land on this API.** The brief lists them once, in the platform's words; these are the fields that carry them here, and all of them ride the ONE request. Reference images are \`image\` blocks in \`input\`, as raw base64 \`data\` rather than a \`uri\`, up to the chosen model's cap (14 objects on lite; 10 objects + 4 characters + 3 style on flash; 6 objects + 5 characters on pro). An instruction edit is an \`image\` block plus the \`text\` block saying what to change; there is no separate edit operation to switch to. A fixed seed is \`generation_config.seed\`. An aspect ratio is \`response_format.aspect_ratio\`, whose ten values are the whole of the list. A negative prompt, a masked edit, a transparent background and a tiling texture have no parameter here at all: report any of them as unmet rather than writing them into the brief and hoping.
|
|
166
167
|
|
|
167
168
|
**Holding a set together.** Send the first image back as an \`image\` block in the next request's \`input\`, alongside the text that says what to change: that is the edit path, and it is how a turnaround or a variant stays the same character. Send bytes as base64 \`data\` rather than \`uri\`, because Google fetches a \`uri\` from its own network and cannot read a link that needs the platform's credentials.
|
|
168
169
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nano-banana.js","sourceRoot":"","sources":["../../src/generators/nano-banana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAA;AAE1D;;;;;;;GAOG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;IACvD,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,aAAa;IACnB,OAAO,EACL,mMAAmM;IACrM,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,+FAA+F;IAC/F,+FAA+F;IAC/F,6FAA6F;IAC7F,UAAU,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;IACvC,8FAA8F;IAC9F,mEAAmE;IACnE,EAAE;IACF,6FAA6F;IAC7F,
|
|
1
|
+
{"version":3,"file":"nano-banana.js","sourceRoot":"","sources":["../../src/generators/nano-banana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAA;AAE1D;;;;;;;GAOG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAEjE;;;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E,iBAAiB;YAC7B,KAAK,EAAE,oEAAoE;YAC3E,QAAQ,EAAE,mBAAmB;SAC9B,CAAC;KACH;IACD,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;uKA0BwJ;IACrK,QAAQ,EAAE,mFAAmF,0BAA0B;;;;;;;;;;;;;;;;;;;;yzBAoBgsB;CACxzB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/binary-generators",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The built-in generative binary integrations (Nano Banana, Google's Gemini image models) plus the authoring seam a deployment defines its own with, written entirely through the public BinaryGeneratorRegistry seam: depends only on @cat-factory/kernel + @cat-factory/contracts, never the engine.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"valibot": "^1.4.2",
|
|
28
|
-
"@cat-factory/contracts": "0.
|
|
29
|
-
"@cat-factory/kernel": "0.
|
|
28
|
+
"@cat-factory/contracts": "0.322.0",
|
|
29
|
+
"@cat-factory/kernel": "0.313.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"openapi-types": "^12.1.3",
|
|
33
33
|
"typescript": "7.0.2",
|
|
34
34
|
"vitest": "^4.1.10",
|
|
35
|
-
"@cat-factory/agents": "0.
|
|
36
|
-
"@cat-factory/orchestration": "0.
|
|
35
|
+
"@cat-factory/agents": "0.138.0",
|
|
36
|
+
"@cat-factory/orchestration": "0.282.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc -b tsconfig.build.json",
|