@imgly/plugin-ai-image-generation-web 0.2.12 → 0.2.15
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/CHANGELOG.md +18 -0
- package/README.md +579 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/eachlabs/Flux2.image2image.d.ts +22 -0
- package/dist/eachlabs/Flux2.text2image.d.ts +21 -0
- package/dist/eachlabs/Flux2Flex.image2image.d.ts +23 -0
- package/dist/eachlabs/Flux2Flex.text2image.d.ts +22 -0
- package/dist/eachlabs/Flux2Pro.image2image.d.ts +22 -0
- package/dist/eachlabs/Flux2Pro.text2image.d.ts +21 -0
- package/dist/eachlabs/Gemini3Pro.image2image.d.ts +22 -0
- package/dist/eachlabs/Gemini3Pro.text2image.d.ts +23 -0
- package/dist/eachlabs/NanoBananaPro.image2image.d.ts +24 -0
- package/dist/eachlabs/NanoBananaPro.text2image.d.ts +23 -0
- package/dist/eachlabs/OpenAIImage.image2image.d.ts +22 -0
- package/dist/eachlabs/OpenAIImage.text2image.d.ts +21 -0
- package/dist/eachlabs/Seedream45.image2image.d.ts +23 -0
- package/dist/eachlabs/Seedream45.text2image.d.ts +22 -0
- package/dist/eachlabs/createEachLabsClient.d.ts +46 -0
- package/dist/eachlabs/createImageProvider.d.ts +116 -0
- package/dist/eachlabs/index.d.ts +46 -0
- package/dist/eachlabs/index.mjs +142 -0
- package/dist/eachlabs/index.mjs.map +7 -0
- package/dist/eachlabs/types.d.ts +10 -0
- package/dist/eachlabs/utils.d.ts +34 -0
- package/dist/fal-ai/index.mjs +8 -8
- package/dist/fal-ai/index.mjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +2 -2
- package/dist/open-ai/index.mjs.map +2 -2
- package/dist/runware/Flux2Dev.image2image.d.ts +32 -0
- package/dist/runware/Flux2Dev.text2image.d.ts +33 -0
- package/dist/runware/Flux2Flex.image2image.d.ts +34 -0
- package/dist/runware/Flux2Flex.text2image.d.ts +34 -0
- package/dist/runware/Flux2Pro.image2image.d.ts +31 -0
- package/dist/runware/Flux2Pro.text2image.d.ts +31 -0
- package/dist/runware/GptImage1.image2image.d.ts +31 -0
- package/dist/runware/GptImage1.text2image.d.ts +28 -0
- package/dist/runware/GptImage1Mini.image2image.d.ts +31 -0
- package/dist/runware/GptImage1Mini.text2image.d.ts +28 -0
- package/dist/runware/NanoBanana2Pro.image2image.d.ts +31 -0
- package/dist/runware/NanoBanana2Pro.text2image.d.ts +29 -0
- package/dist/runware/Seedream4.image2image.d.ts +30 -0
- package/dist/runware/Seedream4.text2image.d.ts +29 -0
- package/dist/runware/Seedream45.image2image.d.ts +32 -0
- package/dist/runware/Seedream45.text2image.d.ts +30 -0
- package/dist/runware/createImageProvider.d.ts +128 -0
- package/dist/runware/createRunwareClient.d.ts +56 -0
- package/dist/runware/index.d.ts +52 -0
- package/dist/runware/index.mjs +142 -0
- package/dist/runware/index.mjs.map +7 -0
- package/dist/runware/types.d.ts +18 -0
- package/dist/runware/utils.d.ts +45 -0
- package/package.json +31 -22
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { RunwareClient } from './createRunwareClient';
|
|
2
|
+
export type { RunwareProviderConfiguration } from './createImageProvider';
|
|
3
|
+
export declare const ASPECT_RATIO_MAP: Record<string, {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const IMAGE_SIZE_MAP: Record<string, {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function getImageDimensionsFromAspectRatio(aspectRatio: string): {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function getImageDimensionsFromSize(imageSize: string): {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a blob: or buffer: URL to a data URI that Runware can accept
|
|
4
|
+
*/
|
|
5
|
+
export declare function convertImageUrlForRunware(imageUrl?: string, cesdk?: CreativeEditorSDK): Promise<string | undefined>;
|
|
6
|
+
export declare function isCustomImageSize(imageSize: any): imageSize is {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Constraints for a single dimension (width or height)
|
|
12
|
+
*/
|
|
13
|
+
export interface DimensionRange {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Model-specific dimension constraints for image generation.
|
|
19
|
+
* Allows separate constraints for width and height.
|
|
20
|
+
*/
|
|
21
|
+
export interface DimensionConstraints {
|
|
22
|
+
width: DimensionRange;
|
|
23
|
+
height: DimensionRange;
|
|
24
|
+
/** Round dimensions to this multiple (e.g., 16). Defaults to 1 if not specified. */
|
|
25
|
+
multiple?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Converts an array of blob:/buffer: URLs to data URIs for Runware.
|
|
29
|
+
* Used for multi-image inputs like combineImages quick action.
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertImageUrlArrayForRunware(imageUrls?: string[], cesdk?: CreativeEditorSDK): Promise<string[] | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Adjusts dimensions to meet API constraints:
|
|
34
|
+
* - Width and height are constrained to their respective min/max ranges
|
|
35
|
+
* - Optionally rounds to a multiple (e.g., 16)
|
|
36
|
+
* - Preserves aspect ratio when scaling
|
|
37
|
+
*
|
|
38
|
+
* @param width - Original width
|
|
39
|
+
* @param height - Original height
|
|
40
|
+
* @param constraints - Model-specific dimension constraints
|
|
41
|
+
*/
|
|
42
|
+
export declare function adjustDimensions(width: number, height: number, constraints: DimensionConstraints): {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/plugin-ai-image-generation-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"description": "AI image generation plugin for the CE.SDK editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CE.SDK",
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
"./open-ai": {
|
|
37
37
|
"import": "./dist/open-ai/index.mjs",
|
|
38
38
|
"types": "./dist/open-ai/index.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./runware": {
|
|
41
|
+
"import": "./dist/runware/index.mjs",
|
|
42
|
+
"types": "./dist/runware/index.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./eachlabs": {
|
|
45
|
+
"import": "./dist/eachlabs/index.mjs",
|
|
46
|
+
"types": "./dist/eachlabs/index.d.ts"
|
|
39
47
|
}
|
|
40
48
|
},
|
|
41
49
|
"homepage": "https://img.ly/products/creative-sdk",
|
|
@@ -46,28 +54,11 @@
|
|
|
46
54
|
"dist/",
|
|
47
55
|
"bin/"
|
|
48
56
|
],
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"clean": "pnpm exec rimraf dist",
|
|
52
|
-
"purge": "pnpm exec rimraf node_modules",
|
|
53
|
-
"build": "pnpm run clean && pnpm exec node scripts/build.mjs",
|
|
54
|
-
"test": "echo No tests",
|
|
55
|
-
"dev": "SKIP_DTS=true node scripts/watch.mjs",
|
|
56
|
-
"dev:wait": "node ../../scripts/dev-wait.mjs",
|
|
57
|
-
"dev:types": "tsc --emitDeclarationOnly --watch --preserveWatchOutput",
|
|
58
|
-
"publish:latest": "pnpm run build && npm publish --tag latest --access public",
|
|
59
|
-
"publish:next": "pnpm run build && npm publish --tag next --access public",
|
|
60
|
-
"check:all": "concurrently -n lint,type,pretty \"pnpm run check:lint\" \"pnpm run check:types\" \"pnpm run check:pretty\"",
|
|
61
|
-
"check:lint": "eslint --max-warnings 0 './src/**/*.{ts,tsx}'",
|
|
62
|
-
"check:pretty": "prettier --list-different './src/**/*.{ts,tsx}'",
|
|
63
|
-
"check:types": "tsc --noEmit",
|
|
64
|
-
"types:create": "tsc --emitDeclarationOnly"
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@imgly/plugin-ai-generation-web": "0.2.15"
|
|
65
59
|
},
|
|
66
|
-
"dependencies": {},
|
|
67
60
|
"devDependencies": {
|
|
68
|
-
"@imgly/plugin-ai-generation-web": "workspace:*",
|
|
69
61
|
"@fal-ai/client": "^1.3.0",
|
|
70
|
-
"@imgly/plugin-utils": "workspace:*",
|
|
71
62
|
"@types/jest": "^30.0.0",
|
|
72
63
|
"@types/ndarray": "^1.0.14",
|
|
73
64
|
"chalk": "^5.3.0",
|
|
@@ -76,9 +67,27 @@
|
|
|
76
67
|
"eslint": "^8.51.0",
|
|
77
68
|
"lodash-es": "^4.17.21",
|
|
78
69
|
"openapi-types": "^12.1.3",
|
|
79
|
-
"typescript": "^5.3.3"
|
|
70
|
+
"typescript": "^5.3.3",
|
|
71
|
+
"@imgly/plugin-utils": "0.0.0"
|
|
80
72
|
},
|
|
81
73
|
"peerDependencies": {
|
|
82
74
|
"@cesdk/cesdk-js": "^1.49.1"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"start": "npm run watch",
|
|
78
|
+
"clean": "pnpm exec rimraf dist",
|
|
79
|
+
"purge": "pnpm exec rimraf node_modules",
|
|
80
|
+
"build": "pnpm run clean && pnpm exec node scripts/build.mjs",
|
|
81
|
+
"test": "echo No tests",
|
|
82
|
+
"dev": "SKIP_DTS=true node scripts/watch.mjs",
|
|
83
|
+
"dev:wait": "node ../../scripts/dev-wait.mjs",
|
|
84
|
+
"dev:types": "tsc --emitDeclarationOnly --watch --preserveWatchOutput",
|
|
85
|
+
"publish:latest": "pnpm run build && pnpm publish --tag latest --access public --no-git-checks",
|
|
86
|
+
"publish:next": "pnpm run build && pnpm publish --tag next --access public --no-git-checks",
|
|
87
|
+
"check:all": "concurrently -n lint,type,pretty \"pnpm run check:lint\" \"pnpm run check:types\" \"pnpm run check:pretty\"",
|
|
88
|
+
"check:lint": "eslint --max-warnings 0 './src/**/*.{ts,tsx}'",
|
|
89
|
+
"check:pretty": "prettier --list-different './src/**/*.{ts,tsx}'",
|
|
90
|
+
"check:types": "tsc --noEmit",
|
|
91
|
+
"types:create": "tsc --emitDeclarationOnly"
|
|
83
92
|
}
|
|
84
|
-
}
|
|
93
|
+
}
|