Fabrice-TIERCELIN
commited on
Upload __init__.py
Browse files- hyvideo/__init__.py +26 -0
hyvideo/__init__.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .models import HYVideoDiffusionTransformer, HUNYUAN_VIDEO_CONFIG
|
2 |
+
|
3 |
+
|
4 |
+
def load_model(args, in_channels, out_channels, factor_kwargs):
|
5 |
+
"""load hunyuan video model
|
6 |
+
|
7 |
+
Args:
|
8 |
+
args (dict): model args
|
9 |
+
in_channels (int): input channels number
|
10 |
+
out_channels (int): output channels number
|
11 |
+
factor_kwargs (dict): factor kwargs
|
12 |
+
|
13 |
+
Returns:
|
14 |
+
model (nn.Module): The hunyuan video model
|
15 |
+
"""
|
16 |
+
if args.model in HUNYUAN_VIDEO_CONFIG.keys():
|
17 |
+
model = HYVideoDiffusionTransformer(
|
18 |
+
args,
|
19 |
+
in_channels=in_channels,
|
20 |
+
out_channels=out_channels,
|
21 |
+
**HUNYUAN_VIDEO_CONFIG[args.model],
|
22 |
+
**factor_kwargs,
|
23 |
+
)
|
24 |
+
return model
|
25 |
+
else:
|
26 |
+
raise NotImplementedError()
|