@agent-media/image 0.7.0 → 0.9.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.
@@ -1,7 +1,7 @@
1
1
  import type { MediaResult } from '@agent-media/core';
2
2
  export interface EditInput {
3
- /** Input file path or URL */
4
- input: string;
3
+ /** One or more input file paths or URLs */
4
+ inputs: string[];
5
5
  /** Text prompt describing the desired edit */
6
6
  prompt: string;
7
7
  /** Output directory (overrides default) */
@@ -12,10 +12,15 @@ export interface EditInput {
12
12
  provider?: string;
13
13
  /** Model to use (overrides provider default) */
14
14
  model?: string;
15
+ /** Aspect ratio for output (e.g., "1:1", "16:9", "auto") */
16
+ aspectRatio?: string;
17
+ /** Output resolution (e.g., "1K", "2K", "4K") */
18
+ resolution?: string;
15
19
  }
16
20
  /**
17
21
  * Edit an image using a text prompt (image-to-image)
18
- * Requires an external provider (runpod)
22
+ * Supports multiple input images for multi-image editing
23
+ * Requires an external provider (fal, replicate, runpod, ai-gateway)
19
24
  */
20
25
  export declare function edit(options: EditInput): Promise<MediaResult>;
21
26
  //# sourceMappingURL=edit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/actions/edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,mBAAmB,CAAC;AAGhF,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,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,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CA2BnE"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/actions/edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,mBAAmB,CAAC;AAGhF,MAAM,WAAW,SAAS;IACxB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,8CAA8C;IAC9C,MAAM,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;IACf,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CA2BnE"}
@@ -1,26 +1,28 @@
1
1
  import { executeAction, globalRegistry } from '@agent-media/core';
2
2
  /**
3
3
  * Edit an image using a text prompt (image-to-image)
4
- * Requires an external provider (runpod)
4
+ * Supports multiple input images for multi-image editing
5
+ * Requires an external provider (fal, replicate, runpod, ai-gateway)
5
6
  */
6
7
  export async function edit(options) {
7
- const isUrl = options.input.startsWith('http://') || options.input.startsWith('https://');
8
- const mediaInput = {
9
- source: options.input,
10
- isUrl,
11
- };
8
+ const mediaInputs = options.inputs.map((input) => ({
9
+ source: input,
10
+ isUrl: input.startsWith('http://') || input.startsWith('https://'),
11
+ }));
12
12
  const context = {
13
13
  outputDir: options.out ?? process.cwd(),
14
14
  provider: options.provider,
15
15
  outputName: options.name,
16
- inputSource: options.input,
16
+ inputSource: options.inputs[0],
17
17
  };
18
18
  return executeAction(globalRegistry, {
19
19
  action: 'edit',
20
20
  options: {
21
- input: mediaInput,
21
+ inputs: mediaInputs,
22
22
  prompt: options.prompt,
23
23
  model: options.model,
24
+ aspectRatio: options.aspectRatio,
25
+ resolution: options.resolution,
24
26
  },
25
27
  }, context);
26
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/actions/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiBlE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAkB;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAE1F,MAAM,UAAU,GAAe;QAC7B,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,MAAM;QACd,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB;KACF,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/actions/edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAqBlE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAkB;IAC3C,MAAM,WAAW,GAAiB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC;KACnE,CAAC,CAAC,CAAC;IAEJ,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,MAAM,CAAC,CAAC,CAAC;KAC/B,CAAC;IAEF,OAAO,aAAa,CAClB,cAAc,EACd;QACE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF,EACD,OAAO,CACR,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-media/image",
3
- "version": "0.7.0",
3
+ "version": "0.9.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.10.0",
29
- "@agent-media/providers": "0.10.0"
28
+ "@agent-media/core": "0.12.0",
29
+ "@agent-media/providers": "0.12.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.0.0",