@blockrun/llm 2.8.0 → 2.9.1

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/README.md CHANGED
@@ -406,7 +406,17 @@ All models below have been tested end-to-end via the TypeScript SDK (Feb 2026):
406
406
  | `xai/grok-imagine-image-pro` | $0.07/image |
407
407
  | `zai/cogview-4` | $0.015/image |
408
408
 
409
- Image editing (`client.edit`): `openai/gpt-image-1` and `openai/gpt-image-2` both support the `/v1/images/image2image` endpoint.
409
+ Image editing (`client.edit`) via `/v1/images/image2image`: `openai/gpt-image-1`, `openai/gpt-image-2`, `google/nano-banana`, and `google/nano-banana-pro`. Pass a single base64 `data:image/...` URI to edit one image, or an array of 2–4 URIs to **fuse** them (e.g. a subject + a brand logo). Fusion caps: `openai/*` up to 4 source images, `google/*` up to 3. A `mask` cannot be combined with multiple source images.
410
+
411
+ ```ts
412
+ // Multi-image fusion with Nano Banana
413
+ const fused = await client.edit(
414
+ "Place the logo on the t-shirt",
415
+ [subjectDataUri, logoDataUri],
416
+ { model: "google/nano-banana" }
417
+ );
418
+ console.log(fused.data[0].url);
419
+ ```
410
420
 
411
421
  ### Video Generation
412
422
  | Model | Price |
package/dist/index.cjs CHANGED
@@ -1463,16 +1463,18 @@ var LLMClient = class _LLMClient {
1463
1463
  return data.data || [];
1464
1464
  }
1465
1465
  /**
1466
- * Edit an image using img2img.
1466
+ * Edit an image using img2img, optionally fusing multiple source images.
1467
1467
  *
1468
1468
  * @param prompt - Text description of the desired edit
1469
- * @param image - Base64-encoded image or URL of the source image
1469
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs
1470
+ * to fuse (image fusion). Caps: `openai/*` up to 4, `google/*` up to 3.
1471
+ * A `mask` cannot be combined with multiple source images.
1470
1472
  * @param options - Optional edit parameters
1471
1473
  * @returns ImageResponse with edited image URLs
1472
1474
  */
1473
1475
  async imageEdit(prompt, image, options) {
1474
1476
  const body = {
1475
- model: options?.model || "openai/gpt-image-1",
1477
+ model: options?.model || "openai/gpt-image-2",
1476
1478
  prompt,
1477
1479
  image,
1478
1480
  size: options?.size || "1024x1024",
@@ -1972,20 +1974,37 @@ var ImageClient = class {
1972
1974
  return this.requestWithPayment("/v1/images/generations", body);
1973
1975
  }
1974
1976
  /**
1975
- * Edit an image using img2img.
1977
+ * Edit an image using img2img, optionally fusing multiple source images.
1978
+ *
1979
+ * Pass a single `data:image/...` base64 data URI to edit one image, or an
1980
+ * array of 2–4 data URIs to fuse them (image fusion) — e.g. a reference photo
1981
+ * plus a brand logo. The server caps fusion per provider: `openai/*` accepts
1982
+ * up to 4 source images, `google/*` (Nano Banana) up to 3. A `mask` cannot be
1983
+ * combined with multiple source images.
1984
+ *
1985
+ * Edit-capable models: `openai/gpt-image-1`, `openai/gpt-image-2`,
1986
+ * `google/nano-banana`, `google/nano-banana-pro`.
1976
1987
  *
1977
1988
  * @param prompt - Text description of the desired edit
1978
- * @param image - Base64-encoded image or URL of the source image
1989
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs to fuse
1979
1990
  * @param options - Optional edit parameters
1980
1991
  * @returns ImageResponse with edited image URLs
1981
1992
  *
1982
1993
  * @example
1983
- * const result = await client.edit('Make it a painting', imageBase64);
1984
- * console.log(result.data[0].url);
1994
+ * // Single-image edit
1995
+ * const result = await client.edit('Make it a painting', imageDataUri);
1996
+ *
1997
+ * @example
1998
+ * // Multi-image fusion (Nano Banana): blend a subject with a brand logo
1999
+ * const fused = await client.edit(
2000
+ * 'Place the logo on the t-shirt',
2001
+ * [subjectDataUri, logoDataUri],
2002
+ * { model: 'google/nano-banana' }
2003
+ * );
1985
2004
  */
1986
2005
  async edit(prompt, image, options) {
1987
2006
  const body = {
1988
- model: options?.model || "openai/gpt-image-1",
2007
+ model: options?.model || "openai/gpt-image-2",
1989
2008
  prompt,
1990
2009
  image,
1991
2010
  size: options?.size || "1024x1024",
@@ -4632,7 +4651,7 @@ var SolanaLLMClient = class {
4632
4651
  /** Edit an image using img2img (Solana payment). */
4633
4652
  async imageEdit(prompt, image, options) {
4634
4653
  const body = {
4635
- model: options?.model || "openai/gpt-image-1",
4654
+ model: options?.model || "openai/gpt-image-2",
4636
4655
  prompt,
4637
4656
  image,
4638
4657
  size: options?.size || "1024x1024",
package/dist/index.d.cts CHANGED
@@ -335,7 +335,7 @@ interface SearchResult {
335
335
  model?: string;
336
336
  }
337
337
  interface ImageEditOptions {
338
- /** Model ID (default: "openai/gpt-image-1") */
338
+ /** Model ID (default: "openai/gpt-image-2") */
339
339
  model?: string;
340
340
  /** Optional base64-encoded mask image */
341
341
  mask?: string;
@@ -1158,14 +1158,16 @@ declare class LLMClient {
1158
1158
  */
1159
1159
  private fetchRawModels;
1160
1160
  /**
1161
- * Edit an image using img2img.
1161
+ * Edit an image using img2img, optionally fusing multiple source images.
1162
1162
  *
1163
1163
  * @param prompt - Text description of the desired edit
1164
- * @param image - Base64-encoded image or URL of the source image
1164
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs
1165
+ * to fuse (image fusion). Caps: `openai/*` up to 4, `google/*` up to 3.
1166
+ * A `mask` cannot be combined with multiple source images.
1165
1167
  * @param options - Optional edit parameters
1166
1168
  * @returns ImageResponse with edited image URLs
1167
1169
  */
1168
- imageEdit(prompt: string, image: string, options?: ImageEditOptions): Promise<ImageResponse>;
1170
+ imageEdit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
1169
1171
  /**
1170
1172
  * Standalone search (web, X/Twitter, news).
1171
1173
  *
@@ -1478,18 +1480,35 @@ declare class ImageClient {
1478
1480
  */
1479
1481
  generate(prompt: string, options?: ImageGenerateOptions): Promise<ImageResponse>;
1480
1482
  /**
1481
- * Edit an image using img2img.
1483
+ * Edit an image using img2img, optionally fusing multiple source images.
1484
+ *
1485
+ * Pass a single `data:image/...` base64 data URI to edit one image, or an
1486
+ * array of 2–4 data URIs to fuse them (image fusion) — e.g. a reference photo
1487
+ * plus a brand logo. The server caps fusion per provider: `openai/*` accepts
1488
+ * up to 4 source images, `google/*` (Nano Banana) up to 3. A `mask` cannot be
1489
+ * combined with multiple source images.
1490
+ *
1491
+ * Edit-capable models: `openai/gpt-image-1`, `openai/gpt-image-2`,
1492
+ * `google/nano-banana`, `google/nano-banana-pro`.
1482
1493
  *
1483
1494
  * @param prompt - Text description of the desired edit
1484
- * @param image - Base64-encoded image or URL of the source image
1495
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs to fuse
1485
1496
  * @param options - Optional edit parameters
1486
1497
  * @returns ImageResponse with edited image URLs
1487
1498
  *
1488
1499
  * @example
1489
- * const result = await client.edit('Make it a painting', imageBase64);
1490
- * console.log(result.data[0].url);
1500
+ * // Single-image edit
1501
+ * const result = await client.edit('Make it a painting', imageDataUri);
1502
+ *
1503
+ * @example
1504
+ * // Multi-image fusion (Nano Banana): blend a subject with a brand logo
1505
+ * const fused = await client.edit(
1506
+ * 'Place the logo on the t-shirt',
1507
+ * [subjectDataUri, logoDataUri],
1508
+ * { model: 'google/nano-banana' }
1509
+ * );
1491
1510
  */
1492
- edit(prompt: string, image: string, options?: ImageEditOptions): Promise<ImageResponse>;
1511
+ edit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
1493
1512
  /**
1494
1513
  * List available image generation models with pricing.
1495
1514
  *
@@ -2504,7 +2523,7 @@ declare class SolanaLLMClient {
2504
2523
  */
2505
2524
  getBalance(): Promise<number>;
2506
2525
  /** Edit an image using img2img (Solana payment). */
2507
- imageEdit(prompt: string, image: string, options?: ImageEditOptions): Promise<ImageResponse>;
2526
+ imageEdit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
2508
2527
  /** Standalone search (Solana payment). */
2509
2528
  search(query: string, options?: SearchOptions): Promise<SearchResult>;
2510
2529
  xUserLookup(usernames: string | string[]): Promise<XUserLookupResponse>;
package/dist/index.d.ts CHANGED
@@ -335,7 +335,7 @@ interface SearchResult {
335
335
  model?: string;
336
336
  }
337
337
  interface ImageEditOptions {
338
- /** Model ID (default: "openai/gpt-image-1") */
338
+ /** Model ID (default: "openai/gpt-image-2") */
339
339
  model?: string;
340
340
  /** Optional base64-encoded mask image */
341
341
  mask?: string;
@@ -1158,14 +1158,16 @@ declare class LLMClient {
1158
1158
  */
1159
1159
  private fetchRawModels;
1160
1160
  /**
1161
- * Edit an image using img2img.
1161
+ * Edit an image using img2img, optionally fusing multiple source images.
1162
1162
  *
1163
1163
  * @param prompt - Text description of the desired edit
1164
- * @param image - Base64-encoded image or URL of the source image
1164
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs
1165
+ * to fuse (image fusion). Caps: `openai/*` up to 4, `google/*` up to 3.
1166
+ * A `mask` cannot be combined with multiple source images.
1165
1167
  * @param options - Optional edit parameters
1166
1168
  * @returns ImageResponse with edited image URLs
1167
1169
  */
1168
- imageEdit(prompt: string, image: string, options?: ImageEditOptions): Promise<ImageResponse>;
1170
+ imageEdit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
1169
1171
  /**
1170
1172
  * Standalone search (web, X/Twitter, news).
1171
1173
  *
@@ -1478,18 +1480,35 @@ declare class ImageClient {
1478
1480
  */
1479
1481
  generate(prompt: string, options?: ImageGenerateOptions): Promise<ImageResponse>;
1480
1482
  /**
1481
- * Edit an image using img2img.
1483
+ * Edit an image using img2img, optionally fusing multiple source images.
1484
+ *
1485
+ * Pass a single `data:image/...` base64 data URI to edit one image, or an
1486
+ * array of 2–4 data URIs to fuse them (image fusion) — e.g. a reference photo
1487
+ * plus a brand logo. The server caps fusion per provider: `openai/*` accepts
1488
+ * up to 4 source images, `google/*` (Nano Banana) up to 3. A `mask` cannot be
1489
+ * combined with multiple source images.
1490
+ *
1491
+ * Edit-capable models: `openai/gpt-image-1`, `openai/gpt-image-2`,
1492
+ * `google/nano-banana`, `google/nano-banana-pro`.
1482
1493
  *
1483
1494
  * @param prompt - Text description of the desired edit
1484
- * @param image - Base64-encoded image or URL of the source image
1495
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs to fuse
1485
1496
  * @param options - Optional edit parameters
1486
1497
  * @returns ImageResponse with edited image URLs
1487
1498
  *
1488
1499
  * @example
1489
- * const result = await client.edit('Make it a painting', imageBase64);
1490
- * console.log(result.data[0].url);
1500
+ * // Single-image edit
1501
+ * const result = await client.edit('Make it a painting', imageDataUri);
1502
+ *
1503
+ * @example
1504
+ * // Multi-image fusion (Nano Banana): blend a subject with a brand logo
1505
+ * const fused = await client.edit(
1506
+ * 'Place the logo on the t-shirt',
1507
+ * [subjectDataUri, logoDataUri],
1508
+ * { model: 'google/nano-banana' }
1509
+ * );
1491
1510
  */
1492
- edit(prompt: string, image: string, options?: ImageEditOptions): Promise<ImageResponse>;
1511
+ edit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
1493
1512
  /**
1494
1513
  * List available image generation models with pricing.
1495
1514
  *
@@ -2504,7 +2523,7 @@ declare class SolanaLLMClient {
2504
2523
  */
2505
2524
  getBalance(): Promise<number>;
2506
2525
  /** Edit an image using img2img (Solana payment). */
2507
- imageEdit(prompt: string, image: string, options?: ImageEditOptions): Promise<ImageResponse>;
2526
+ imageEdit(prompt: string, image: string | string[], options?: ImageEditOptions): Promise<ImageResponse>;
2508
2527
  /** Standalone search (Solana payment). */
2509
2528
  search(query: string, options?: SearchOptions): Promise<SearchResult>;
2510
2529
  xUserLookup(usernames: string | string[]): Promise<XUserLookupResponse>;
package/dist/index.js CHANGED
@@ -1360,16 +1360,18 @@ var LLMClient = class _LLMClient {
1360
1360
  return data.data || [];
1361
1361
  }
1362
1362
  /**
1363
- * Edit an image using img2img.
1363
+ * Edit an image using img2img, optionally fusing multiple source images.
1364
1364
  *
1365
1365
  * @param prompt - Text description of the desired edit
1366
- * @param image - Base64-encoded image or URL of the source image
1366
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs
1367
+ * to fuse (image fusion). Caps: `openai/*` up to 4, `google/*` up to 3.
1368
+ * A `mask` cannot be combined with multiple source images.
1367
1369
  * @param options - Optional edit parameters
1368
1370
  * @returns ImageResponse with edited image URLs
1369
1371
  */
1370
1372
  async imageEdit(prompt, image, options) {
1371
1373
  const body = {
1372
- model: options?.model || "openai/gpt-image-1",
1374
+ model: options?.model || "openai/gpt-image-2",
1373
1375
  prompt,
1374
1376
  image,
1375
1377
  size: options?.size || "1024x1024",
@@ -1869,20 +1871,37 @@ var ImageClient = class {
1869
1871
  return this.requestWithPayment("/v1/images/generations", body);
1870
1872
  }
1871
1873
  /**
1872
- * Edit an image using img2img.
1874
+ * Edit an image using img2img, optionally fusing multiple source images.
1875
+ *
1876
+ * Pass a single `data:image/...` base64 data URI to edit one image, or an
1877
+ * array of 2–4 data URIs to fuse them (image fusion) — e.g. a reference photo
1878
+ * plus a brand logo. The server caps fusion per provider: `openai/*` accepts
1879
+ * up to 4 source images, `google/*` (Nano Banana) up to 3. A `mask` cannot be
1880
+ * combined with multiple source images.
1881
+ *
1882
+ * Edit-capable models: `openai/gpt-image-1`, `openai/gpt-image-2`,
1883
+ * `google/nano-banana`, `google/nano-banana-pro`.
1873
1884
  *
1874
1885
  * @param prompt - Text description of the desired edit
1875
- * @param image - Base64-encoded image or URL of the source image
1886
+ * @param image - A base64 `data:image/...` URI, or an array of 2–4 such URIs to fuse
1876
1887
  * @param options - Optional edit parameters
1877
1888
  * @returns ImageResponse with edited image URLs
1878
1889
  *
1879
1890
  * @example
1880
- * const result = await client.edit('Make it a painting', imageBase64);
1881
- * console.log(result.data[0].url);
1891
+ * // Single-image edit
1892
+ * const result = await client.edit('Make it a painting', imageDataUri);
1893
+ *
1894
+ * @example
1895
+ * // Multi-image fusion (Nano Banana): blend a subject with a brand logo
1896
+ * const fused = await client.edit(
1897
+ * 'Place the logo on the t-shirt',
1898
+ * [subjectDataUri, logoDataUri],
1899
+ * { model: 'google/nano-banana' }
1900
+ * );
1882
1901
  */
1883
1902
  async edit(prompt, image, options) {
1884
1903
  const body = {
1885
- model: options?.model || "openai/gpt-image-1",
1904
+ model: options?.model || "openai/gpt-image-2",
1886
1905
  prompt,
1887
1906
  image,
1888
1907
  size: options?.size || "1024x1024",
@@ -4529,7 +4548,7 @@ var SolanaLLMClient = class {
4529
4548
  /** Edit an image using img2img (Solana payment). */
4530
4549
  async imageEdit(prompt, image, options) {
4531
4550
  const body = {
4532
- model: options?.model || "openai/gpt-image-1",
4551
+ model: options?.model || "openai/gpt-image-2",
4533
4552
  prompt,
4534
4553
  image,
4535
4554
  size: options?.size || "1024x1024",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/llm",
3
- "version": "2.8.0",
3
+ "version": "2.9.1",
4
4
  "type": "module",
5
5
  "description": "BlockRun SDK - Pay-per-request AI (LLM, Image, Video, Music, Voice) via x402 on Base and Solana",
6
6
  "main": "dist/index.cjs",