@imgly/plugin-ai-image-generation-web 0.2.7 → 0.2.9
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 +38 -0
- package/README.md +254 -49
- package/dist/.tsbuildinfo +1 -0
- package/dist/fal-ai/Gemini25FlashImageEdit.d.ts +13 -0
- package/dist/fal-ai/GeminiFlash25.d.ts +21 -0
- package/dist/fal-ai/SeedreamV4.constants.d.ts +4 -0
- package/dist/fal-ai/SeedreamV4.d.ts +23 -0
- package/dist/fal-ai/SeedreamV4Edit.d.ts +22 -0
- package/dist/fal-ai/index.d.ts +8 -0
- package/dist/fal-ai/index.mjs +20 -43
- package/dist/fal-ai/index.mjs.map +4 -4
- package/dist/index.mjs +18 -41
- package/dist/index.mjs.map +4 -4
- package/dist/open-ai/index.mjs +12 -35
- package/dist/open-ai/index.mjs.map +4 -4
- package/package.json +7 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.9] - 2025-10-16
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
|
|
9
|
+
- [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)
|
|
10
|
+
- [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
|
|
11
|
+
|
|
12
|
+
### Improvements
|
|
13
|
+
|
|
14
|
+
- [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
|
|
15
|
+
- [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
|
|
16
|
+
- [all] **Translation Keys Available**: Added comprehensive translation keys for:
|
|
17
|
+
- Panel and dock labels (AI Image, AI Video, AI Sticker, AI Voice, Sound Generation)
|
|
18
|
+
- Action labels (Generate Image, Generate Video, Generate Sticker)
|
|
19
|
+
- Style transfer options (None, Anime, Cyberpunk, Kodak 400, Watercolor, Dark Fantasy, Vaporwave, Vector Flat, 3D Animation, Ukiyo-e, Surreal, Steampunk, Night Bokeh, Pop Art)
|
|
20
|
+
- Error messages and UI elements
|
|
21
|
+
- [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
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- [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.
|
|
26
|
+
- [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.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- [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.
|
|
31
|
+
|
|
32
|
+
## [0.2.8] - 2025-09-29
|
|
33
|
+
|
|
34
|
+
### New Features
|
|
35
|
+
|
|
36
|
+
- [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
|
|
37
|
+
- [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)
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- [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
|
|
42
|
+
|
|
5
43
|
## [0.2.7] - 2025-09-26
|
|
6
44
|
|
|
7
45
|
### New Features
|
package/README.md
CHANGED
|
@@ -179,8 +179,8 @@ text2image: FalAiImage.RecraftV3({
|
|
|
179
179
|
},
|
|
180
180
|
// Optional: Configure default property values
|
|
181
181
|
properties: {
|
|
182
|
-
style: 'realistic_image', // Default style
|
|
183
|
-
image_size: 'square_hd' // Default size
|
|
182
|
+
style: { default: 'realistic_image' }, // Default style
|
|
183
|
+
image_size: { default: 'square_hd' } // Default size
|
|
184
184
|
}
|
|
185
185
|
})
|
|
186
186
|
```
|
|
@@ -265,17 +265,19 @@ Key features:
|
|
|
265
265
|
text2image: FalAiImage.RecraftV3({
|
|
266
266
|
proxyUrl: 'http://your-proxy-server.com/api/proxy',
|
|
267
267
|
properties: {
|
|
268
|
-
prompt: '', // User will fill this
|
|
269
|
-
style: 'realistic_image/natural_light',
|
|
270
|
-
image_size: 'landscape_16_9',
|
|
268
|
+
prompt: { default: '' }, // User will fill this
|
|
269
|
+
style: { default: 'realistic_image/natural_light' },
|
|
270
|
+
image_size: { default: 'landscape_16_9' },
|
|
271
271
|
|
|
272
272
|
// Dynamic style based on context
|
|
273
|
-
style:
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
style: {
|
|
274
|
+
default: (context) => {
|
|
275
|
+
const hour = new Date().getHours();
|
|
276
|
+
if (hour < 6 || hour > 18) {
|
|
277
|
+
return 'realistic_image/evening_light';
|
|
278
|
+
}
|
|
279
|
+
return 'realistic_image/natural_light';
|
|
277
280
|
}
|
|
278
|
-
return 'realistic_image/natural_light';
|
|
279
281
|
}
|
|
280
282
|
}
|
|
281
283
|
})
|
|
@@ -319,13 +321,15 @@ text2image: FalAiImage.Recraft20b({
|
|
|
319
321
|
// Optional: Configure default property values
|
|
320
322
|
properties: {
|
|
321
323
|
// Dynamic style defaults based on style type
|
|
322
|
-
style:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
324
|
+
style: {
|
|
325
|
+
default: (context) => {
|
|
326
|
+
// Different defaults for different style categories
|
|
327
|
+
// This is handled internally by the provider
|
|
328
|
+
return 'broken_line'; // Default for icon styles
|
|
329
|
+
}
|
|
326
330
|
},
|
|
327
|
-
image_size: 'square_hd',
|
|
328
|
-
n_colors: 4 // Default color count for icon styles
|
|
331
|
+
image_size: { default: 'square_hd' },
|
|
332
|
+
n_colors: { default: 4 } // Default color count for icon styles
|
|
329
333
|
}
|
|
330
334
|
})
|
|
331
335
|
```
|
|
@@ -380,17 +384,19 @@ Key features:
|
|
|
380
384
|
text2image: FalAiImage.Recraft20b({
|
|
381
385
|
proxyUrl: 'http://your-proxy-server.com/api/proxy',
|
|
382
386
|
properties: {
|
|
383
|
-
prompt: '', // User will fill this
|
|
384
|
-
style: 'icon/colored_outline', // Default to icon style
|
|
385
|
-
image_size: 'square',
|
|
386
|
-
n_colors: 3, // Number of colors for icon styles
|
|
387
|
+
prompt: { default: '' }, // User will fill this
|
|
388
|
+
style: { default: 'icon/colored_outline' }, // Default to icon style
|
|
389
|
+
image_size: { default: 'square' },
|
|
390
|
+
n_colors: { default: 3 }, // Number of colors for icon styles
|
|
387
391
|
|
|
388
392
|
// Dynamic style based on use case
|
|
389
|
-
style:
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
393
|
+
style: {
|
|
394
|
+
default: (context) => {
|
|
395
|
+
// You could check block type or other context
|
|
396
|
+
const engine = context.engine;
|
|
397
|
+
// Return appropriate style
|
|
398
|
+
return 'icon/broken_line';
|
|
399
|
+
}
|
|
394
400
|
}
|
|
395
401
|
}
|
|
396
402
|
})
|
|
@@ -437,9 +443,9 @@ text2image: OpenAiImage.GptImage1.Text2Image({
|
|
|
437
443
|
},
|
|
438
444
|
// Optional: Configure default property values
|
|
439
445
|
properties: {
|
|
440
|
-
size: '1024x1024', // Options: '1024x1024', '1792x1024', '1024x1792'
|
|
441
|
-
quality: 'standard', // Options: 'standard', 'hd'
|
|
442
|
-
style: 'vivid' // Options: 'vivid', 'natural'
|
|
446
|
+
size: { default: '1024x1024' }, // Options: '1024x1024', '1792x1024', '1024x1792'
|
|
447
|
+
quality: { default: 'standard' }, // Options: 'standard', 'hd'
|
|
448
|
+
style: { default: 'vivid' } // Options: 'vivid', 'natural'
|
|
443
449
|
}
|
|
444
450
|
})
|
|
445
451
|
```
|
|
@@ -451,7 +457,62 @@ Key features:
|
|
|
451
457
|
- Automatic prompt optimization
|
|
452
458
|
- Custom headers support for API requests
|
|
453
459
|
|
|
454
|
-
#### 4.
|
|
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)
|
|
455
516
|
|
|
456
517
|
An image modification model from fal.ai that transforms existing images:
|
|
457
518
|
|
|
@@ -464,18 +525,19 @@ image2image: FalAiImage.GeminiFlashEdit({
|
|
|
464
525
|
},
|
|
465
526
|
// Optional: Configure default property values
|
|
466
527
|
properties: {
|
|
467
|
-
strength: 0.8, // Transformation strength (0.0-1.0)
|
|
468
|
-
guidance_scale: 7.5, // Guidance scale (0-20)
|
|
469
|
-
num_inference_steps: 50 // Number of inference steps
|
|
528
|
+
strength: { default: 0.8 }, // Transformation strength (0.0-1.0)
|
|
529
|
+
guidance_scale: { default: 7.5 }, // Guidance scale (0-20)
|
|
530
|
+
num_inference_steps: { default: 50 } // Number of inference steps
|
|
470
531
|
}
|
|
471
532
|
})
|
|
472
533
|
```
|
|
473
534
|
|
|
474
535
|
Key features:
|
|
475
536
|
- Transform existing images with text prompts
|
|
476
|
-
-
|
|
537
|
+
- Comprehensive quick actions support: edit image, swap background, style transfer, artist styles, create variants, upscale, outpaint, and combine images
|
|
477
538
|
- Maintains original image dimensions
|
|
478
539
|
- Includes style presets and artist-specific transformations
|
|
540
|
+
- Supports multi-image inputs via combineImages quick action
|
|
479
541
|
- Custom headers support for API requests
|
|
480
542
|
|
|
481
543
|
**Custom Translations:**
|
|
@@ -522,9 +584,9 @@ text2image: FalAiImage.IdeogramV3({
|
|
|
522
584
|
},
|
|
523
585
|
// Optional: Configure default property values
|
|
524
586
|
properties: {
|
|
525
|
-
style: 'GENERAL', // Options: 'AUTO', 'GENERAL', 'REALISTIC', 'DESIGN'
|
|
526
|
-
image_size: 'square_hd', // Same options as Recraft
|
|
527
|
-
seed: 12345 // Fixed seed for reproducibility
|
|
587
|
+
style: { default: 'GENERAL' }, // Options: 'AUTO', 'GENERAL', 'REALISTIC', 'DESIGN'
|
|
588
|
+
image_size: { default: 'square_hd' }, // Same options as Recraft
|
|
589
|
+
seed: { default: 12345 } // Fixed seed for reproducibility
|
|
528
590
|
}
|
|
529
591
|
})
|
|
530
592
|
```
|
|
@@ -547,9 +609,9 @@ image2image: FalAiImage.IdeogramV3Remix({
|
|
|
547
609
|
},
|
|
548
610
|
// Optional: Configure default property values
|
|
549
611
|
properties: {
|
|
550
|
-
style: 'AUTO', // Options: 'AUTO', 'GENERAL', 'REALISTIC', 'DESIGN'
|
|
551
|
-
image_size: 'square_hd',
|
|
552
|
-
remix_strength: 0.7 // How much to transform (0.0-1.0)
|
|
612
|
+
style: { default: 'AUTO' }, // Options: 'AUTO', 'GENERAL', 'REALISTIC', 'DESIGN'
|
|
613
|
+
image_size: { default: 'square_hd' },
|
|
614
|
+
remix_strength: { default: 0.7 } // How much to transform (0.0-1.0)
|
|
553
615
|
}
|
|
554
616
|
})
|
|
555
617
|
```
|
|
@@ -573,8 +635,8 @@ image2image: FalAiImage.QwenImageEdit({
|
|
|
573
635
|
},
|
|
574
636
|
// Optional: Configure default property values
|
|
575
637
|
properties: {
|
|
576
|
-
seed: 12345, // Fixed seed for reproducibility
|
|
577
|
-
guidance_scale: 7.5 // Guidance strength (0-20)
|
|
638
|
+
seed: { default: 12345 }, // Fixed seed for reproducibility
|
|
639
|
+
guidance_scale: { default: 7.5 } // Guidance strength (0-20)
|
|
578
640
|
}
|
|
579
641
|
})
|
|
580
642
|
```
|
|
@@ -631,7 +693,7 @@ text2image: FalAiImage.NanoBanana({
|
|
|
631
693
|
},
|
|
632
694
|
// Optional: Configure default property values
|
|
633
695
|
properties: {
|
|
634
|
-
output_format: 'PNG' // Options: 'PNG', 'JPEG'
|
|
696
|
+
output_format: { default: 'PNG' } // Options: 'PNG', 'JPEG'
|
|
635
697
|
}
|
|
636
698
|
})
|
|
637
699
|
```
|
|
@@ -656,7 +718,53 @@ cesdk.i18n.setTranslations({
|
|
|
656
718
|
});
|
|
657
719
|
```
|
|
658
720
|
|
|
659
|
-
#### 10.
|
|
721
|
+
#### 10. SeedreamV4 (Text-to-Image)
|
|
722
|
+
|
|
723
|
+
A powerful text-to-image model from ByteDance's Seedream 4.0 available through fal.ai:
|
|
724
|
+
|
|
725
|
+
```typescript
|
|
726
|
+
text2image: FalAiImage.SeedreamV4({
|
|
727
|
+
proxyUrl: 'http://your-proxy-server.com/api/proxy',
|
|
728
|
+
headers: {
|
|
729
|
+
'x-custom-header': 'value',
|
|
730
|
+
'x-client-version': '1.0.0'
|
|
731
|
+
},
|
|
732
|
+
// Optional: Configure default property values
|
|
733
|
+
properties: {
|
|
734
|
+
image_size: { default: 'square_hd' } // Options: square_hd, square, portrait/landscape variants
|
|
735
|
+
}
|
|
736
|
+
})
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
Key features:
|
|
740
|
+
- High-quality image generation with ByteDance's Seedream 4.0 model
|
|
741
|
+
- Multiple image size presets: square HD (2048×2048), square (1024×1024), portrait 4:3/16:9, landscape 4:3/16:9
|
|
742
|
+
- Custom dimensions support (1024-4096 pixels)
|
|
743
|
+
- Fast generation times
|
|
744
|
+
- Safety checker enabled by default
|
|
745
|
+
|
|
746
|
+
#### 11. SeedreamV4Edit (Image-to-Image)
|
|
747
|
+
|
|
748
|
+
An advanced image editing model from ByteDance's Seedream 4.0 for transforming existing images:
|
|
749
|
+
|
|
750
|
+
```typescript
|
|
751
|
+
image2image: FalAiImage.SeedreamV4Edit({
|
|
752
|
+
proxyUrl: 'http://your-proxy-server.com/api/proxy',
|
|
753
|
+
headers: {
|
|
754
|
+
'x-custom-header': 'value',
|
|
755
|
+
'x-client-version': '1.0.0'
|
|
756
|
+
}
|
|
757
|
+
})
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
Key features:
|
|
761
|
+
- Unified architecture for both generation and editing
|
|
762
|
+
- Supports multiple input images (up to 10)
|
|
763
|
+
- Full canvas quick actions support: edit image, swap background, style transfer, artist styles, create variants, combine images, remix page
|
|
764
|
+
- Maintains original image dimensions
|
|
765
|
+
- Custom headers support for API requests
|
|
766
|
+
|
|
767
|
+
#### 12. NanoBananaEdit (Image-to-Image)
|
|
660
768
|
|
|
661
769
|
An image editing model from fal.ai that transforms existing images using text prompts:
|
|
662
770
|
|
|
@@ -669,8 +777,8 @@ image2image: FalAiImage.NanoBananaEdit({
|
|
|
669
777
|
},
|
|
670
778
|
// Optional: Configure default property values
|
|
671
779
|
properties: {
|
|
672
|
-
strength: 0.7, // Edit strength (0.0-1.0)
|
|
673
|
-
output_format: 'PNG' // Options: 'PNG', 'JPEG'
|
|
780
|
+
strength: { default: 0.7 }, // Edit strength (0.0-1.0)
|
|
781
|
+
output_format: { default: 'PNG' } // Options: 'PNG', 'JPEG'
|
|
674
782
|
}
|
|
675
783
|
})
|
|
676
784
|
```
|
|
@@ -869,24 +977,75 @@ Custom middleware functions follow this pattern:
|
|
|
869
977
|
const customMiddleware = async (input, options, next) => {
|
|
870
978
|
// Pre-processing logic
|
|
871
979
|
console.log('Before generation:', input);
|
|
872
|
-
|
|
980
|
+
|
|
873
981
|
// Add custom fields or modify the input if needed
|
|
874
982
|
const modifiedInput = {
|
|
875
983
|
...input,
|
|
876
984
|
customField: 'custom value'
|
|
877
985
|
};
|
|
878
|
-
|
|
986
|
+
|
|
879
987
|
// Call the next middleware or generation function
|
|
880
988
|
const result = await next(modifiedInput, options);
|
|
881
|
-
|
|
989
|
+
|
|
882
990
|
// Post-processing logic
|
|
883
991
|
console.log('After generation:', result);
|
|
884
|
-
|
|
992
|
+
|
|
885
993
|
// You can also modify the result before returning it
|
|
886
994
|
return result;
|
|
887
995
|
};
|
|
888
996
|
```
|
|
889
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
|
+
|
|
890
1049
|
The middleware function signature is:
|
|
891
1050
|
|
|
892
1051
|
```typescript
|
|
@@ -1009,6 +1168,16 @@ FalAiImage.IdeogramV3Remix(config: {
|
|
|
1009
1168
|
})
|
|
1010
1169
|
```
|
|
1011
1170
|
|
|
1171
|
+
#### GeminiFlash25
|
|
1172
|
+
|
|
1173
|
+
```typescript
|
|
1174
|
+
FalAiImage.GeminiFlash25(config: {
|
|
1175
|
+
proxyUrl: string;
|
|
1176
|
+
headers?: Record<string, string>;
|
|
1177
|
+
debug?: boolean;
|
|
1178
|
+
})
|
|
1179
|
+
```
|
|
1180
|
+
|
|
1012
1181
|
#### GeminiFlashEdit
|
|
1013
1182
|
|
|
1014
1183
|
```typescript
|
|
@@ -1019,6 +1188,16 @@ FalAiImage.GeminiFlashEdit(config: {
|
|
|
1019
1188
|
})
|
|
1020
1189
|
```
|
|
1021
1190
|
|
|
1191
|
+
#### Gemini25FlashImageEdit
|
|
1192
|
+
|
|
1193
|
+
```typescript
|
|
1194
|
+
FalAiImage.Gemini25FlashImageEdit(config: {
|
|
1195
|
+
proxyUrl: string;
|
|
1196
|
+
headers?: Record<string, string>;
|
|
1197
|
+
debug?: boolean;
|
|
1198
|
+
})
|
|
1199
|
+
```
|
|
1200
|
+
|
|
1022
1201
|
#### QwenImageEdit
|
|
1023
1202
|
|
|
1024
1203
|
```typescript
|
|
@@ -1089,6 +1268,26 @@ FalAiImage.NanoBananaEdit(config: {
|
|
|
1089
1268
|
})
|
|
1090
1269
|
```
|
|
1091
1270
|
|
|
1271
|
+
#### SeedreamV4
|
|
1272
|
+
|
|
1273
|
+
```typescript
|
|
1274
|
+
FalAiImage.SeedreamV4(config: {
|
|
1275
|
+
proxyUrl: string;
|
|
1276
|
+
headers?: Record<string, string>;
|
|
1277
|
+
debug?: boolean;
|
|
1278
|
+
})
|
|
1279
|
+
```
|
|
1280
|
+
|
|
1281
|
+
#### SeedreamV4Edit
|
|
1282
|
+
|
|
1283
|
+
```typescript
|
|
1284
|
+
FalAiImage.SeedreamV4Edit(config: {
|
|
1285
|
+
proxyUrl: string;
|
|
1286
|
+
headers?: Record<string, string>;
|
|
1287
|
+
debug?: boolean;
|
|
1288
|
+
})
|
|
1289
|
+
```
|
|
1290
|
+
|
|
1092
1291
|
## UI Integration
|
|
1093
1292
|
|
|
1094
1293
|
The plugin automatically registers the following UI components:
|
|
@@ -1176,6 +1375,7 @@ const myImageProvider = {
|
|
|
1176
1375
|
- Recraft20b: `ly.img.ai.fal-ai/recraft/v2/text-to-image`
|
|
1177
1376
|
- IdeogramV3: `ly.img.ai.fal-ai/ideogram/v3`
|
|
1178
1377
|
- IdeogramV3Remix: `ly.img.ai.fal-ai/ideogram/v3/remix`
|
|
1378
|
+
- GeminiFlash25: `ly.img.ai.fal-ai/gemini-flash-2.5`
|
|
1179
1379
|
- GeminiFlashEdit: `ly.img.ai.fal-ai/gemini-flash-edit`
|
|
1180
1380
|
- QwenImageEdit: `ly.img.ai.fal-ai/qwen-image-edit`
|
|
1181
1381
|
- GptImage1.Text2Image: `ly.img.ai.open-ai/gpt-image-1/text2image`
|
|
@@ -1184,6 +1384,8 @@ const myImageProvider = {
|
|
|
1184
1384
|
- FluxProKontextMaxEdit: `ly.img.ai.fal-ai/flux-pro/kontext/max`
|
|
1185
1385
|
- NanoBanana: `ly.img.ai.fal-ai/nano-banana`
|
|
1186
1386
|
- NanoBananaEdit: `ly.img.ai.fal-ai/nano-banana/edit`
|
|
1387
|
+
- SeedreamV4: `ly.img.ai.fal-ai/bytedance/seedream/v4/text-to-image`
|
|
1388
|
+
- SeedreamV4Edit: `ly.img.ai.fal-ai/bytedance/seedream/v4/edit`
|
|
1187
1389
|
|
|
1188
1390
|
### Asset History
|
|
1189
1391
|
|
|
@@ -1192,6 +1394,7 @@ Generated images are automatically stored in asset sources with the following ID
|
|
|
1192
1394
|
- Recraft20b: `fal-ai/recraft/v2/text-to-image.history`
|
|
1193
1395
|
- IdeogramV3: `fal-ai/ideogram/v3.history`
|
|
1194
1396
|
- IdeogramV3Remix: `fal-ai/ideogram/v3/remix.history`
|
|
1397
|
+
- GeminiFlash25: `fal-ai/gemini-flash-2.5.history`
|
|
1195
1398
|
- GeminiFlashEdit: `fal-ai/gemini-flash-edit.history`
|
|
1196
1399
|
- QwenImageEdit: `fal-ai/qwen-image-edit.history`
|
|
1197
1400
|
- GptImage1.Text2Image: `open-ai/gpt-image-1/text2image.history`
|
|
@@ -1200,6 +1403,8 @@ Generated images are automatically stored in asset sources with the following ID
|
|
|
1200
1403
|
- FluxProKontextMaxEdit: `fal-ai/flux-pro/kontext/max.history`
|
|
1201
1404
|
- NanoBanana: `fal-ai/nano-banana.history`
|
|
1202
1405
|
- NanoBananaEdit: `fal-ai/nano-banana/edit.history`
|
|
1406
|
+
- SeedreamV4: `fal-ai/bytedance/seedream/v4/text-to-image.history`
|
|
1407
|
+
- SeedreamV4Edit: `fal-ai/bytedance/seedream/v4/edit.history`
|
|
1203
1408
|
|
|
1204
1409
|
### Dock Integration
|
|
1205
1410
|
|