@imgly/plugin-ai-image-generation-web 0.1.10 → 0.2.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.
- package/CHANGELOG.md +30 -0
- package/README.md +327 -85
- package/dist/constants.d.ts +5 -0
- package/dist/fal-ai/FluxProKontextEdit.d.ts +11 -0
- package/dist/fal-ai/FluxProKontextMaxEdit.d.ts +11 -0
- package/dist/fal-ai/Recraft20b.constants.d.ts +30 -0
- package/dist/fal-ai/Recraft20b.d.ts +34 -0
- package/dist/fal-ai/createImageProvider.d.ts +8 -2
- package/dist/fal-ai/index.d.ts +6 -0
- package/dist/fal-ai/index.mjs +22 -9
- package/dist/fal-ai/index.mjs.map +4 -4
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +25 -7
- package/dist/index.mjs.map +4 -4
- package/dist/open-ai/index.mjs +6 -6
- package/dist/open-ai/index.mjs.map +4 -4
- package/dist/open-ai/quickActions/ChangeStyleLibrary.d.ts +39 -0
- package/dist/plugin.d.ts +3 -2
- package/dist/quickActions/ArtistTransfer.d.ts +31 -0
- package/dist/quickActions/CombineImages.d.ts +32 -0
- package/dist/quickActions/CreateVariant.d.ts +31 -0
- package/dist/quickActions/EditImage.d.ts +31 -0
- package/dist/quickActions/RemixPage.d.ts +31 -0
- package/dist/quickActions/RemixPageWithPrompt.d.ts +31 -0
- package/dist/quickActions/StyleTransfer.d.ts +31 -0
- package/dist/quickActions/SwapBackground.d.ts +31 -0
- package/dist/quickActions/types.d.ts +6 -0
- package/dist/types.d.ts +56 -25
- package/package.json +2 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function getImageDimensions(id: string): {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
export type StyleId = 'any' | 'realistic_image' | 'digital_illustration' | 'vector_illustration' | 'realistic_image/b_and_w' | 'realistic_image/hard_flash' | 'realistic_image/hdr' | 'realistic_image/natural_light' | 'realistic_image/studio_portrait' | 'realistic_image/enterprise' | 'realistic_image/motion_blur' | 'realistic_image/evening_light' | 'realistic_image/faded_nostalgia' | 'realistic_image/forest_life' | 'realistic_image/mystic_naturalism' | 'realistic_image/natural_tones' | 'realistic_image/organic_calm' | 'realistic_image/real_life_glow' | 'realistic_image/retro_realism' | 'realistic_image/retro_snapshot' | 'realistic_image/urban_drama' | 'realistic_image/village_realism' | 'realistic_image/warm_folk' | 'digital_illustration/pixel_art' | 'digital_illustration/hand_drawn' | 'digital_illustration/grain' | 'digital_illustration/infantile_sketch' | 'digital_illustration/2d_art_poster' | 'digital_illustration/handmade_3d' | 'digital_illustration/hand_drawn_outline' | 'digital_illustration/engraving_color' | 'digital_illustration/2d_art_poster_2' | 'digital_illustration/antiquarian' | 'digital_illustration/bold_fantasy' | 'digital_illustration/child_book' | 'digital_illustration/child_books' | 'digital_illustration/cover' | 'digital_illustration/crosshatch' | 'digital_illustration/digital_engraving' | 'digital_illustration/expressionism' | 'digital_illustration/freehand_details' | 'digital_illustration/grain_20' | 'digital_illustration/graphic_intensity' | 'digital_illustration/hard_comics' | 'digital_illustration/long_shadow' | 'digital_illustration/modern_folk' | 'digital_illustration/multicolor' | 'digital_illustration/neon_calm' | 'digital_illustration/noir' | 'digital_illustration/nostalgic_pastel' | 'digital_illustration/outline_details' | 'digital_illustration/pastel_gradient' | 'digital_illustration/pastel_sketch' | 'digital_illustration/pop_art' | 'digital_illustration/pop_renaissance' | 'digital_illustration/street_art' | 'digital_illustration/tablet_sketch' | 'digital_illustration/urban_glow' | 'digital_illustration/urban_sketching' | 'digital_illustration/vanilla_dreams' | 'digital_illustration/young_adult_book' | 'digital_illustration/young_adult_book_2' | 'vector_illustration/bold_stroke' | 'vector_illustration/chemistry' | 'vector_illustration/colored_stencil' | 'vector_illustration/contour_pop_art' | 'vector_illustration/cosmics' | 'vector_illustration/cutout' | 'vector_illustration/depressive' | 'vector_illustration/editorial' | 'vector_illustration/emotional_flat' | 'vector_illustration/infographical' | 'vector_illustration/marker_outline' | 'vector_illustration/mosaic' | 'vector_illustration/naivector' | 'vector_illustration/roundish_flat' | 'vector_illustration/segmented_colors' | 'vector_illustration/sharp_contrast' | 'vector_illustration/thin' | 'vector_illustration/vector_photo' | 'vector_illustration/vivid_shapes' | 'vector_illustration/engraving' | 'vector_illustration/line_art' | 'vector_illustration/line_circuit' | 'vector_illustration/linocut' | 'icon/broken_line' | 'icon/colored_outline' | 'icon/colored_shapes' | 'icon/colored_shapes_gradient' | 'icon/doodle_fill' | 'icon/doodle_offset_fill' | 'icon/offset_fill' | 'icon/outline' | 'icon/outline_gradient' | 'icon/uneven_fill';
|
|
6
|
+
export declare const STYLES_IMAGE: {
|
|
7
|
+
id: StyleId;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
export declare const STYLE_IMAGE_DEFAULT: {
|
|
11
|
+
id: StyleId;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const STYLES_VECTOR: {
|
|
15
|
+
id: StyleId;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const STYLE_VECTOR_DEFAULT: {
|
|
19
|
+
id: StyleId;
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const STYLES_ICON: {
|
|
23
|
+
id: StyleId;
|
|
24
|
+
label: string;
|
|
25
|
+
}[];
|
|
26
|
+
export declare const STYLE_ICON_DEFAULT: {
|
|
27
|
+
id: StyleId;
|
|
28
|
+
label: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function getStyleThumbnail(id: StyleId, baseURL: string): string | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CommonProviderConfiguration, type Provider } from '@imgly/plugin-ai-generation-web';
|
|
2
|
+
import CreativeEditorSDK from '@cesdk/cesdk-js';
|
|
3
|
+
import { type StyleId } from './Recraft20b.constants';
|
|
4
|
+
type Recraft20bOutput = {
|
|
5
|
+
kind: 'image';
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
type Recraft20bInput = {
|
|
9
|
+
prompt: string;
|
|
10
|
+
image_size?: 'square_hd' | 'square' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9' | {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
style?: StyleId;
|
|
15
|
+
colors?: Array<{
|
|
16
|
+
r: number;
|
|
17
|
+
g: number;
|
|
18
|
+
b: number;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
interface ProviderConfiguration extends CommonProviderConfiguration<Recraft20bInput, Recraft20bOutput> {
|
|
22
|
+
/**
|
|
23
|
+
* Base URL used for the UI assets used in the plugin.
|
|
24
|
+
*
|
|
25
|
+
* By default, we load the assets from the IMG.LY CDN You can copy the assets.
|
|
26
|
+
* from the `/assets` folder to your own server and set the base URL to your server.
|
|
27
|
+
*/
|
|
28
|
+
baseURL?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function Recraft20b(config: ProviderConfiguration): (context: {
|
|
31
|
+
cesdk: CreativeEditorSDK;
|
|
32
|
+
}) => Promise<Provider<'image', Recraft20bInput, Recraft20bOutput>>;
|
|
33
|
+
declare function getProvider(cesdk: CreativeEditorSDK, config: ProviderConfiguration): Provider<'image', Recraft20bInput, Recraft20bOutput>;
|
|
34
|
+
export default getProvider;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { type OpenAPIV3 } from 'openapi-types';
|
|
2
2
|
import CreativeEditorSDK, { CreativeEngine } from '@cesdk/cesdk-js';
|
|
3
|
-
import { ImageOutput, RenderCustomProperty, GetBlockInput, Provider,
|
|
3
|
+
import { ImageOutput, RenderCustomProperty, GetBlockInput, Provider, Middleware } from '@imgly/plugin-ai-generation-web';
|
|
4
|
+
import { ImageQuickActionSupportMap } from '../types';
|
|
4
5
|
type ImageProviderConfiguration = {
|
|
5
6
|
proxyUrl: string;
|
|
6
7
|
debug?: boolean;
|
|
8
|
+
middlewares?: Middleware<any, any>[];
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `middlewares` instead.
|
|
11
|
+
*/
|
|
12
|
+
middleware?: Middleware<any, any>[];
|
|
7
13
|
};
|
|
8
14
|
/**
|
|
9
15
|
* Creates a base provider from schema. This should work out of the box
|
|
@@ -20,7 +26,7 @@ declare function createImageProvider<I extends Record<string, any>>(options: {
|
|
|
20
26
|
engine: CreativeEngine;
|
|
21
27
|
}) => void;
|
|
22
28
|
renderCustomProperty?: RenderCustomProperty;
|
|
23
|
-
|
|
29
|
+
supportedQuickActions?: ImageQuickActionSupportMap<I>;
|
|
24
30
|
getBlockInput?: GetBlockInput<'image', I>;
|
|
25
31
|
getImageSize?: (input: I) => {
|
|
26
32
|
width: number;
|
package/dist/fal-ai/index.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { RecraftV3 } from './RecraftV3';
|
|
2
|
+
import { Recraft20b } from './Recraft20b';
|
|
2
3
|
import { GeminiFlashEdit } from './GeminiFlashEdit';
|
|
4
|
+
import { FluxProKontextEdit } from './FluxProKontextEdit';
|
|
5
|
+
import { FluxProKontextMaxEdit } from './FluxProKontextMaxEdit';
|
|
3
6
|
declare const FalAi: {
|
|
4
7
|
RecraftV3: typeof RecraftV3;
|
|
8
|
+
Recraft20b: typeof Recraft20b;
|
|
5
9
|
GeminiFlashEdit: typeof GeminiFlashEdit;
|
|
10
|
+
FluxProKontextEdit: typeof FluxProKontextEdit;
|
|
11
|
+
FluxProKontextMaxEdit: typeof FluxProKontextMaxEdit;
|
|
6
12
|
};
|
|
7
13
|
export default FalAi;
|