@imgly/plugin-ai-sticker-generation-web 0.2.17 → 1.69.0-nightly.20260130

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 CHANGED
@@ -1,232 +1,3 @@
1
- # Changelog - AI Plugins
1
+ # Changelog
2
2
 
3
- ## [Unreleased]
4
-
5
- ## [0.2.17] - 2026-01-26
6
-
7
- ### Fixed
8
-
9
- - [image-generation] **Runware NanoBanana2Pro Dimensions**: Fixed API errors when using non-square aspect ratios (16:9, 9:16, 4:3, 3:4) with Nano Banana 2 Pro provider. The model requires specific dimension combinations (e.g., 1376×768 for 16:9) that differ from the generic aspect ratio map.
10
- - [image-generation] **Runware Seedream 4.0 Dimensions**: Fixed API errors when using non-square aspect ratios with Seedream 4.0 provider. At 1K resolution, only 1:1 is supported; now using 2K dimensions for all aspect ratios to ensure compatibility.
11
-
12
- ### Improvements
13
-
14
- - [image-generation] **Runware Async Delivery**: Switched from synchronous requests to async delivery with polling to avoid timeouts on slower image generation models.
15
- - [image-generation] **Runware NanoBanana2Pro I2I**: Added `resolution: '2k'` parameter to image-to-image generation for automatic aspect ratio detection from reference images.
16
-
17
- ## [0.2.16] - 2026-01-16
18
-
19
- ### New Features
20
-
21
- - [all] **Translatable Action Labels**: AI plugin action labels now support full i18n through `labelKey` property, enabling dynamic translation resolution based on the current locale.
22
- - [generation-web] **setDefaultTranslations Utility**: Added `setDefaultTranslations()` function that only sets translation keys that don't already exist, allowing integrators to customize translations before plugins load without being overwritten.
23
- - [all] **External Translation Files**: Plugin translations are now loaded from external `translations.json` files, making it easier to review and customize available translation keys.
24
-
25
- ### Improvements
26
-
27
- - [all] **Translation Override Pattern**: All AI plugins now use `setDefaultTranslations()` instead of `setTranslations()`, ensuring integrator-provided translations take priority over plugin defaults.
28
- - [apps-web] **Dynamic Card Labels**: AI Apps panel now resolves card labels dynamically using `labelKey` from action metadata, enabling proper i18n for app cards.
29
-
30
- ### Documentation
31
-
32
- - [all] Added comprehensive i18n documentation to README files explaining how to customize translations before plugin initialization.
33
-
34
- ## [0.2.15] - 2026-01-12
35
-
36
- ### New Features
37
-
38
- - [all] **EachLabs Partner Integration**: Added EachLabs as a new AI provider service with unified API access to multiple image and video generation models.
39
- - **Image Generation**: Flux 2 Pro, Flux 2, Flux 2 Flex, Nano Banana Pro, OpenAI GPT Image, Seedream v4.5, Gemini 3 Pro (all with text-to-image and image-to-image variants)
40
- - **Video Generation**: Kling v2.6 Pro, Kling O1, Veo 3.1 (text-to-video and image-to-video variants)
41
-
42
- ## [0.2.14] - 2025-12-15
43
-
44
- ## [0.2.13] - 2025-12-15
45
-
46
- ### New Features
47
-
48
- - [all] **Runware Partner Integration**: Added Runware as a new AI provider service, offering access to multiple image and video generation models through a unified API. Runware provides a single endpoint for accessing various AI models with consistent configuration.
49
- - **Image Generation**: FLUX.2 [dev], FLUX.2 [pro], FLUX.2 [flex], Seedream 4.0, Seedream 4.5, Nano Banana 2 Pro, GPT Image 1, GPT Image 1 Mini (all with text-to-image and image-to-image variants)
50
- - **Video Generation**: Google Veo 3.1, Veo 3.1 Fast, OpenAI Sora 2, Sora 2 Pro (all with text-to-video and image-to-video variants)
51
-
52
- ## [0.2.12] - 2025-11-21
53
-
54
- ## [0.2.11] - 2025-11-21
55
-
56
- ### New Features
57
-
58
- - [generation-web] **Input Placeholder Customization**: Added support for customizing placeholder text in input fields (e.g., prompt textarea) through the i18n translation system. Placeholders follow the same priority chain as labels:
59
- 1. Provider-specific: `ly.img.plugin-ai-{kind}-generation-web.{provider.id}.property.{field}.placeholder`
60
- 2. Global: `ly.img.plugin-ai-generation-web.property.{field}.placeholder`
61
- 3. Provider defaults: `ly.img.plugin-ai-{kind}-generation-web.{provider.id}.defaults.property.{field}.placeholder`
62
- 4. Global defaults: `ly.img.plugin-ai-generation-web.defaults.property.{field}.placeholder`
63
- - [image-generation] **Gemini Provider Placeholders**: Added example placeholder text to Gemini providers (GeminiFlash25 and Gemini25FlashImageEdit) demonstrating provider-specific placeholder customization
64
- - [image-generation] **NanoBananaPro Provider**: Added NanoBananaPro text-to-image provider via fal.ai, an enhanced version of NanoBanana with advanced configuration options including 10 aspect ratio presets (1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21, 2.4:1), resolution multipliers (1K, 2K, 4K for standard/high/ultra quality), dynamic dimension calculation based on aspect ratio and resolution, and remixPageWithPrompt quick action support
65
- - [image-generation] **NanoBananaProEdit Provider**: Added NanoBananaProEdit image-to-image provider via fal.ai for professional-grade image editing with text prompts, supporting resolution control (1K/2K/4K), all standard quick actions (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages with up to 10 images, remixPage, remixPageWithPrompt), and automatic dimension preservation from source images
66
-
67
- ## [0.2.10] - 2025-10-22
68
-
69
- ### New Features
70
-
71
- - [video-generation] **Google Veo 3.1 Provider Suite**: Added comprehensive Google Veo 3.1 video generation providers via fal.ai, offering multiple models optimized for different use cases:
72
- - **Text-to-Video Providers**:
73
- - `Veo31TextToVideo`: Standard quality text-to-video with configurable aspect ratios (16:9, 9:16, 1:1), variable duration (4s, 6s, 8s), resolution options (720p, 1080p), and optional audio generation
74
- - `Veo31FastTextToVideo`: Faster and more cost-effective text-to-video variant with same capabilities as standard version
75
- - **Image-to-Video Providers**:
76
- - `Veo31ImageToVideo`: Standard quality image-to-video with auto aspect ratio detection, multiple preset options (16:9, 9:16, 1:1), resolution options (720p, 1080p), fixed 8-second duration, and optional audio generation
77
- - `Veo31FastImageToVideo`: Faster and more cost-effective image-to-video variant with same capabilities
78
- - **First-Last Frame Providers** (experimental dual-image transformation):
79
- - `Veo31FirstLastFrameToVideo`: Standard quality interpolation between two images (first and last frame)
80
- - `Veo31FastFirstLastFrameToVideo`: Faster variant with dual image input UI, multiple aspect ratios (16:9, 9:16, 1:1, 4:3, 3:4), resolution options (480p, 720p, 1080p), adjustable duration (2-8 seconds), optional prompt guidance, and optional audio generation
81
- - **Quick Action Support**: Added "Animate Between Images" quick action for creating smooth transitions between two selected images using the first-last-frame providers
82
-
83
- ## [0.2.9] - 2025-10-16
84
-
85
- ### New Features
86
-
87
- - [image-generation] **GeminiFlash25 Provider**: Added Google Gemini Flash 2.5 text-to-image provider via fal.ai with fast generation times, multiple aspect ratios (1:1, 3:4, 4:3, 9:16, 16:9), custom dimensions support, and multiple output formats (JPEG, PNG, WEBP)
88
- - [image-generation] **Gemini25FlashImageEdit Provider**: Added Google Gemini 2.5 Flash Image Edit provider via fal.ai for advanced image editing with multi-image support (1-10 images), comprehensive quick actions support (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages, remixPage, remixPageWithPrompt), text-based editing instructions, and fast processing times
89
-
90
- ### Improvements
91
-
92
- - [generation-web] **Middleware preventDefault() API**: Added `options.preventDefault()` method to suppress default UI feedback (notifications, block states, console logging) when handling errors in custom middleware
93
- - [all] **Internationalization Support**: All hardcoded strings across AI plugins have been removed and replaced with translation keys, enabling full localization support for plugin labels, actions, styles, and error messages
94
- - [all] **Translation Keys Available**: Added comprehensive translation keys for:
95
- - Panel and dock labels (AI Image, AI Video, AI Sticker, AI Voice, Sound Generation)
96
- - Action labels (Generate Image, Generate Video, Generate Sticker)
97
- - Style transfer options (None, Anime, Cyberpunk, Kodak 400, Watercolor, Dark Fantasy, Vaporwave, Vector Flat, 3D Animation, Ukiyo-e, Surreal, Steampunk, Night Bokeh, Pop Art)
98
- - Error messages and UI elements
99
- - [all] **Backwards Compatibility**: Translation system automatically detects CE.SDK version and gracefully falls back to English strings for CE.SDK versions < 1.59.0, ensuring no breaking changes for existing integrations
100
-
101
- ### Fixed
102
-
103
- - [generation-web] **Placeholder Block Error State**: Fixed placeholder blocks getting stuck in Pending state when generation fails or is aborted. Blocks are now properly destroyed when generation is aborted, or moved to Error state when generation fails, preventing perpetual loading spinners in the UI.
104
- - [generation-web] **Middleware Block Targeting**: Fixed middleware to correctly receive block IDs for placeholder blocks and quick action targets. Previously, middleware would fall back to `findAllSelected()` which could target incorrect blocks if the selection changed during generation. Now placeholder blocks created during panel generation and target blocks from quick actions are explicitly passed to middleware, ensuring operations like pending state, locking, and highlighting affect the correct blocks.
105
-
106
- ### Changed
107
-
108
- - [generation-web] **BlockIds Type Refinement**: Removed unused `| null` type from `blockIds` parameter in `GenerationOptions` and `Generate` function signature. The `null` value was documented but never implemented or used. Use an empty array `[]` instead of `null` to explicitly target no blocks.
109
-
110
- ## [0.2.8] - 2025-09-29
111
-
112
- ### New Features
113
-
114
- - [image-generation] **SeedreamV4 Provider**: Added ByteDance Seedream 4.0 text-to-image provider via fal.ai for high-quality image generation with multiple size presets (square HD 2048×2048, square 1024×1024, portrait/landscape variants), custom dimensions support (1024-4096 pixels), and safety checker enabled by default
115
- - [image-generation] **SeedreamV4Edit Provider**: Added ByteDance Seedream 4.0 image-to-image provider via fal.ai for advanced image editing with unified generation/editing architecture, support for multiple input images (up to 10), and full canvas quick actions support (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages, remixPage, remixPageWithPrompt)
116
-
117
- ### Fixed
118
-
119
- - [sticker-generation] **Fixed Input Types Not Enabled**: Fixed an issue where the sticker generation panel would show "No input types are enabled" error by properly enabling the `fromText` and `fromImage` feature flags during plugin initialization
120
-
121
- ## [0.2.7] - 2025-09-26
122
-
123
- ### New Features
124
-
125
- - [image-generation] **QwenImageEdit Provider**: Added Qwen image editing provider via fal.ai for advanced image-to-image transformation with text prompts, supporting all standard quick actions
126
- - [video-generation] **MinimaxHailuo02StandardImageToVideo Provider**: Added Minimax Hailuo-02 Standard image-to-video provider via fal.ai for transforming still images into videos with selectable resolutions (512P: 912×512, 768P: 1280×720) and adjustable durations (6 or 10 seconds)
127
- - [video-generation] **ByteDance Seedance v1 Pro Providers**: Added ByteDance Seedance v1 Pro text-to-video and image-to-video providers via fal.ai with:
128
- - Text-to-video generation from text descriptions with customizable aspect ratios
129
- - Image-to-video transformation with dynamic motion generation from still images
130
- - Multiple aspect ratio options (21:9, 16:9, 4:3, 1:1, 3:4, 9:16, or auto from image for i2v)
131
- - Adjustable duration (3-12 seconds, default 5)
132
- - Resolution options (480p, 720p, 1080p)
133
- - Proper aspect ratio handling in placeholder blocks based on user selection
134
-
135
- - [all] **Property Configuration System**: Providers can now define default values for their properties. Defaults can be static values or dynamic based on context (language, design state, etc.)
136
-
137
- - [image-generation] **Recraft Provider Defaults**: Recraft providers (V3 and 20b) now support configurable default values for all properties, including dynamic style defaults based on the selected style type
138
-
139
- ## [0.2.6] - 2025-09-09
140
-
141
- ### New Features
142
-
143
- - [all] **Feature API Integration**: Added comprehensive Feature API support across all AI plugins to control visibility and availability of features through feature flags. Core features include `providerSelect`, `quickAction`, `quickAction.providerSelect`, `fromText`, and `fromImage` flags.
144
- - [all] **Quick Action Feature Flags**: Each quick action now automatically registers and respects its own feature flag (e.g., `ly.img.plugin-ai-image-generation-web.quickAction.editImage`), allowing fine-grained control over which quick actions are available to users.
145
- - [image-generation] **Provider Style Group Control**: Added Feature API support for Recraft providers to control style group visibility. RecraftV3 supports `style.image` and `style.vector` flags, while Recraft20b adds `style.icon` flag for controlling icon style availability.
146
- - [all] **Provider Selection Feature Flags**: Added support for controlling provider selection UI in both panels (`providerSelect`) and quick actions (`quickAction.providerSelect`), with proper handling when multiple providers are configured.
147
-
148
- ## [0.2.5] - 2025-09-03
149
-
150
- ### New Features
151
-
152
- - [image-generation] **NanoBanana Provider**: Added NanoBanana text-to-image provider via fal.ai with fast generation times, 1024×1024 resolution, support for multiple output formats (JPEG, PNG), configurable number of images (1-4), and remixPageWithPrompt quick action
153
- - [image-generation] **NanoBananaEdit Provider**: Added NanoBananaEdit image-to-image provider via fal.ai for editing existing images with text prompts, supporting all standard quick actions (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages with up to 10 images, remixPage, remixPageWithPrompt)
154
- - [all] **AI Style Asset Library Translations**: AI style presets in asset libraries now automatically use localized names and descriptions from provider translation files, eliminating the need for manual translation configuration
155
-
156
- ### Bug Fixes
157
-
158
- - [all] **fal.ai Provider Configuration**: Fixed singleton configuration conflict when using multiple fal.ai providers with different proxy URLs. Each provider now maintains its own client instance instead of overwriting a global configuration
159
- - [video-generation] **Missing Dependency**: Added missing `@fal-ai/client` dependency to plugin-ai-video-generation-web package.json to ensure the package works correctly when installed independently
160
-
161
- ## [0.2.4] - 2025-08-07
162
-
163
- ### New Features
164
-
165
- - [all] **Provider Label Translations**: Added support for provider label translations
166
- - [all] **Extended Provider Configuration**: Added support for `history` and `supportedQuickActions` configuration fields in `CommonProviderConfiguration`, allowing customers to:
167
- - Override provider's default history asset source (`history` field) - can be set to `false` to disable history, `'@imgly/local'` for temporary storage, `'@imgly/indexedDB'` for persistent browser storage, or any custom asset source ID
168
- - Configure supported quick actions (`supportedQuickActions` field) - can disable quick actions by setting to `false`/`null`, keep defaults with `true`, or override with custom mappings and configurations
169
- - Both fields are optional and maintain backward compatibility with existing provider configurations
170
- - [generation-web] **Utility Function**: Added `mergeQuickActionsConfig` utility function for merging provider defaults with user configuration overrides, exported from `@imgly/plugin-ai-generation-web` with comprehensive Jest test coverage
171
-
172
- ## [0.2.3] - 2025-07-23
173
-
174
- - [all] **Automatic History Asset Library Entries**: Composite history asset sources now automatically have corresponding asset library entries created with the same IDs (e.g., `ly.img.ai.image-generation.history`)
175
- - [all] **Provider Selection in Expanded Quick Actions**: When a quick action is expanded, users can now switch between all providers that support that specific quick action, enhancing flexibility in provider selection
176
- - [all] **Quick Action Can Disable Lock**: Some quick actions can now decide to not lock the block when operating on a block. Examples are `CreateVariant` and `CombineImages`.
177
- - [image-generation] **Ideogram V3**: Added support for Ideogram V3 provider for image generation, which supports text-to-image and image-to-image generation
178
-
179
- ## [0.2.2] - 2025-07-16
180
-
181
- - [ai-apps] Fix issue with undefined `cesdk` instance
182
-
183
- ## [0.2.1] - 2025-07-15
184
-
185
- - [ai-apps] Fix issue where AI apps panel displayed empty content when no provider app was available
186
- - [ai-apps] Maintain backwards compatibility by registering legacy AI apps ID, alongside new `ly.img.ai.apps` panel ID
187
-
188
- ## [0.2.0] - 2025-07-15
189
-
190
- ### Breaking Changes
191
-
192
- - [all] **Provider Initialization**: `initProvider` is replaced with `initializeProviders` and `initializeProvider` with a different signature
193
- - [all] **Quick Actions Structure**: `provider.input.quickctions.actions` replaced with `provider.input.quickActions.supported`
194
- - [all] **History Asset Sources**: Combined history asset source is now not added to the default asset libraries anymore. Add the following sources to any library entry (default or not):
195
- - Image Generation History: `ly.img.ai.image-generation.history`
196
- - Video Generation History: `ly.img.ai.video-generation.history`
197
- - Audio Generation History: `ly.img.ai.audio-generation.history`
198
- - Sticker Generation History: `ly.img.ai.sticker-generation.history`
199
- - [all] **ID Format Standardization**: All `ly.img.ai/` prefixed IDs changed to use dot notation `ly.img.ai.` for consistency
200
- - Panel IDs: `ly.img.ai/apps` → `ly.img.ai.apps`, `ly.img.ai/image-generation` → `ly.img.ai.image-generation`
201
- - Dock IDs: `ly.img.ai/apps.dock` → `ly.img.ai.apps.dock`
202
-
203
- ### New Features
204
-
205
- - [all] **Multiple Providers Support**: All plugin packages now support arrays of providers with automatic selection UI
206
- - [image-generation] **Recraft20b Provider**: Added new Recraft20b (v2) provider via fal.ai with support for icon styles including `broken_line`, `colored_outline`, `colored_shapes`, and more
207
- - [sticker-generation] **New Sticker Generation Plugin**: Added `@imgly/plugin-ai-sticker-generation-web` plugin for AI-powered sticker generation with support for text-to-sticker generation using Recraft20b provider with icon styles
208
- - [image-generation] **Flux Pro Kontext Provider**: Added Flux Pro Kontext provider for image editing with style transfer and artist style options
209
- - [image-generation] **Flux Pro Kontext Max Provider**: Added Flux Pro Kontext Max provider for enhanced image editing capabilities
210
- - [video-generation] **Veo3 Provider**: Added Veo3 text-to-video provider via fal.ai with support for 16:9, 9:16, and 1:1 aspect ratios and 8-second duration
211
- - [video-generation] **Kling Video V2.1 Master Providers**: Added Kling Video V2.1 Master providers for both text-to-video and image-to-video generation with configurable duration (5s/10s) and aspect ratios
212
- - [text-generation] **Model Selection**: OpenAI and Anthropic providers now support configurable model selection through the `model` parameter
213
-
214
- ### Deprecated Features
215
-
216
- - [all] **Middleware Configuration**: The `middleware` property in provider configurations is deprecated. Use `middlewares` instead. The old property will continue to work for now.
217
-
218
- ## [0.1.10] - 2025-06-20
219
-
220
- - [all] Fix issue with GPT provider when using text provider
221
-
222
- ## [0.1.9] - 2025-06-05
223
-
224
- - [all] Add support for custom headers
225
-
226
- ## [0.1.8] - 2025-05-26
227
-
228
- - [ai-apps] Handle `sceneMode` change in upcoming CE.SDK version 1.52.0
229
-
230
- ## [0.1.0] - 2025-04-17
231
-
232
- - [all] Initial release
3
+ See the main [CE.SDK CHANGELOG](https://img.ly/docs/cesdk/changelog/) for all plugin changes.
package/README.md CHANGED
@@ -1,360 +1,9 @@
1
- # IMG.LY AI Sticker Generation for Web
1
+ # @imgly/plugin-ai-sticker-generation-web
2
2
 
3
- A plugin for integrating AI sticker generation capabilities into CreativeEditor SDK.
3
+ AI sticker generation plugin for the CE.SDK editor
4
4
 
5
- ## Overview
6
-
7
- The `@imgly/plugin-ai-sticker-generation-web` package enables users to generate stickers using AI directly within CreativeEditor SDK. This plugin leverages the [fal.ai](https://fal.ai) platform to provide high-quality sticker generation from text prompts using optimized icon styles.
8
-
9
- Features include:
10
- - Text-to-sticker generation
11
- - Icon-style sticker generation optimized for transparency
12
- - Various icon styles (broken line, colored outline, colored shapes, etc.)
13
- - Custom dimensions support
14
- - Automatic history tracking
15
- - Seamless integration with CreativeEditor SDK
16
-
17
- ## Installation
18
-
19
- ```bash
20
- npm install @imgly/plugin-ai-sticker-generation-web
21
- ```
22
-
23
- ## Usage
24
-
25
- ### Basic Configuration
26
-
27
- To use the plugin, import it and configure it with your preferred providers:
28
-
29
- #### Single Provider Configuration
30
-
31
- ```typescript
32
- import CreativeEditorSDK from '@cesdk/cesdk-js';
33
- import StickerGeneration from '@imgly/plugin-ai-sticker-generation-web';
34
- import FalAiSticker from '@imgly/plugin-ai-sticker-generation-web/fal-ai';
35
-
36
- // Initialize CreativeEditor SDK
37
- CreativeEditorSDK.create(domElement, {
38
- license: 'your-license-key',
39
- // Other configuration options...
40
- }).then(async (cesdk) => {
41
- // Add the sticker generation plugin with fal.ai provider
42
- cesdk.addPlugin(
43
- StickerGeneration({
44
- // Text-to-sticker provider
45
- text2sticker: FalAiSticker.Recraft20b({
46
- proxyUrl: 'http://your-proxy-server.com/api/proxy',
47
- headers: {
48
- 'x-custom-header': 'value',
49
- 'x-client-version': '1.0.0'
50
- },
51
- // Optional: Configure default property values
52
- properties: {
53
- style: { default: 'broken_line' }, // Default icon style for stickers
54
- image_size: { default: 'square' }, // Default size
55
- n_colors: { default: 2 } // Default color count
56
- }
57
- }),
58
-
59
- // Optional configuration
60
- debug: false,
61
- dryRun: false
62
- })
63
- );
64
- });
65
- ```
66
-
67
- #### Multiple Providers Configuration
68
-
69
- You can configure multiple providers for text-to-sticker generation, and users will see a selection box to choose between them:
70
-
71
- ```typescript
72
- import CreativeEditorSDK from '@cesdk/cesdk-js';
73
- import StickerGeneration from '@imgly/plugin-ai-sticker-generation-web';
74
- import FalAiSticker from '@imgly/plugin-ai-sticker-generation-web/fal-ai';
75
-
76
- // Initialize CreativeEditor SDK
77
- CreativeEditorSDK.create(domElement, {
78
- license: 'your-license-key',
79
- // Other configuration options...
80
- }).then(async (cesdk) => {
81
- // Add the sticker generation plugin with multiple providers
82
- cesdk.addPlugin(
83
- StickerGeneration({
84
- // Multiple text-to-sticker providers
85
- text2sticker: [
86
- FalAiSticker.Recraft20b({
87
- proxyUrl: 'http://your-proxy-server.com/api/proxy',
88
- headers: {
89
- 'x-custom-header': 'value',
90
- 'x-client-version': '1.0.0'
91
- }
92
- })
93
- // Add more providers as they become available
94
- ],
95
-
96
- // Optional configuration
97
- debug: false,
98
- dryRun: false
99
- })
100
- );
101
- });
102
- ```
103
-
104
- ### Providers
105
-
106
- The plugin comes with pre-configured providers for fal.ai models:
107
-
108
- #### Recraft20b (Text-to-Sticker)
109
-
110
- A specialized text-to-sticker model from fal.ai with icon style support optimized for sticker generation:
111
-
112
- ```typescript
113
- text2sticker: FalAiSticker.Recraft20b({
114
- proxyUrl: 'http://your-proxy-server.com/api/proxy',
115
- headers: {
116
- 'x-custom-header': 'value',
117
- 'x-client-version': '1.0.0'
118
- }
119
- })
120
- ```
121
-
122
- Key features:
123
- - **Icon styles optimized for stickers**: broken_line, colored_outline, colored_shapes, doodle_fill, and more
124
- - Various image size presets (square, landscape, portrait)
125
- - Custom dimensions support
126
- - Transparent background support
127
- - Cost-effective sticker generation
128
- - Custom headers support for API requests
129
-
130
- Available icon styles:
131
- - `broken_line`: Clean broken line style
132
- - `colored_outline`: Colored outline style
133
- - `colored_shapes`: Filled colored shapes
134
- - `colored_shapes_gradient`: Gradient filled shapes
135
- - `doodle_fill`: Doodle-style fill
136
- - `doodle_offset_fill`: Offset doodle fill
137
- - `offset_fill`: Offset fill style
138
- - `outline`: Simple outline style
139
- - `outline_gradient`: Gradient outline
140
- - `uneven_fill`: Uneven fill style
141
-
142
- ### Configuration Options
143
-
144
- The plugin accepts the following configuration options:
145
-
146
- | Option | Type | Description | Default |
147
- |--------|------|-------------|---------|
148
- | `text2sticker` | Provider \| Provider[] | Provider(s) for text-to-sticker generation. When multiple providers are provided, users can select between them | undefined |
149
- | `debug` | boolean | Enable debug logging | false |
150
- | `dryRun` | boolean | Simulate generation without API calls | false |
151
- | `middleware` | Function[] | Array of middleware functions to extend the generation process | undefined |
152
-
153
- ### Middleware Configuration
154
-
155
- The `middleware` option allows you to add pre-processing and post-processing capabilities to the generation process:
156
-
157
- ```typescript
158
- import StickerGeneration from '@imgly/plugin-ai-sticker-generation-web';
159
- import FalAiSticker from '@imgly/plugin-ai-sticker-generation-web/fal-ai';
160
- import { loggingMiddleware, rateLimitMiddleware } from '@imgly/plugin-ai-generation-web';
161
-
162
- // Create middleware functions
163
- const logging = loggingMiddleware();
164
- const rateLimit = rateLimitMiddleware({
165
- maxRequests: 10,
166
- timeWindowMs: 60000, // 1 minute
167
- onRateLimitExceeded: (input, options, info) => {
168
- console.log(`Rate limit exceeded: ${info.currentCount}/${info.maxRequests}`);
169
- return false; // Reject request
170
- }
171
- });
172
-
173
- // Apply middleware to plugin
174
- cesdk.addPlugin(
175
- StickerGeneration({
176
- text2sticker: FalAiSticker.Recraft20b({
177
- proxyUrl: 'http://your-proxy-server.com/api/proxy'
178
- }),
179
- middleware: [logging, rateLimit] // Apply middleware in order
180
- })
181
- );
182
- ```
183
-
184
- Built-in middleware options:
185
-
186
- - **loggingMiddleware**: Logs generation requests and responses
187
- - **rateLimitMiddleware**: Limits the number of generation requests in a time window
188
-
189
- #### Preventing Default Feedback
190
-
191
- Middleware can suppress default UI feedback behaviors using `options.preventDefault()`:
192
-
193
- ```typescript
194
- const customErrorMiddleware = async (input, options, next) => {
195
- try {
196
- return await next(input, options);
197
- } catch (error) {
198
- // Prevent default error notification
199
- options.preventDefault();
200
-
201
- // Show custom error notification
202
- options.cesdk?.ui.showNotification({
203
- type: 'error',
204
- message: `Sticker generation failed: ${error.message}`,
205
- action: {
206
- label: 'Try Again',
207
- onClick: () => {/* retry logic */}
208
- }
209
- });
210
-
211
- throw error;
212
- }
213
- };
214
- ```
215
-
216
- **What gets prevented:**
217
- - Error/success notifications
218
- - Block error state
219
- - Console error logging
220
-
221
- **What is NOT prevented:**
222
- - Pending → Ready transition (loading spinner always stops)
223
-
224
- For more details, see the [@imgly/plugin-ai-generation-web documentation](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web#preventing-default-feedback).
225
-
226
- ### Using a Proxy
227
-
228
- For security reasons, it's recommended to use a proxy server to handle API requests to fal.ai. The proxy URL is required when configuring providers:
229
-
230
- ```typescript
231
- text2sticker: FalAiSticker.Recraft20b({
232
- proxyUrl: 'http://your-proxy-server.com/api/proxy',
233
- headers: {
234
- 'x-custom-header': 'value',
235
- 'x-client-version': '1.0.0'
236
- }
237
- })
238
- ```
239
-
240
- The `headers` option allows you to include custom HTTP headers in all API requests. This is useful for:
241
- - Adding custom client identification headers
242
- - Including version information
243
- - Passing through metadata required by your API
244
- - Adding correlation IDs for request tracing
245
-
246
- You'll need to implement a proxy server that forwards requests to fal.ai and handles authentication.
247
-
248
- ## API Reference
249
-
250
- ### Main Plugin
251
-
252
- ```typescript
253
- StickerGeneration(options: PluginConfiguration): EditorPlugin
254
- ```
255
-
256
- Creates and returns a plugin that can be added to CreativeEditor SDK.
257
-
258
- ### Plugin Configuration
259
-
260
- ```typescript
261
- interface PluginConfiguration {
262
- // Provider(s) for text-to-sticker generation
263
- text2sticker?: AiStickerProvider | AiStickerProvider[];
264
-
265
- // Enable debug logging
266
- debug?: boolean;
267
-
268
- // Skip actual API calls for testing
269
- dryRun?: boolean;
270
-
271
- // Extend the generation process
272
- middleware?: GenerationMiddleware;
273
- }
274
- ```
275
-
276
- ### Fal.ai Providers
277
-
278
- #### Recraft20b
279
-
280
- ```typescript
281
- FalAiSticker.Recraft20b(config: {
282
- proxyUrl: string;
283
- headers?: Record<string, string>;
284
- debug?: boolean;
285
- })
286
- ```
287
-
288
- ## UI Integration
289
-
290
- The plugin automatically registers the following UI components:
291
-
292
- 1. **Generation Panel**: A sidebar panel for text-to-sticker generation
293
- 2. **History Library**: Displays previously generated stickers
294
- 3. **Dock Component**: A button in the dock area to open the sticker generation panel
295
-
296
- ### Panel IDs
297
-
298
- - Main panel: `ly.img.ai.sticker-generation`
299
- - Provider-specific panels:
300
- - Recraft20b: `ly.img.ai.fal-ai/recraft/v2/text-to-sticker`
301
-
302
- ### Asset History
303
-
304
- Generated stickers are automatically stored in asset sources with the following IDs:
305
- - Recraft20b: `fal-ai/recraft/v2/text-to-sticker.history`
306
-
307
- ### Dock Integration
308
-
309
- The plugin automatically registers a dock component with a sparkle icon that opens the sticker generation panel. To customize the component's position in the dock, use the `setDockOrder` method:
310
-
311
- ```typescript
312
- // Add the AI Sticker component to the beginning of the dock
313
- cesdk.ui.setDockOrder([
314
- 'ly.img.ai.sticker-generation.dock',
315
- ...cesdk.ui.getDockOrder()
316
- ]);
317
-
318
- // Or add it at a specific position
319
- const currentOrder = cesdk.ui.getDockOrder();
320
- currentOrder.splice(2, 0, 'ly.img.ai.sticker-generation.dock');
321
- cesdk.ui.setDockOrder(currentOrder);
322
- ```
323
-
324
- ## Integration with AI Apps Plugin
325
-
326
- The sticker generation plugin integrates seamlessly with the AI Apps plugin:
327
-
328
- ```typescript
329
- import AIApps from '@imgly/plugin-ai-apps-web';
330
- import FalAiSticker from '@imgly/plugin-ai-sticker-generation-web/fal-ai';
331
-
332
- cesdk.addPlugin(
333
- AIApps({
334
- providers: {
335
- // Other providers...
336
- text2sticker: FalAiSticker.Recraft20b({
337
- proxyUrl: 'http://your-proxy-server.com/api/proxy'
338
- })
339
- }
340
- })
341
- );
342
- ```
343
-
344
- When integrated with AI Apps, the sticker generation functionality appears in the main AI interface alongside other AI generation capabilities.
345
-
346
- ## Translations
347
-
348
- For customization and localization, see the [translations.json](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-sticker-generation-web/translations.json) file which contains provider-specific translation keys for sticker generation interfaces.
349
-
350
- ## Related Packages
351
-
352
- - [@imgly/plugin-ai-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web) - Core utilities for AI generation
353
- - [@imgly/plugin-ai-apps-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-apps-web) - AI apps orchestration
354
- - [@imgly/plugin-ai-image-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-image-generation-web) - AI image generation
355
- - [@imgly/plugin-ai-video-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-video-generation-web) - AI video generation
356
- - [@imgly/plugin-ai-audio-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-audio-generation-web) - AI audio generation
5
+ For documentation, visit: https://img.ly/docs/cesdk
357
6
 
358
7
  ## License
359
8
 
360
- This plugin is part of the IMG.LY plugin ecosystem for CreativeEditor SDK. Please refer to the license terms in the package.
9
+ This plugin is part of the IMG.LY plugin ecosystem for CreativeEditor SDK.