1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#[allow(unused_imports)]
use crate::prelude::*;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use std::collections::HashMap;
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CollectionToVideoOutput {
/// The generated video
/// {"url":"https://v3.fal.media/files/zebra/z5PDhXAkkIaiRlXARpOeY_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CollectionToVideoRequest {
/// The aspect ratio of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<String>,
/// The duration of the generated video in seconds
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
/// List of images to use for video generation
/// [{"image_url":"https://fal.media/files/panda/dfbC7oH6IASN3LFOfZ9VV.jpeg"}]
pub images: Vec<PikaImage>,
/// Mode for integrating multiple images
#[serde(skip_serializing_if = "Option::is_none")]
pub ingredients_mode: Option<String>,
/// A negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
pub prompt: String,
/// The resolution of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct File {
/// The mime type of the file.
/// "image/png"
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
/// File data
#[serde(skip_serializing_if = "Option::is_none")]
pub file_data: Option<String>,
/// The name of the file. It will be auto-generated if not provided.
/// "z9RV14K95DvU.png"
#[serde(skip_serializing_if = "Option::is_none")]
pub file_name: Option<String>,
/// The size of the file in bytes.
/// 4404019
#[serde(skip_serializing_if = "Option::is_none")]
pub file_size: Option<i64>,
/// The URL where the file can be downloaded from.
pub url: String,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct HTTPValidationError {
#[serde(skip_serializing_if = "Option::is_none")]
pub detail: Option<Vec<Option<ValidationError>>>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ImageToVideoOutput {
/// The generated video
/// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ImageToVideoRequest {
/// The duration of the generated video in seconds
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
/// URL of the image to use as the first frame
/// "https://v3.fal.media/files/elephant/dJjBQXNHRbGJn4aUv4-g9_hearth.jpg"
pub image_url: String,
/// A negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
pub prompt: String,
/// The resolution of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Pika22ImageToVideoOutput {
/// The generated video
/// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika22_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Pika22ImageToVideoRequest {
/// The duration of the generated video in seconds
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
/// URL of the image to use as the first frame
/// "https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/pika_input.png"
pub image_url: String,
/// A negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
pub prompt: String,
/// The resolution of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Pika22TextToVideoOutput {
/// The generated video
/// {"url":"https://storage.googleapis.com/falserverless/web-examples/pika/pika%202.2/text-to-video-output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Pika22TextToVideoRequest {
/// The aspect ratio of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<String>,
/// The duration of the generated video in seconds
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
/// A negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
pub prompt: String,
/// The resolution of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PikaImage {
pub image_url: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PikadditionsOutput {
/// The generated video with added objects/images
/// {"url":"https://v3.fal.media/files/lion/sbM48rVVi7y0yh5EuMtoC_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PikadditionsRequest {
/// URL of the image to add
/// "https://fal.media/files/zebra/V3_Kpw_eqbVoOAIpNKb3Z_c0f2425a9d224d8b9b8d9b800612b782.jpg"
pub image_url: String,
/// Negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
/// Text prompt describing what to add
/// "A parrot in the shoulder of the person picking up cookies"
#[serde(skip_serializing_if = "Option::is_none")]
pub prompt: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
/// URL of the input video
/// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4"
pub video_url: String,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PikaffectsOutput {
/// The generated video with applied effect
/// {"url":"https://v3.fal.media/files/panda/9_LHZlRfLunxkX1ENiiBM_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PikaffectsRequest {
/// URL of the input image
/// "https://fal.media/files/zebra/2Ro7MtV3BGarwQXPtdK6B_148325d4459c4e34917e8eb5c25877d4.jpg"
pub image_url: String,
/// Negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
/// The Pikaffect to apply
/// "Crush"
pub pikaffect: String,
/// Text prompt to guide the effect
/// "A duck getting crushed"
#[serde(skip_serializing_if = "Option::is_none")]
pub prompt: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PikaswapsOutput {
/// The generated video with swapped regions
/// {"url":"https://v3.fal.media/files/koala/fGsPStNbAYW55sfinbDEL_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PikaswapsRequest {
/// URL of the image to swap with
/// "https://fal.media/files/lion/2-ckrSp9r067aApfxXIrh_80a8a57bec50432e9918c87ae35004ed.jpg"
#[serde(skip_serializing_if = "Option::is_none")]
pub image_url: Option<String>,
/// Plaintext description of the object/region to modify
/// "the cookie jars"
#[serde(skip_serializing_if = "Option::is_none")]
pub modify_region: Option<String>,
/// Negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
/// Text prompt describing the modification
/// "Replace the background with a jelly jar"
#[serde(skip_serializing_if = "Option::is_none")]
pub prompt: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
/// URL of the input video
/// "https://v3.fal.media/files/monkey/vXi5n_oq0Qpnbs7Eb2k-b_output.mp4"
pub video_url: String,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct TextToVideoOutput {
/// The generated video
/// {"url":"https://v3.fal.media/files/panda/eLhWXM2p3aJzXg7t_0F0D_output.mp4"}
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct TextToVideoRequest {
/// The aspect ratio of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<String>,
/// The duration of the generated video in seconds
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
/// A negative prompt to guide the model
#[serde(skip_serializing_if = "Option::is_none")]
pub negative_prompt: Option<String>,
pub prompt: String,
/// The resolution of the generated video
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed for the random number generator
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ValidationError {
pub loc: Vec<serde_json::Value>,
pub msg: String,
#[serde(rename = "type")]
pub ty: String,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct VideoOutput {
/// The generated video
/// {"url":"https://v3.fal.media/files/zebra/nQRJbbJ_p_a9zCnyJaTbg_output.mp4"}
pub video: File,
}
/// Pika Effects (v1.5)
///
/// Category: image-to-video
///
///
///
/// Pika Pikadditions Generation.
///
/// Add any object or image into your video. Upload a video and specify what
/// you'd like to add to create a seamlessly integrated result.
pub fn pikadditions(
params: PikadditionsRequest,
) -> FalRequest<PikadditionsRequest, PikadditionsOutput> {
FalRequest::new("fal-ai/pika/v2/pikadditions", params)
}