@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,22 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Flux 2 image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Flux2Image2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Flux 2 Edit - Transform images using AI via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Standard Flux 2 image transformation
|
|
17
|
+
* - Supports up to 3 reference images
|
|
18
|
+
*/
|
|
19
|
+
export declare function Flux2Image2Image(config: EachLabsProviderConfiguration): (context: {
|
|
20
|
+
cesdk: CreativeEditorSDK;
|
|
21
|
+
}) => Promise<Provider<'image', Flux2Image2ImageInput, ImageOutput>>;
|
|
22
|
+
export default Flux2Image2Image;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Flux 2 text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Flux2Input = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_size?: 'square_hd' | 'square' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Flux 2 - Text-to-image generation via EachLabs
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - 6 image size options
|
|
16
|
+
* - Standard Flux 2 generation from Black Forest Labs
|
|
17
|
+
*/
|
|
18
|
+
export declare function Flux2(config: EachLabsProviderConfiguration): (context: {
|
|
19
|
+
cesdk: CreativeEditorSDK;
|
|
20
|
+
}) => Promise<Provider<'image', Flux2Input, ImageOutput>>;
|
|
21
|
+
export default Flux2;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Flux 2 Flex image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Flux2FlexImage2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Flux 2 Flex Edit - Transform images using AI via EachLabs with prompt expansion
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Automatic prompt expansion using the model's knowledge
|
|
17
|
+
* - Automatic image size detection ("auto" mode)
|
|
18
|
+
* - Supports up to 10 reference images
|
|
19
|
+
*/
|
|
20
|
+
export declare function Flux2FlexImage2Image(config: EachLabsProviderConfiguration): (context: {
|
|
21
|
+
cesdk: CreativeEditorSDK;
|
|
22
|
+
}) => Promise<Provider<'image', Flux2FlexImage2ImageInput, ImageOutput>>;
|
|
23
|
+
export default Flux2FlexImage2Image;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Flux 2 Flex text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Flux2FlexInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_size?: 'square_hd' | 'square' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Flux 2 Flex - Text-to-image generation via EachLabs with prompt expansion
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - 6 image size options
|
|
16
|
+
* - Automatic prompt expansion using the model's knowledge
|
|
17
|
+
* - High-quality Flux 2 generation from Black Forest Labs
|
|
18
|
+
*/
|
|
19
|
+
export declare function Flux2Flex(config: EachLabsProviderConfiguration): (context: {
|
|
20
|
+
cesdk: CreativeEditorSDK;
|
|
21
|
+
}) => Promise<Provider<'image', Flux2FlexInput, ImageOutput>>;
|
|
22
|
+
export default Flux2Flex;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Flux 2 Pro image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Flux2ProImage2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Flux 2 Pro Edit - Transform images using AI via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - High-quality image transformation
|
|
17
|
+
* - Supports up to 4 reference images
|
|
18
|
+
*/
|
|
19
|
+
export declare function Flux2ProImage2Image(config: EachLabsProviderConfiguration): (context: {
|
|
20
|
+
cesdk: CreativeEditorSDK;
|
|
21
|
+
}) => Promise<Provider<'image', Flux2ProImage2ImageInput, ImageOutput>>;
|
|
22
|
+
export default Flux2ProImage2Image;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Flux 2 Pro text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Flux2ProInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_size?: 'square_hd' | 'square' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Flux 2 Pro - High-quality text-to-image generation via EachLabs
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - 6 image size options
|
|
16
|
+
* - High-quality generation from Black Forest Labs
|
|
17
|
+
*/
|
|
18
|
+
export declare function Flux2Pro(config: EachLabsProviderConfiguration): (context: {
|
|
19
|
+
cesdk: CreativeEditorSDK;
|
|
20
|
+
}) => Promise<Provider<'image', Flux2ProInput, ImageOutput>>;
|
|
21
|
+
export default Flux2Pro;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Gemini 3 Pro image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Gemini3ProImage2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Gemini 3 Pro Image Edit - Transform images using Google Gemini via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - High-quality image transformation
|
|
17
|
+
* - Supports multiple reference images (up to 10)
|
|
18
|
+
*/
|
|
19
|
+
export declare function Gemini3ProImage2Image(config: EachLabsProviderConfiguration): (context: {
|
|
20
|
+
cesdk: CreativeEditorSDK;
|
|
21
|
+
}) => Promise<Provider<'image', Gemini3ProImage2ImageInput, ImageOutput>>;
|
|
22
|
+
export default Gemini3ProImage2Image;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Gemini 3 Pro text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Gemini3ProText2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
aspect_ratio?: '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3' | '21:9' | '5:4' | '4:5';
|
|
10
|
+
resolution?: '1K' | '2K' | '4K';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Gemini 3 Pro Image - Google's advanced text-to-image generation via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - 8 aspect ratio options
|
|
17
|
+
* - 3 resolution options (1K, 2K, 4K)
|
|
18
|
+
* - High-quality generation from Google Gemini
|
|
19
|
+
*/
|
|
20
|
+
export declare function Gemini3ProText2Image(config: EachLabsProviderConfiguration): (context: {
|
|
21
|
+
cesdk: CreativeEditorSDK;
|
|
22
|
+
}) => Promise<Provider<'image', Gemini3ProText2ImageInput, ImageOutput>>;
|
|
23
|
+
export default Gemini3ProText2Image;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Nano Banana Pro image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type NanoBananaProImage2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
resolution?: '1K' | '2K' | '4K';
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Nano Banana Pro Edit - Transform images using multi-style AI via EachLabs
|
|
15
|
+
*
|
|
16
|
+
* Features:
|
|
17
|
+
* - Multi-style image transformation
|
|
18
|
+
* - Multiple resolution options (1K, 2K, 4K)
|
|
19
|
+
* - Supports up to 10 reference images
|
|
20
|
+
*/
|
|
21
|
+
export declare function NanoBananaProImage2Image(config: EachLabsProviderConfiguration): (context: {
|
|
22
|
+
cesdk: CreativeEditorSDK;
|
|
23
|
+
}) => Promise<Provider<'image', NanoBananaProImage2ImageInput, ImageOutput>>;
|
|
24
|
+
export default NanoBananaProImage2Image;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Nano Banana Pro text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type NanoBananaProInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
aspect_ratio?: '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3' | '21:9' | '5:4' | '4:5';
|
|
10
|
+
resolution?: '1K' | '2K' | '4K';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Nano Banana Pro - Multi-style AI image generation model via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - 10 aspect ratio options
|
|
17
|
+
* - Multiple resolution options (1K, 2K, 4K)
|
|
18
|
+
* - High-quality multi-style generation
|
|
19
|
+
*/
|
|
20
|
+
export declare function NanoBananaPro(config: EachLabsProviderConfiguration): (context: {
|
|
21
|
+
cesdk: CreativeEditorSDK;
|
|
22
|
+
}) => Promise<Provider<'image', NanoBananaProInput, ImageOutput>>;
|
|
23
|
+
export default NanoBananaPro;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for OpenAI GPT Image image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type OpenAIImageImage2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* OpenAI GPT Image Edit - Transform images using AI via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - High-quality image transformation
|
|
17
|
+
* - Supports multiple reference images (up to 16)
|
|
18
|
+
*/
|
|
19
|
+
export declare function OpenAIImageImage2Image(config: EachLabsProviderConfiguration): (context: {
|
|
20
|
+
cesdk: CreativeEditorSDK;
|
|
21
|
+
}) => Promise<Provider<'image', OpenAIImageImage2ImageInput, ImageOutput>>;
|
|
22
|
+
export default OpenAIImageImage2Image;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for OpenAI GPT Image text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type OpenAIImageText2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_size?: '1024x1024' | '1536x1024' | '1024x1536';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* OpenAI GPT Image - High-quality text-to-image generation via EachLabs
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - 3 image size options (Square, Landscape, Portrait)
|
|
16
|
+
* - High-quality generation from OpenAI
|
|
17
|
+
*/
|
|
18
|
+
export declare function OpenAIImageText2Image(config: EachLabsProviderConfiguration): (context: {
|
|
19
|
+
cesdk: CreativeEditorSDK;
|
|
20
|
+
}) => Promise<Provider<'image', OpenAIImageText2ImageInput, ImageOutput>>;
|
|
21
|
+
export default OpenAIImageText2Image;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Seedream v4.5 image-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Seedream45Image2ImageInput = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_url?: string;
|
|
10
|
+
image_urls?: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Seedream v4.5 Edit - Transform images using AI via EachLabs
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - High-quality image transformation
|
|
17
|
+
* - Supports up to 10 reference images
|
|
18
|
+
* - Improved facial details and text generation over v4.0
|
|
19
|
+
*/
|
|
20
|
+
export declare function Seedream45Image2Image(config: EachLabsProviderConfiguration): (context: {
|
|
21
|
+
cesdk: CreativeEditorSDK;
|
|
22
|
+
}) => Promise<Provider<'image', Seedream45Image2ImageInput, ImageOutput>>;
|
|
23
|
+
export default Seedream45Image2Image;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Provider, type ImageOutput } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { EachLabsProviderConfiguration } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Input interface for Seedream v4.5 text-to-image
|
|
6
|
+
*/
|
|
7
|
+
export type Seedream45Input = {
|
|
8
|
+
prompt: string;
|
|
9
|
+
image_size?: 'square_hd' | 'square' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Seedream v4.5 - High-quality text-to-image generation via EachLabs
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* - 6 image size options
|
|
16
|
+
* - High-quality generation from ByteDance
|
|
17
|
+
* - Improved facial details and text generation over v4.0
|
|
18
|
+
*/
|
|
19
|
+
export declare function Seedream45(config: EachLabsProviderConfiguration): (context: {
|
|
20
|
+
cesdk: CreativeEditorSDK;
|
|
21
|
+
}) => Promise<Provider<'image', Seedream45Input, ImageOutput>>;
|
|
22
|
+
export default Seedream45;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for EachLabs image inference
|
|
3
|
+
*/
|
|
4
|
+
export interface EachLabsImageInferenceParams {
|
|
5
|
+
/** Model slug (e.g., 'nano-banana-pro') */
|
|
6
|
+
model: string;
|
|
7
|
+
/** Model version */
|
|
8
|
+
version: string;
|
|
9
|
+
/** Input parameters for the model */
|
|
10
|
+
input: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Result from EachLabs image inference
|
|
14
|
+
*/
|
|
15
|
+
export interface EachLabsImageResult {
|
|
16
|
+
imageURL: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* EachLabs storage interface for file uploads
|
|
20
|
+
*/
|
|
21
|
+
export interface EachLabsStorage {
|
|
22
|
+
/**
|
|
23
|
+
* Upload a file to EachLabs storage
|
|
24
|
+
* @param file - The file to upload
|
|
25
|
+
* @returns The URL of the uploaded file
|
|
26
|
+
*/
|
|
27
|
+
upload: (file: File) => Promise<string>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* EachLabs API client interface
|
|
31
|
+
*/
|
|
32
|
+
export interface EachLabsClient {
|
|
33
|
+
imageInference: (params: EachLabsImageInferenceParams, abortSignal?: AbortSignal) => Promise<EachLabsImageResult[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Storage API for uploading files
|
|
36
|
+
*/
|
|
37
|
+
storage: EachLabsStorage;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates an EachLabs API client
|
|
41
|
+
*
|
|
42
|
+
* @param proxyUrl - The proxy URL to use for API requests
|
|
43
|
+
* @param headers - Optional additional headers
|
|
44
|
+
* @returns EachLabs client instance
|
|
45
|
+
*/
|
|
46
|
+
export declare function createEachLabsClient(proxyUrl: string, headers?: Record<string, string>): EachLabsClient;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type OpenAPIV3 } from 'openapi-types';
|
|
2
|
+
import type CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import type { CreativeEngine } from '@cesdk/cesdk-js';
|
|
4
|
+
import { ImageOutput, RenderCustomProperty, GetBlockInput, Provider, Middleware } from '@imgly/plugin-ai-generation-web';
|
|
5
|
+
import { ImageQuickActionSupportMap } from '../types';
|
|
6
|
+
type MiddlewareType = Middleware<any, any>;
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for EachLabs image providers.
|
|
9
|
+
*/
|
|
10
|
+
export interface EachLabsProviderConfiguration {
|
|
11
|
+
/**
|
|
12
|
+
* HTTP endpoint URL for the EachLabs proxy. The proxy handles API key injection.
|
|
13
|
+
*/
|
|
14
|
+
proxyUrl: string;
|
|
15
|
+
/**
|
|
16
|
+
* Enable debug logging for provider creation and API calls.
|
|
17
|
+
*/
|
|
18
|
+
debug?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Middleware functions to process inputs/outputs.
|
|
21
|
+
*/
|
|
22
|
+
middlewares?: MiddlewareType[];
|
|
23
|
+
/**
|
|
24
|
+
* Override provider's default history asset source.
|
|
25
|
+
*/
|
|
26
|
+
history?: false | '@imgly/local' | '@imgly/indexedDB' | (string & {});
|
|
27
|
+
/**
|
|
28
|
+
* Configure supported quick actions.
|
|
29
|
+
*/
|
|
30
|
+
supportedQuickActions?: {
|
|
31
|
+
[quickActionId: string]: Partial<ImageQuickActionSupportMap<any>[string]> | false | null;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options for creating an EachLabs image provider.
|
|
36
|
+
*/
|
|
37
|
+
interface CreateProviderOptions<I extends Record<string, any>> {
|
|
38
|
+
/**
|
|
39
|
+
* EachLabs model slug (e.g., 'nano-banana-pro').
|
|
40
|
+
*/
|
|
41
|
+
modelSlug: string;
|
|
42
|
+
/**
|
|
43
|
+
* EachLabs model version (e.g., '0.0.1').
|
|
44
|
+
*/
|
|
45
|
+
modelVersion: string;
|
|
46
|
+
/**
|
|
47
|
+
* Unique provider identifier for registration.
|
|
48
|
+
*/
|
|
49
|
+
providerId: string;
|
|
50
|
+
/**
|
|
51
|
+
* Human-readable provider name displayed in the UI.
|
|
52
|
+
*/
|
|
53
|
+
name: string;
|
|
54
|
+
/**
|
|
55
|
+
* OpenAPI schema document describing the input parameters.
|
|
56
|
+
*/
|
|
57
|
+
schema: OpenAPIV3.Document;
|
|
58
|
+
/**
|
|
59
|
+
* JSON reference to the input schema (e.g., '#/components/schemas/Input').
|
|
60
|
+
*/
|
|
61
|
+
inputReference: string;
|
|
62
|
+
/**
|
|
63
|
+
* User flow mode for the provider panel.
|
|
64
|
+
*/
|
|
65
|
+
useFlow?: 'placeholder' | 'generation-only';
|
|
66
|
+
/**
|
|
67
|
+
* Initialization callback when the provider is registered.
|
|
68
|
+
*/
|
|
69
|
+
initialize?: (context: {
|
|
70
|
+
cesdk?: CreativeEditorSDK;
|
|
71
|
+
engine: CreativeEngine;
|
|
72
|
+
}) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Custom property renderers for the input panel.
|
|
75
|
+
*/
|
|
76
|
+
renderCustomProperty?: RenderCustomProperty;
|
|
77
|
+
/**
|
|
78
|
+
* Quick actions this provider supports.
|
|
79
|
+
*/
|
|
80
|
+
supportedQuickActions?: ImageQuickActionSupportMap<I>;
|
|
81
|
+
/**
|
|
82
|
+
* Get block dimensions from input parameters.
|
|
83
|
+
*/
|
|
84
|
+
getBlockInput?: GetBlockInput<'image', I>;
|
|
85
|
+
/**
|
|
86
|
+
* Extract image dimensions from input parameters.
|
|
87
|
+
*/
|
|
88
|
+
getImageSize?: (input: I) => {
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Transform input parameters to EachLabs API format.
|
|
94
|
+
*/
|
|
95
|
+
mapInput: (input: I) => Record<string, any>;
|
|
96
|
+
/**
|
|
97
|
+
* Provider-specific middleware functions.
|
|
98
|
+
*/
|
|
99
|
+
middleware?: MiddlewareType[];
|
|
100
|
+
/**
|
|
101
|
+
* Custom headers to include in API requests.
|
|
102
|
+
*/
|
|
103
|
+
headers?: Record<string, string>;
|
|
104
|
+
/**
|
|
105
|
+
* CE.SDK instance for image URL conversion.
|
|
106
|
+
*/
|
|
107
|
+
cesdk?: CreativeEditorSDK;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates an EachLabs image provider from schema.
|
|
111
|
+
*/
|
|
112
|
+
declare function createImageProvider<I extends Record<string, any> & {
|
|
113
|
+
image_url?: string;
|
|
114
|
+
image_urls?: string[];
|
|
115
|
+
}>(options: CreateProviderOptions<I>, config: EachLabsProviderConfiguration): Provider<'image', I, ImageOutput>;
|
|
116
|
+
export default createImageProvider;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NanoBananaPro as NanoBananaProText2Image } from './NanoBananaPro.text2image';
|
|
2
|
+
import { NanoBananaProImage2Image } from './NanoBananaPro.image2image';
|
|
3
|
+
import { Flux2Pro as Flux2ProText2Image } from './Flux2Pro.text2image';
|
|
4
|
+
import { Flux2ProImage2Image } from './Flux2Pro.image2image';
|
|
5
|
+
import { Flux2 as Flux2Text2Image } from './Flux2.text2image';
|
|
6
|
+
import { Flux2Image2Image } from './Flux2.image2image';
|
|
7
|
+
import { Flux2Flex as Flux2FlexText2Image } from './Flux2Flex.text2image';
|
|
8
|
+
import { Flux2FlexImage2Image } from './Flux2Flex.image2image';
|
|
9
|
+
import { OpenAIImageText2Image } from './OpenAIImage.text2image';
|
|
10
|
+
import { OpenAIImageImage2Image } from './OpenAIImage.image2image';
|
|
11
|
+
import { Seedream45 as Seedream45Text2Image } from './Seedream45.text2image';
|
|
12
|
+
import { Seedream45Image2Image } from './Seedream45.image2image';
|
|
13
|
+
import { Gemini3ProText2Image } from './Gemini3Pro.text2image';
|
|
14
|
+
import { Gemini3ProImage2Image } from './Gemini3Pro.image2image';
|
|
15
|
+
declare const EachLabs: {
|
|
16
|
+
NanoBananaPro: {
|
|
17
|
+
Text2Image: typeof NanoBananaProText2Image;
|
|
18
|
+
Image2Image: typeof NanoBananaProImage2Image;
|
|
19
|
+
};
|
|
20
|
+
Flux2Pro: {
|
|
21
|
+
Text2Image: typeof Flux2ProText2Image;
|
|
22
|
+
Image2Image: typeof Flux2ProImage2Image;
|
|
23
|
+
};
|
|
24
|
+
Flux2: {
|
|
25
|
+
Text2Image: typeof Flux2Text2Image;
|
|
26
|
+
Image2Image: typeof Flux2Image2Image;
|
|
27
|
+
};
|
|
28
|
+
Flux2Flex: {
|
|
29
|
+
Text2Image: typeof Flux2FlexText2Image;
|
|
30
|
+
Image2Image: typeof Flux2FlexImage2Image;
|
|
31
|
+
};
|
|
32
|
+
OpenAIGptImage: {
|
|
33
|
+
Text2Image: typeof OpenAIImageText2Image;
|
|
34
|
+
Image2Image: typeof OpenAIImageImage2Image;
|
|
35
|
+
};
|
|
36
|
+
Seedream45: {
|
|
37
|
+
Text2Image: typeof Seedream45Text2Image;
|
|
38
|
+
Image2Image: typeof Seedream45Image2Image;
|
|
39
|
+
};
|
|
40
|
+
Gemini3Pro: {
|
|
41
|
+
Text2Image: typeof Gemini3ProText2Image;
|
|
42
|
+
Image2Image: typeof Gemini3ProImage2Image;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export default EachLabs;
|
|
46
|
+
export type { EachLabsProviderConfiguration } from './types';
|