@imgly/plugin-ai-video-generation-web 0.1.0-rc.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 ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## [0.1.0-rc.1] - 2025-03-20
4
+
5
+ ### Added
6
+ - Initial release
package/LICENSE.md ADDED
@@ -0,0 +1,17 @@
1
+
2
+ GNU Affero General Public License
3
+ =================================
4
+
5
+ _Version 3, 19 November 2007_
6
+ _Copyright © 2007 Free Software Foundation, Inc. &lt;<http://fsf.org/>&gt;_
7
+
8
+ Everyone is permitted to copy and distribute verbatim copies
9
+ of this license document, but changing it is not allowed.
10
+
11
+ ## Preamble
12
+
13
+ The GNU Affero General Public License is a free, copyleft license for
14
+ software and other kinds of works, specifically designed to ensure
15
+ cooperation with the community in the case of network server software.
16
+
17
+ [Full license text omitted for brevity]
package/README.md ADDED
@@ -0,0 +1,242 @@
1
+ # IMG.LY AI Video Generation for Web
2
+
3
+ A plugin for integrating AI video generation capabilities into CreativeEditor SDK.
4
+
5
+ ## Overview
6
+
7
+ The `@imgly/plugin-ai-video-generation-web` package enables users to generate videos using AI directly within CreativeEditor SDK. This shipped provider leverages the [fal.ai](https://fal.ai) platform to provide high-quality video generation from text-to-video and image-to-video transformations.
8
+
9
+ Features include:
10
+
11
+ - Text-to-video generation
12
+ - Image-to-video transformations
13
+ - Multiple model options
14
+ - Automatic history tracking
15
+ - Canvas menu quick actions
16
+ - Seamless integration with CreativeEditor SDK
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install @imgly/plugin-ai-video-generation-web
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### Basic Configuration
27
+
28
+ To use the plugin, import it and configure it with your preferred providers:
29
+
30
+ ```typescript
31
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
32
+ import VideoGeneration from '@imgly/plugin-ai-video-generation-web';
33
+ import FalAiVideo from '@imgly/plugin-ai-video-generation-web/fal-ai';
34
+
35
+ // Initialize CreativeEditor SDK
36
+ CreativeEditorSDK.create(domElement, {
37
+ license: 'your-license-key'
38
+ // Other configuration options...
39
+ }).then(async (cesdk) => {
40
+ // Add the video generation plugin
41
+ cesdk.addPlugin(
42
+ VideoGeneration({
43
+ // Text-to-video provider
44
+ text2video: FalAiVideo.MinimaxVideo01Live({
45
+ proxyUrl: 'https://your-fal-ai-proxy.example.com'
46
+ }),
47
+
48
+ // Image-to-video provider (optional)
49
+ image2video: FalAiVideo.MinimaxVideo01LiveImageToVideo({
50
+ proxyUrl: 'https://your-fal-ai-proxy.example.com'
51
+ }),
52
+
53
+ // Optional configuration
54
+ debug: false,
55
+ dryRun: false
56
+ })
57
+ );
58
+ });
59
+ ```
60
+
61
+ ### Providers
62
+
63
+ The plugin comes with pre-configured providers for fal.ai models:
64
+
65
+ #### 1. MinimaxVideo01Live (Text-to-Video)
66
+
67
+ A model that generates videos based on text prompts:
68
+
69
+ ```typescript
70
+ text2video: FalAiVideo.MinimaxVideo01Live({
71
+ proxyUrl: 'https://your-fal-ai-proxy.example.com'
72
+ });
73
+ ```
74
+
75
+ Key features:
76
+
77
+ - Generate videos from text descriptions
78
+ - Fixed output dimensions (1280×720)
79
+ - 5-second video duration
80
+
81
+ #### 2. MinimaxVideo01LiveImageToVideo (Image-to-Video)
82
+
83
+ A model that transforms still images into videos:
84
+
85
+ ```typescript
86
+ image2video: FalAiVideo.MinimaxVideo01LiveImageToVideo({
87
+ proxyUrl: 'https://your-fal-ai-proxy.example.com'
88
+ });
89
+ ```
90
+
91
+ Key features:
92
+
93
+ - Transform existing images into videos
94
+ - Available through canvas quick actions
95
+ - Maintains original image aspect ratio
96
+
97
+ #### 3. PixverseV35TextToVideo (Text-to-Video)
98
+
99
+ An alternative text-to-video model:
100
+
101
+ ```typescript
102
+ text2video: FalAiVideo.PixverseV35TextToVideo({
103
+ proxyUrl: 'https://your-fal-ai-proxy.example.com'
104
+ });
105
+ ```
106
+
107
+ ### Configuration Options
108
+
109
+ The plugin accepts the following configuration options:
110
+
111
+ | Option | Type | Description | Default |
112
+ | ------------- | -------- | -------------------------------------------- | --------- |
113
+ | `text2video` | Provider | Provider for text-to-video generation | undefined |
114
+ | `image2video` | Provider | Provider for image-to-video transformation | undefined |
115
+ | `debug` | boolean | Enable debug logging | false |
116
+ | `dryRun` | boolean | Simulate generation without API calls | false |
117
+ | `middleware` | Function | Custom middleware for the generation process | undefined |
118
+
119
+ ### Using a Proxy
120
+
121
+ 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:
122
+
123
+ ```typescript
124
+ text2video: FalAiVideo.MinimaxVideo01Live({
125
+ proxyUrl: 'https://your-fal-ai-proxy.example.com'
126
+ });
127
+ ```
128
+
129
+ You'll need to implement a proxy server that forwards requests to fal.ai and handles authentication.
130
+
131
+ ## API Reference
132
+
133
+ ### Main Plugin
134
+
135
+ ```typescript
136
+ VideoGeneration(options: PluginConfiguration): EditorPlugin
137
+ ```
138
+
139
+ Creates and returns a plugin that can be added to CreativeEditor SDK.
140
+
141
+ ### Plugin Configuration
142
+
143
+ ```typescript
144
+ interface PluginConfiguration {
145
+ // Provider for text-to-video generation
146
+ text2video?: AiVideoProvider;
147
+
148
+ // Provider for image-to-video generation
149
+ image2video?: AiVideoProvider;
150
+
151
+ // Enable debug logging
152
+ debug?: boolean;
153
+
154
+ // Skip actual API calls for testing
155
+ dryRun?: boolean;
156
+
157
+ // Extend the generation process
158
+ middleware?: GenerationMiddleware;
159
+ }
160
+ ```
161
+
162
+ ### Fal.ai Providers
163
+
164
+ #### MinimaxVideo01Live
165
+
166
+ ```typescript
167
+ FalAiVideo.MinimaxVideo01Live(config: {
168
+ proxyUrl: string;
169
+ debug?: boolean;
170
+ }): AiVideoProvider
171
+ ```
172
+
173
+ #### MinimaxVideo01LiveImageToVideo
174
+
175
+ ```typescript
176
+ FalAiVideo.MinimaxVideo01LiveImageToVideo(config: {
177
+ proxyUrl: string;
178
+ debug?: boolean;
179
+ }): AiVideoProvider
180
+ ```
181
+
182
+ #### PixverseV35TextToVideo
183
+
184
+ ```typescript
185
+ FalAiVideo.PixverseV35TextToVideo(config: {
186
+ proxyUrl: string;
187
+ debug?: boolean;
188
+ }): AiVideoProvider
189
+ ```
190
+
191
+ ## UI Integration
192
+
193
+ The plugin automatically registers the following UI components:
194
+
195
+ 1. **Generation Panel**: A sidebar panel for text-to-video generation
196
+ 2. **Quick Actions**: Canvas menu items for image-to-video transformations
197
+ 3. **History Library**: Displays previously generated videos
198
+ 4. **Dock Component**: A button in the dock area to open the video generation panel
199
+
200
+ ### Panel IDs
201
+
202
+ - Main panel: `ly.img.ai/video-generation`
203
+ - Canvas quick actions: `ly.img.ai.video.canvasMenu`
204
+ - Provider-specific panels:
205
+ - MinimaxVideo01Live: `ly.img.ai/fal-ai/minimax/video-01-live`
206
+ - MinimaxVideo01LiveImageToVideo: `ly.img.ai/fal-ai/minimax/video-01-live/image-to-video`
207
+ - PixverseV35TextToVideo: `ly.img.ai/fal-ai/pixverse/v3.5/text-to-video`
208
+
209
+ ### Asset History
210
+
211
+ Generated videos are automatically stored in asset sources with the following IDs:
212
+
213
+ - MinimaxVideo01Live: `fal-ai/minimax/video-01-live.history`
214
+ - MinimaxVideo01LiveImageToVideo: `fal-ai/minimax/video-01-live/image-to-video.history`
215
+ - PixverseV35TextToVideo: `fal-ai/pixverse/v3.5/text-to-video.history`
216
+
217
+ ### Dock Integration
218
+
219
+ The plugin automatically registers a dock component with a sparkle icon that opens the video generation panel. To customize the component's position in the dock, use the `setDockOrder` method:
220
+
221
+ ```typescript
222
+ // Add the AI Video component to the beginning of the dock
223
+ cesdk.ui.setDockOrder([
224
+ 'ly.img.ai/video-generation.dock',
225
+ ...cesdk.ui.getDockOrder()
226
+ ]);
227
+
228
+ // Or add it at a specific position
229
+ const currentOrder = cesdk.ui.getDockOrder();
230
+ currentOrder.splice(2, 0, 'ly.img.ai/video-generation.dock');
231
+ cesdk.ui.setDockOrder(currentOrder);
232
+ ```
233
+
234
+ ## Related Packages
235
+
236
+ - [@imgly/plugin-ai-generation-web](https://github.com/imgly/plugin-ai-generation-web) - Core utilities for AI generation
237
+ - [@imgly/plugin-ai-image-generation-web](https://github.com/imgly/plugin-ai-image-generation-web) - AI image generation
238
+ - [@imgly/plugin-ai-audio-generation-web](https://github.com/imgly/plugin-ai-audio-generation-web) - AI audio generation
239
+
240
+ ## License
241
+
242
+ This plugin is part of the IMG.LY plugin ecosystem for CreativeEditor SDK. Please refer to the license terms in the package.
@@ -0,0 +1 @@
1
+ export declare const PLUGIN_ID = "@imgly/plugin-ai-video-generation-web";
@@ -0,0 +1,15 @@
1
+ import { type MinimaxVideo01LiveInput } from '@fal-ai/client/endpoints';
2
+ import { VideoOutput, type Provider } from '@imgly/plugin-ai-generation-web';
3
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
4
+ type ProviderConfiguration = {
5
+ proxyUrl: string;
6
+ debug?: boolean;
7
+ };
8
+ export declare function MinimaxVideo01Live(config: ProviderConfiguration): (context: {
9
+ cesdk: CreativeEditorSDK;
10
+ }) => Promise<Provider<'video', MinimaxVideo01LiveInput, VideoOutput>>;
11
+ declare function getProvider(cesdk: CreativeEditorSDK, config: ProviderConfiguration): Provider<'video', MinimaxVideo01LiveInput, {
12
+ kind: 'video';
13
+ url: string;
14
+ }>;
15
+ export default getProvider;
@@ -0,0 +1,15 @@
1
+ import { type MinimaxVideo01LiveImageToVideoInput } from '@fal-ai/client/endpoints';
2
+ import { VideoOutput, type Provider } from '@imgly/plugin-ai-generation-web';
3
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
4
+ type ProviderConfiguration = {
5
+ proxyUrl: string;
6
+ debug?: boolean;
7
+ };
8
+ export declare function MinimaxVideo01LiveImageToVideo(config: ProviderConfiguration): (context: {
9
+ cesdk: CreativeEditorSDK;
10
+ }) => Promise<Provider<'video', MinimaxVideo01LiveImageToVideoInput, VideoOutput>>;
11
+ declare function getProvider(cesdk: CreativeEditorSDK, config: ProviderConfiguration): Provider<'video', MinimaxVideo01LiveImageToVideoInput, {
12
+ kind: 'video';
13
+ url: string;
14
+ }>;
15
+ export default getProvider;
@@ -0,0 +1,20 @@
1
+ import { VideoOutput, type Provider } from '@imgly/plugin-ai-generation-web';
2
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
3
+ type ProviderConfiguration = {
4
+ proxyUrl: string;
5
+ debug?: boolean;
6
+ };
7
+ type PixverseV35TextToVideoInput = {
8
+ prompt: string;
9
+ aspect_ratio?: '16:9' | '4:3' | '1:1' | '3:4' | '9:16';
10
+ resolution?: '1080p' | '720p' | '540p' | '360p';
11
+ duration?: '5s' | '8s';
12
+ };
13
+ export declare function PixverseV35TextToVideo(config: ProviderConfiguration): (context: {
14
+ cesdk: CreativeEditorSDK;
15
+ }) => Promise<Provider<'video', PixverseV35TextToVideoInput, VideoOutput>>;
16
+ declare function getProvider(cesdk: CreativeEditorSDK, config: ProviderConfiguration): Provider<'video', PixverseV35TextToVideoInput, {
17
+ kind: 'video';
18
+ url: string;
19
+ }>;
20
+ export default getProvider;
@@ -0,0 +1,28 @@
1
+ import { type OpenAPIV3 } from 'openapi-types';
2
+ import CreativeEditorSDK, { CreativeEngine } from '@cesdk/cesdk-js';
3
+ import { Provider, RenderCustomProperty, GetBlockInput } from '@imgly/plugin-ai-generation-web';
4
+ type VideoProviderConfiguration = {
5
+ proxyUrl: string;
6
+ debug?: boolean;
7
+ };
8
+ /**
9
+ * Creates a base provider from schema. This should work out of the box
10
+ * but may be rough around the edges and should/can be further customized.
11
+ */
12
+ declare function createVideoProvider<I extends Record<string, any>>(options: {
13
+ modelKey: string;
14
+ schema: OpenAPIV3.Document;
15
+ inputReference: string;
16
+ useFlow?: 'placeholder' | 'generation-only';
17
+ initialize?: (context: {
18
+ cesdk?: CreativeEditorSDK;
19
+ engine: CreativeEngine;
20
+ }) => void;
21
+ renderCustomProperty?: RenderCustomProperty;
22
+ getBlockInput: GetBlockInput<'video', I>;
23
+ cesdk?: CreativeEditorSDK;
24
+ }, config: VideoProviderConfiguration): Provider<'video', I, {
25
+ kind: 'video';
26
+ url: string;
27
+ }>;
28
+ export default createVideoProvider;
@@ -0,0 +1,9 @@
1
+ import { MinimaxVideo01Live } from './MinimaxVideo01Live';
2
+ import { MinimaxVideo01LiveImageToVideo } from './MinimaxVideo01LiveImageToVideo';
3
+ import { PixverseV35TextToVideo } from './PixverseV35TextToVideo';
4
+ declare const FalAi: {
5
+ MinimaxVideo01Live: typeof MinimaxVideo01Live;
6
+ MinimaxVideo01LiveImageToVideo: typeof MinimaxVideo01LiveImageToVideo;
7
+ PixverseV35TextToVideo: typeof PixverseV35TextToVideo;
8
+ };
9
+ export default FalAi;