@agent-media/image 0.6.1 → 0.7.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.
@@ -12,4 +12,6 @@ export { edit } from './edit.js';
12
12
  export type { EditInput } from './edit.js';
13
13
  export { crop } from './crop.js';
14
14
  export type { CropInput } from './crop.js';
15
+ export { upscale } from './upscale.js';
16
+ export type { UpscaleInput } from './upscale.js';
15
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -5,4 +5,5 @@ export { generate } from './generate.js';
5
5
  export { extend } from './extend.js';
6
6
  export { edit } from './edit.js';
7
7
  export { crop } from './crop.js';
8
+ export { upscale } from './upscale.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { MediaResult } from '@agent-media/core';
2
+ export interface UpscaleInput {
3
+ /** Input file path or URL */
4
+ input: string;
5
+ /** Scale factor (e.g., 2 or 4, default: 2) */
6
+ scale?: number;
7
+ /** Output directory (overrides default) */
8
+ out?: string;
9
+ /** Output filename (extension auto-added if missing) */
10
+ name?: string;
11
+ /** Provider to use (overrides auto-detection) */
12
+ provider?: string;
13
+ /** Model to use (overrides provider default) */
14
+ model?: string;
15
+ }
16
+ /**
17
+ * Upscale an image using AI super-resolution
18
+ * Supports local (Swin2SR), fal (ESRGAN), and replicate (Real-ESRGAN) providers
19
+ */
20
+ export declare function upscale(options: UpscaleInput): Promise<MediaResult>;
21
+ //# sourceMappingURL=upscale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upscale.d.ts","sourceRoot":"","sources":["../../src/actions/upscale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,mBAAmB,CAAC;AAGhF,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA2BzE"}
@@ -0,0 +1,27 @@
1
+ import { executeAction, globalRegistry } from '@agent-media/core';
2
+ /**
3
+ * Upscale an image using AI super-resolution
4
+ * Supports local (Swin2SR), fal (ESRGAN), and replicate (Real-ESRGAN) providers
5
+ */
6
+ export async function upscale(options) {
7
+ const isUrl = options.input.startsWith('http://') || options.input.startsWith('https://');
8
+ const input = {
9
+ source: options.input,
10
+ isUrl,
11
+ };
12
+ const context = {
13
+ outputDir: options.out ?? process.cwd(),
14
+ provider: options.provider,
15
+ outputName: options.name,
16
+ inputSource: options.input,
17
+ };
18
+ return executeAction(globalRegistry, {
19
+ action: 'upscale',
20
+ options: {
21
+ input,
22
+ scale: options.scale,
23
+ model: options.model,
24
+ },
25
+ }, context);
26
+ }
27
+ //# sourceMappingURL=upscale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upscale.js","sourceRoot":"","sources":["../../src/actions/upscale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiBlE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAqB;IACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAE1F,MAAM,KAAK,GAAe;QACxB,MAAM,EAAE,OAAO,CAAC,KAAK;QACrB,KAAK;KACN,CAAC;IAEF,MAAM,OAAO,GAAkB;QAC7B,SAAS,EAAE,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;QACvC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,UAAU,EAAE,OAAO,CAAC,IAAI;QACxB,WAAW,EAAE,OAAO,CAAC,KAAK;KAC3B,CAAC;IAEF,OAAO,aAAa,CAClB,cAAc,EACd;QACE,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE;YACP,KAAK;YACL,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB;KACF,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { resize, convert, removeBackground, generate, extend, edit, crop, } from './actions/index.js';
2
- export type { ResizeInput, ConvertInput, RemoveBackgroundInput, GenerateInput, ExtendInput, EditInput, CropInput, } from './actions/index.js';
1
+ export { resize, convert, removeBackground, generate, extend, edit, crop, upscale, } from './actions/index.js';
2
+ export type { ResizeInput, ConvertInput, RemoveBackgroundInput, GenerateInput, ExtendInput, EditInput, CropInput, UpscaleInput, } from './actions/index.js';
3
3
  export type { MediaResult, MediaSuccessResult, MediaErrorResult, ImageFormat, } from '@agent-media/core';
4
4
  export { isSuccess, isError, printResult } from '@agent-media/core';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,GACL,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,SAAS,EACT,SAAS,GACV,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,GACb,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Export all actions
2
- export { resize, convert, removeBackground, generate, extend, edit, crop, } from './actions/index.js';
2
+ export { resize, convert, removeBackground, generate, extend, edit, crop, upscale, } from './actions/index.js';
3
3
  export { isSuccess, isError, printResult } from '@agent-media/core';
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,GACL,MAAM,oBAAoB,CAAC;AAqB5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EACL,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAsB5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-media/image",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Image actions for agent-media toolkit",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -25,8 +25,8 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@agent-media/core": "0.9.0",
29
- "@agent-media/providers": "0.9.0"
28
+ "@agent-media/core": "0.10.0",
29
+ "@agent-media/providers": "0.10.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.0.0",