@imgly/plugin-ai-image-generation-web 0.2.8 → 0.2.10

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,6 +2,49 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.10] - 2025-10-22
6
+
7
+ ### New Features
8
+
9
+ - [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:
10
+ - **Text-to-Video Providers**:
11
+ - `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
12
+ - `Veo31FastTextToVideo`: Faster and more cost-effective text-to-video variant with same capabilities as standard version
13
+ - **Image-to-Video Providers**:
14
+ - `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
15
+ - `Veo31FastImageToVideo`: Faster and more cost-effective image-to-video variant with same capabilities
16
+ - **First-Last Frame Providers** (experimental dual-image transformation):
17
+ - `Veo31FirstLastFrameToVideo`: Standard quality interpolation between two images (first and last frame)
18
+ - `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
19
+ - **Quick Action Support**: Added "Animate Between Images" quick action for creating smooth transitions between two selected images using the first-last-frame providers
20
+
21
+ ## [0.2.9] - 2025-10-16
22
+
23
+ ### New Features
24
+
25
+ - [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)
26
+ - [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
27
+
28
+ ### Improvements
29
+
30
+ - [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
31
+ - [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
32
+ - [all] **Translation Keys Available**: Added comprehensive translation keys for:
33
+ - Panel and dock labels (AI Image, AI Video, AI Sticker, AI Voice, Sound Generation)
34
+ - Action labels (Generate Image, Generate Video, Generate Sticker)
35
+ - Style transfer options (None, Anime, Cyberpunk, Kodak 400, Watercolor, Dark Fantasy, Vaporwave, Vector Flat, 3D Animation, Ukiyo-e, Surreal, Steampunk, Night Bokeh, Pop Art)
36
+ - Error messages and UI elements
37
+ - [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
38
+
39
+ ### Fixed
40
+
41
+ - [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.
42
+ - [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.
43
+
44
+ ### Changed
45
+
46
+ - [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.
47
+
5
48
  ## [0.2.8] - 2025-09-29
6
49
 
7
50
  ### New Features
package/README.md CHANGED
@@ -457,7 +457,62 @@ Key features:
457
457
  - Automatic prompt optimization
458
458
  - Custom headers support for API requests
459
459
 
460
- #### 4. GeminiFlashEdit (Image-to-Image)
460
+ #### 4. GeminiFlash25 (Text-to-Image)
461
+
462
+ A fast and efficient text-to-image model from Google's Gemini Flash 2.5 via fal.ai:
463
+
464
+ ```typescript
465
+ text2image: FalAiImage.GeminiFlash25({
466
+ proxyUrl: 'http://your-proxy-server.com/api/proxy',
467
+ headers: {
468
+ 'x-custom-header': 'value',
469
+ 'x-client-version': '1.0.0'
470
+ },
471
+ // Optional: Configure default property values
472
+ properties: {
473
+ aspect_ratio: { default: '1:1' }, // Options: '1:1', '3:4', '4:3', '9:16', '16:9'
474
+ output_format: { default: 'jpeg' } // Options: 'jpeg', 'png', 'webp'
475
+ }
476
+ })
477
+ ```
478
+
479
+ Key features:
480
+ - Fast generation times with Google's Gemini Flash 2.5 model
481
+ - Multiple aspect ratios: 1:1, 3:4, 4:3, 9:16, 16:9
482
+ - Custom dimensions support
483
+ - Multiple output formats (JPEG, PNG, WEBP)
484
+ - Configurable number of images (1-4)
485
+ - Custom headers support for API requests
486
+
487
+ **Available Property Values:**
488
+
489
+ ```typescript
490
+ // aspect_ratio options:
491
+ '1:1' // Square (1024×1024)
492
+ '3:4' // Portrait (768×1024)
493
+ '4:3' // Landscape (1024×768)
494
+ '9:16' // Tall Portrait (576×1024)
495
+ '16:9' // Wide Landscape (1024×576)
496
+
497
+ // output_format options:
498
+ 'jpeg' // JPEG format (default)
499
+ 'png' // PNG format
500
+ 'webp' // WebP format
501
+ ```
502
+
503
+ **Custom Translations:**
504
+ ```typescript
505
+ cesdk.i18n.setTranslations({
506
+ en: {
507
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/gemini-flash-2.5.property.prompt': 'Describe your image',
508
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/gemini-flash-2.5.property.aspect_ratio': 'Aspect Ratio',
509
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/gemini-flash-2.5.property.aspect_ratio.1:1': 'Square (1:1)',
510
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/gemini-flash-2.5.property.aspect_ratio.16:9': 'Wide (16:9)'
511
+ }
512
+ });
513
+ ```
514
+
515
+ #### 5. GeminiFlashEdit (Image-to-Image)
461
516
 
462
517
  An image modification model from fal.ai that transforms existing images:
463
518
 
@@ -479,9 +534,10 @@ image2image: FalAiImage.GeminiFlashEdit({
479
534
 
480
535
  Key features:
481
536
  - Transform existing images with text prompts
482
- - Available directly through canvas quick actions
537
+ - Comprehensive quick actions support: edit image, swap background, style transfer, artist styles, create variants, upscale, outpaint, and combine images
483
538
  - Maintains original image dimensions
484
539
  - Includes style presets and artist-specific transformations
540
+ - Supports multi-image inputs via combineImages quick action
485
541
  - Custom headers support for API requests
486
542
 
487
543
  **Custom Translations:**
@@ -921,24 +977,75 @@ Custom middleware functions follow this pattern:
921
977
  const customMiddleware = async (input, options, next) => {
922
978
  // Pre-processing logic
923
979
  console.log('Before generation:', input);
924
-
980
+
925
981
  // Add custom fields or modify the input if needed
926
982
  const modifiedInput = {
927
983
  ...input,
928
984
  customField: 'custom value'
929
985
  };
930
-
986
+
931
987
  // Call the next middleware or generation function
932
988
  const result = await next(modifiedInput, options);
933
-
989
+
934
990
  // Post-processing logic
935
991
  console.log('After generation:', result);
936
-
992
+
937
993
  // You can also modify the result before returning it
938
994
  return result;
939
995
  };
940
996
  ```
941
997
 
998
+ #### Preventing Default Feedback
999
+
1000
+ Middleware can suppress default UI feedback behaviors using `options.preventDefault()`:
1001
+
1002
+ ```typescript
1003
+ const customErrorMiddleware = async (input, options, next) => {
1004
+ try {
1005
+ return await next(input, options);
1006
+ } catch (error) {
1007
+ // Prevent default error notification and block error state
1008
+ options.preventDefault();
1009
+
1010
+ // When preventDefault() is called, you need to handle the block state yourself.
1011
+ // Here we set the error state to mimic the default behavior:
1012
+ options.blockIds?.forEach(blockId => {
1013
+ if (options.engine.block.isValid(blockId)) {
1014
+ options.engine.block.setState(blockId, { type: 'Error', error: 'Unknown' });
1015
+ }
1016
+ });
1017
+ // Alternative: Delete the placeholder block instead
1018
+ // options.blockIds?.forEach(blockId => {
1019
+ // if (options.engine.block.isValid(blockId)) {
1020
+ // options.engine.block.destroy(blockId);
1021
+ // }
1022
+ // });
1023
+
1024
+ // Show custom error notification
1025
+ options.cesdk?.ui.showNotification({
1026
+ type: 'error',
1027
+ message: `Custom error: ${error.message}`,
1028
+ action: {
1029
+ label: 'Contact Support',
1030
+ onClick: () => window.open('mailto:support@example.com')
1031
+ }
1032
+ });
1033
+
1034
+ throw error;
1035
+ }
1036
+ };
1037
+ ```
1038
+
1039
+ **What gets prevented:**
1040
+ - Error/success notifications
1041
+ - Block error state
1042
+ - Console error logging
1043
+
1044
+ **What is NOT prevented:**
1045
+ - Pending → Ready transition (loading spinner always stops)
1046
+
1047
+ 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).
1048
+
942
1049
  The middleware function signature is:
943
1050
 
944
1051
  ```typescript
@@ -1061,6 +1168,16 @@ FalAiImage.IdeogramV3Remix(config: {
1061
1168
  })
1062
1169
  ```
1063
1170
 
1171
+ #### GeminiFlash25
1172
+
1173
+ ```typescript
1174
+ FalAiImage.GeminiFlash25(config: {
1175
+ proxyUrl: string;
1176
+ headers?: Record<string, string>;
1177
+ debug?: boolean;
1178
+ })
1179
+ ```
1180
+
1064
1181
  #### GeminiFlashEdit
1065
1182
 
1066
1183
  ```typescript
@@ -1071,6 +1188,16 @@ FalAiImage.GeminiFlashEdit(config: {
1071
1188
  })
1072
1189
  ```
1073
1190
 
1191
+ #### Gemini25FlashImageEdit
1192
+
1193
+ ```typescript
1194
+ FalAiImage.Gemini25FlashImageEdit(config: {
1195
+ proxyUrl: string;
1196
+ headers?: Record<string, string>;
1197
+ debug?: boolean;
1198
+ })
1199
+ ```
1200
+
1074
1201
  #### QwenImageEdit
1075
1202
 
1076
1203
  ```typescript
@@ -1248,6 +1375,7 @@ const myImageProvider = {
1248
1375
  - Recraft20b: `ly.img.ai.fal-ai/recraft/v2/text-to-image`
1249
1376
  - IdeogramV3: `ly.img.ai.fal-ai/ideogram/v3`
1250
1377
  - IdeogramV3Remix: `ly.img.ai.fal-ai/ideogram/v3/remix`
1378
+ - GeminiFlash25: `ly.img.ai.fal-ai/gemini-flash-2.5`
1251
1379
  - GeminiFlashEdit: `ly.img.ai.fal-ai/gemini-flash-edit`
1252
1380
  - QwenImageEdit: `ly.img.ai.fal-ai/qwen-image-edit`
1253
1381
  - GptImage1.Text2Image: `ly.img.ai.open-ai/gpt-image-1/text2image`
@@ -1266,6 +1394,7 @@ Generated images are automatically stored in asset sources with the following ID
1266
1394
  - Recraft20b: `fal-ai/recraft/v2/text-to-image.history`
1267
1395
  - IdeogramV3: `fal-ai/ideogram/v3.history`
1268
1396
  - IdeogramV3Remix: `fal-ai/ideogram/v3/remix.history`
1397
+ - GeminiFlash25: `fal-ai/gemini-flash-2.5.history`
1269
1398
  - GeminiFlashEdit: `fal-ai/gemini-flash-edit.history`
1270
1399
  - QwenImageEdit: `fal-ai/qwen-image-edit.history`
1271
1400
  - GptImage1.Text2Image: `open-ai/gpt-image-1/text2image.history`