@imgly/plugin-ai-image-generation-web 0.2.3 → 0.2.4

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
@@ -2,11 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.4] - 2025-08-07
6
+
7
+ ### New Features
8
+
9
+ - [all] **Provider Label Translations**: Added support for provider label translations
10
+ - [all] **Extended Provider Configuration**: Added support for `history` and `supportedQuickActions` configuration fields in `CommonProviderConfiguration`, allowing customers to:
11
+ - 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
12
+ - 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
13
+ - Both fields are optional and maintain backward compatibility with existing provider configurations
14
+ - [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
15
+
5
16
  ## [0.2.3] - 2025-07-23
6
17
 
7
18
  - [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`)
8
19
  - [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
9
20
  - [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`.
21
+ - [image-generation] **Ideogram V3**: Added support for Ideogram V3 provider for image generation, which supports text-to-image and image-to-image generation
10
22
 
11
23
  ## [0.2.2] - 2025-07-16
12
24
 
package/README.md CHANGED
@@ -173,6 +173,19 @@ Key features:
173
173
  - Adjustable quality settings
174
174
  - Custom headers support for API requests
175
175
 
176
+ **Custom Translations:**
177
+ ```typescript
178
+ cesdk.i18n.setTranslations({
179
+ en: {
180
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.prompt': 'Your image description',
181
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.style': 'Art Style',
182
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.style.realistic_image': 'Photorealistic',
183
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.style.illustration': 'Illustration',
184
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.image_size': 'Canvas Size'
185
+ }
186
+ });
187
+ ```
188
+
176
189
  #### 2. Recraft20b (Text-to-Image)
177
190
 
178
191
  An enhanced text-to-image model from fal.ai with additional icon style support:
@@ -193,6 +206,19 @@ Key features:
193
206
  - Three-way style selection (image/vector/icon)
194
207
  - Same image size presets and custom dimensions support
195
208
  - Cost-effective alternative to RecraftV3
209
+
210
+ **Custom Translations:**
211
+ ```typescript
212
+ cesdk.i18n.setTranslations({
213
+ en: {
214
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.property.prompt': 'Icon description',
215
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.property.style': 'Icon Style',
216
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.property.style.icon': 'Standard Icon',
217
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.property.style.logo': 'Logo Icon',
218
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft/v2/text-to-image.property.n_colors': 'Number of Colors'
219
+ }
220
+ });
221
+ ```
196
222
  - Custom headers support for API requests
197
223
 
198
224
  #### 3. GptImage1.Text2Image (Text-to-Image)
@@ -237,6 +263,16 @@ Key features:
237
263
  - Includes style presets and artist-specific transformations
238
264
  - Custom headers support for API requests
239
265
 
266
+ **Custom Translations:**
267
+ ```typescript
268
+ cesdk.i18n.setTranslations({
269
+ en: {
270
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/gemini-flash-edit.property.prompt': 'Transformation instructions',
271
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/gemini-flash-edit.property.image_url': 'Source Image'
272
+ }
273
+ });
274
+ ```
275
+
240
276
  #### 5. GptImage1.Image2Image (Image-to-Image)
241
277
 
242
278
  OpenAI's GPT-4 Vision based image editing model that can transform existing images:
@@ -258,7 +294,46 @@ Key features:
258
294
  - Can be used as a direct alternative to GeminiFlashEdit
259
295
  - Custom headers support for API requests
260
296
 
261
- #### 5. FluxProKontextEdit (Image-to-Image)
297
+ #### 5. IdeogramV3 (Text-to-Image)
298
+
299
+ A high-quality text-to-image model from fal.ai featuring advanced generation capabilities:
300
+
301
+ ```typescript
302
+ text2image: FalAiImage.IdeogramV3({
303
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
304
+ headers: {
305
+ 'x-custom-header': 'value',
306
+ 'x-client-version': '1.0.0'
307
+ }
308
+ })
309
+ ```
310
+
311
+ Key features:
312
+ - Four distinct style modes: AUTO, GENERAL, REALISTIC, and DESIGN
313
+ - Multiple image size presets: square HD, square, portrait 4:3/16:9, landscape 4:3/16:9
314
+ - Custom dimensions support (64x64 to 14142x14142 pixels)
315
+
316
+ #### 6. IdeogramV3Remix (Image-to-Image)
317
+
318
+ A powerful image remixing model from fal.ai that transforms existing images while preserving core elements:
319
+
320
+ ```typescript
321
+ image2image: FalAiImage.IdeogramV3Remix({
322
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
323
+ headers: {
324
+ 'x-custom-header': 'value',
325
+ 'x-client-version': '1.0.0'
326
+ }
327
+ })
328
+ ```
329
+
330
+ Key features:
331
+ - **Remix existing images** with text prompts while maintaining core characteristics
332
+ - Four distinct style modes: AUTO, GENERAL, REALISTIC, and DESIGN
333
+ - Multiple image size presets: square HD, square, portrait 4:3/16:9, landscape 4:3/16:9
334
+ - Custom dimensions support (64x64 to 14142x14142 pixels)
335
+
336
+ #### 7. FluxProKontextEdit (Image-to-Image)
262
337
 
263
338
  A versatile image editing model that applies stylistic changes and transformations:
264
339
 
@@ -273,7 +348,7 @@ Key features:
273
348
  - Built-in quick actions for style transfer, artist styles, background swapping, and variants
274
349
  - Keeps original image dimensions
275
350
 
276
- #### 6. FluxProKontextMaxEdit (Image-to-Image)
351
+ #### 8. FluxProKontextMaxEdit (Image-to-Image)
277
352
 
278
353
  A high-quality variant of FluxProKontext offering more detailed results:
279
354
 
@@ -289,6 +364,72 @@ Key features:
289
364
  - Maintains original dimensions
290
365
  - Canvas quick-action integration
291
366
 
367
+ ### Customizing Labels and Translations
368
+
369
+ You can customize all labels and text in the AI image generation interface using the translation system. This allows you to provide better labels for your users in any language.
370
+
371
+ #### Translation Key Structure
372
+
373
+ The system checks for translations in this order (highest to lowest priority):
374
+
375
+ 1. **Provider-specific**: `ly.img.plugin-ai-image-generation-web.${provider}.property.${field}` - Override labels for a specific AI provider
376
+ 2. **Generic**: `ly.img.plugin-ai-generation-web.property.${field}` - Override labels for all AI plugins
377
+
378
+ #### Basic Example
379
+
380
+ ```typescript
381
+ // Customize labels for your AI image generation interface
382
+ cesdk.i18n.setTranslations({
383
+ en: {
384
+ // Generic labels (applies to ALL AI plugins)
385
+ 'ly.img.plugin-ai-generation-web.property.prompt': 'Describe what you want to create',
386
+ 'ly.img.plugin-ai-generation-web.property.image_size': 'Image Dimensions',
387
+
388
+ // Provider-specific for RecraftV3
389
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.prompt': 'Describe your Recraft image',
390
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.image_size': 'Canvas Size',
391
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.image_size.square_hd': 'Square HD (1024×1024)',
392
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.image_size.portrait_4_3': 'Portrait 4:3 (768×1024)',
393
+
394
+ // Provider-specific for IdeogramV3
395
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/ideogram/v3.property.prompt': 'Describe your Ideogram image',
396
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/ideogram/v3.property.style_mode': 'Style Mode',
397
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/ideogram/v3.property.style_mode.REALISTIC': 'Photorealistic'
398
+ }
399
+ });
400
+ ```
401
+
402
+ #### QuickAction Translations
403
+
404
+ QuickActions (like "Edit Image", "Style Transfer", etc.) use their own translation keys:
405
+
406
+ ```typescript
407
+ cesdk.i18n.setTranslations({
408
+ en: {
409
+ // QuickAction button labels
410
+ 'ly.img.plugin-ai-image-generation-web.quickAction.editImage': 'Edit Image...',
411
+ 'ly.img.plugin-ai-image-generation-web.quickAction.swapBackground': 'Swap Background...',
412
+ 'ly.img.plugin-ai-image-generation-web.quickAction.styleTransfer': 'Style Transfer...',
413
+ 'ly.img.plugin-ai-image-generation-web.quickAction.createVariant': 'Create Variant...',
414
+
415
+ // QuickAction input fields and buttons
416
+ 'ly.img.plugin-ai-image-generation-web.quickAction.editImage.prompt': 'Edit Image...',
417
+ 'ly.img.plugin-ai-image-generation-web.quickAction.editImage.prompt.placeholder': 'e.g. "Add a sunset"',
418
+ 'ly.img.plugin-ai-image-generation-web.quickAction.editImage.apply': 'Change',
419
+
420
+ 'ly.img.plugin-ai-image-generation-web.quickAction.swapBackground.prompt': 'Swap Background...',
421
+ 'ly.img.plugin-ai-image-generation-web.quickAction.swapBackground.prompt.placeholder': 'e.g. "Beach at sunset"',
422
+ 'ly.img.plugin-ai-image-generation-web.quickAction.swapBackground.apply': 'Swap'
423
+ }
424
+ });
425
+ ```
426
+
427
+ **QuickAction Translation Structure:**
428
+ - Base key (e.g., `.quickAction.editImage`): Button text when QuickAction is collapsed
429
+ - `.prompt`: Label for input field when expanded
430
+ - `.prompt.placeholder`: Placeholder text for input field
431
+ - `.apply`: Text for action/submit button
432
+
292
433
  ### Configuration Options
293
434
 
294
435
  The plugin accepts the following configuration options:
@@ -466,6 +607,26 @@ FalAiImage.Recraft20b(config: {
466
607
  })
467
608
  ```
468
609
 
610
+ #### IdeogramV3
611
+
612
+ ```typescript
613
+ FalAiImage.IdeogramV3(config: {
614
+ proxyUrl: string;
615
+ headers?: Record<string, string>;
616
+ debug?: boolean;
617
+ })
618
+ ```
619
+
620
+ #### IdeogramV3Remix
621
+
622
+ ```typescript
623
+ FalAiImage.IdeogramV3Remix(config: {
624
+ proxyUrl: string;
625
+ headers?: Record<string, string>;
626
+ debug?: boolean;
627
+ })
628
+ ```
629
+
469
630
  #### GeminiFlashEdit
470
631
 
471
632
  ```typescript
@@ -601,6 +762,8 @@ const myImageProvider = {
601
762
  - Provider-specific panels:
602
763
  - RecraftV3: `ly.img.ai.fal-ai/recraft-v3`
603
764
  - Recraft20b: `ly.img.ai.fal-ai/recraft/v2/text-to-image`
765
+ - IdeogramV3: `ly.img.ai.fal-ai/ideogram/v3`
766
+ - IdeogramV3Remix: `ly.img.ai.fal-ai/ideogram/v3/remix`
604
767
  - GeminiFlashEdit: `ly.img.ai.fal-ai/gemini-flash-edit`
605
768
  - GptImage1.Text2Image: `ly.img.ai.open-ai/gpt-image-1/text2image`
606
769
  - GptImage1.Image2Image: `ly.img.ai.open-ai/gpt-image-1/image2image`
@@ -612,6 +775,8 @@ const myImageProvider = {
612
775
  Generated images are automatically stored in asset sources with the following IDs:
613
776
  - RecraftV3: `fal-ai/recraft-v3.history`
614
777
  - Recraft20b: `fal-ai/recraft/v2/text-to-image.history`
778
+ - IdeogramV3: `fal-ai/ideogram/v3.history`
779
+ - IdeogramV3Remix: `fal-ai/ideogram/v3/remix.history`
615
780
  - GeminiFlashEdit: `fal-ai/gemini-flash-edit.history`
616
781
  - GptImage1.Text2Image: `open-ai/gpt-image-1/text2image.history`
617
782
  - GptImage1.Image2Image: `open-ai/gpt-image-1/image2image.history`
@@ -635,6 +800,10 @@ currentOrder.splice(2, 0, 'ly.img.ai.image-generation.dock');
635
800
  cesdk.ui.setDockOrder(currentOrder);
636
801
  ```
637
802
 
803
+ ## Translations
804
+
805
+ For customization and localization, see the [translations.json](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-image-generation-web/translations.json) file which contains provider-specific translation keys for image generation interfaces.
806
+
638
807
  ## Related Packages
639
808
 
640
809
  - [@imgly/plugin-ai-generation-web](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web) - Core utilities for AI generation
@@ -0,0 +1,8 @@
1
+ export declare const IMAGE_SIZE_MAP: Record<string, {
2
+ width: number;
3
+ height: number;
4
+ }>;
5
+ export declare function getImageDimensions(imageSize: string): {
6
+ width: number;
7
+ height: number;
8
+ };
@@ -0,0 +1,22 @@
1
+ import { CommonProviderConfiguration, type Provider } from '@imgly/plugin-ai-generation-web';
2
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
3
+ type IdeogramV3Input = {
4
+ prompt: string;
5
+ style?: 'AUTO' | 'GENERAL' | 'REALISTIC' | 'DESIGN';
6
+ image_size?: string | {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ rendering_speed?: 'TURBO' | 'BALANCED' | 'QUALITY';
11
+ };
12
+ type IdeogramV3Output = {
13
+ kind: 'image';
14
+ url: string;
15
+ };
16
+ interface ProviderConfiguration extends CommonProviderConfiguration<IdeogramV3Input, IdeogramV3Output> {
17
+ }
18
+ export declare function IdeogramV3(config: ProviderConfiguration): (context: {
19
+ cesdk: CreativeEditorSDK;
20
+ }) => Promise<Provider<'image', IdeogramV3Input, IdeogramV3Output>>;
21
+ declare function getProvider(cesdk: CreativeEditorSDK, config: ProviderConfiguration): Provider<'image', IdeogramV3Input, IdeogramV3Output>;
22
+ export default getProvider;
@@ -0,0 +1,8 @@
1
+ export declare const IMAGE_SIZE_MAP: Record<string, {
2
+ width: number;
3
+ height: number;
4
+ }>;
5
+ export declare function getImageDimensions(imageSize: string): {
6
+ width: number;
7
+ height: number;
8
+ };
@@ -0,0 +1,23 @@
1
+ import { CommonProviderConfiguration, type Provider } from '@imgly/plugin-ai-generation-web';
2
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
3
+ type IdeogramV3RemixUIInput = {
4
+ prompt: string;
5
+ image_url: string;
6
+ style?: 'AUTO' | 'GENERAL' | 'REALISTIC' | 'DESIGN';
7
+ image_size?: string | {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ rendering_speed?: 'TURBO' | 'BALANCED' | 'QUALITY';
12
+ strength?: number;
13
+ };
14
+ type IdeogramV3RemixOutput = {
15
+ kind: 'image';
16
+ url: string;
17
+ };
18
+ interface ProviderConfiguration extends CommonProviderConfiguration<IdeogramV3RemixUIInput, IdeogramV3RemixOutput> {
19
+ }
20
+ export declare function IdeogramV3Remix(config: ProviderConfiguration): (context: {
21
+ cesdk: CreativeEditorSDK;
22
+ }) => Promise<Provider<'image', IdeogramV3RemixUIInput, IdeogramV3RemixOutput>>;
23
+ export {};
@@ -10,6 +10,16 @@ type ImageProviderConfiguration = {
10
10
  * @deprecated Use `middlewares` instead.
11
11
  */
12
12
  middleware?: Middleware<any, any>[];
13
+ /**
14
+ * Override provider's default history asset source
15
+ */
16
+ history?: false | '@imgly/local' | '@imgly/indexedDB' | (string & {});
17
+ /**
18
+ * Configure supported quick actions
19
+ */
20
+ supportedQuickActions?: {
21
+ [quickActionId: string]: Partial<ImageQuickActionSupportMap<any>[string]> | false | null;
22
+ };
13
23
  };
14
24
  /**
15
25
  * Creates a base provider from schema. This should work out of the box
@@ -3,11 +3,15 @@ import { Recraft20b } from './Recraft20b';
3
3
  import { GeminiFlashEdit } from './GeminiFlashEdit';
4
4
  import { FluxProKontextEdit } from './FluxProKontextEdit';
5
5
  import { FluxProKontextMaxEdit } from './FluxProKontextMaxEdit';
6
+ import { IdeogramV3 } from './IdeogramV3';
7
+ import { IdeogramV3Remix } from './IdeogramV3Remix';
6
8
  declare const FalAi: {
7
- RecraftV3: typeof RecraftV3;
8
- Recraft20b: typeof Recraft20b;
9
- GeminiFlashEdit: typeof GeminiFlashEdit;
10
9
  FluxProKontextEdit: typeof FluxProKontextEdit;
11
10
  FluxProKontextMaxEdit: typeof FluxProKontextMaxEdit;
11
+ GeminiFlashEdit: typeof GeminiFlashEdit;
12
+ IdeogramV3: typeof IdeogramV3;
13
+ IdeogramV3Remix: typeof IdeogramV3Remix;
14
+ Recraft20b: typeof Recraft20b;
15
+ RecraftV3: typeof RecraftV3;
12
16
  };
13
17
  export default FalAi;