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
#[allow(unused_imports)]
use crate::prelude::*;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use std::collections::HashMap;
#[cfg(any(
feature = "endpoints",
feature = "endpoints_fal-ai",
feature = "endpoints_fal-ai_hunyuan-video-lora"
))]
#[cfg_attr(
docsrs,
doc(cfg(any(
feature = "endpoints",
feature = "endpoints_fal-ai",
feature = "endpoints_fal-ai_hunyuan-video-lora"
)))
)]
pub mod video_to_video;
#[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 HunyuanT2VRequest {
/// The aspect ratio of the video to generate.
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<String>,
/// If set to true, the safety checker will be enabled.
/// true
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_safety_checker: Option<bool>,
/// The LoRAs to use for the image generation. You can use any number of LoRAs
/// and they will be merged together to generate the final image.
#[serde(skip_serializing_if = "Option::is_none")]
pub loras: Option<Vec<Option<LoraWeight>>>,
/// The number of frames to generate.
#[serde(skip_serializing_if = "Option::is_none")]
pub num_frames: Option<String>,
/// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units.
#[serde(skip_serializing_if = "Option::is_none")]
pub pro_mode: Option<bool>,
/// The prompt to generate the video from.
/// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse."
pub prompt: String,
/// The resolution of the video to generate.
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed to use for generating the video.
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct HunyuanT2VResponse {
/// The seed used for generating the video.
pub seed: i64,
pub video: File,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct HunyuanV2VRequest {
/// The aspect ratio of the video to generate.
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<String>,
/// If set to true, the safety checker will be enabled.
/// true
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_safety_checker: Option<bool>,
/// The LoRAs to use for the image generation. You can use any number of LoRAs
/// and they will be merged together to generate the final image.
#[serde(skip_serializing_if = "Option::is_none")]
pub loras: Option<Vec<Option<LoraWeight>>>,
/// The number of frames to generate.
#[serde(skip_serializing_if = "Option::is_none")]
pub num_frames: Option<String>,
/// By default, generations are done with 35 steps. Pro mode does 55 steps which results in higher quality videos but will take more time and cost 2x more billing units.
#[serde(skip_serializing_if = "Option::is_none")]
pub pro_mode: Option<bool>,
/// The prompt to generate the video from.
/// "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a dark blue leather jacket, a long pink dress, and bright yellow boots, and carries a black purse."
pub prompt: String,
/// The resolution of the video to generate.
#[serde(skip_serializing_if = "Option::is_none")]
pub resolution: Option<String>,
/// The seed to use for generating the video.
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
/// Strength for Video-to-Video
#[serde(skip_serializing_if = "Option::is_none")]
pub strength: Option<f64>,
/// URL of the video input.
/// "https://storage.googleapis.com/falserverless/hunyuan_video/hunyuan_v2v_input.mp4"
pub video_url: String,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct LoraWeight {
/// URL or the path to the LoRA weights.
pub path: String,
/// The scale of the LoRA weight. This is used to scale the LoRA weight
/// before merging it with the base model.
#[serde(skip_serializing_if = "Option::is_none")]
pub scale: Option<f64>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ValidationError {
pub loc: Vec<serde_json::Value>,
pub msg: String,
#[serde(rename = "type")]
pub ty: String,
}
/// Hunyuan Video LoRA Inference
///
/// Category: text-to-video
/// Machine Type: H100
pub fn hunyuan_video_lora(
params: HunyuanT2VRequest,
) -> FalRequest<HunyuanT2VRequest, HunyuanT2VResponse> {
FalRequest::new("fal-ai/hunyuan-video-lora", params)
}