a-r-r-o-w HF Staff commited on
Commit
5b652fb
·
verified ·
1 Parent(s): 62b50eb

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -0
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - tencent/HunyuanVideo-I2V
4
+ library_name: diffusers
5
+ ---
6
+
7
+ Unofficial community fork for Diffusers-format weights on [`tencent/HunyuanVideo-I2V`](https://huggingface.co/tencent/HunyuanVideo-I2V).
8
+
9
+ ### Using Diffusers
10
+
11
+ HunyuanVideo-I2V can be used directly from Diffusers. Install the latest version of Diffusers.
12
+
13
+ ```python
14
+ import torch
15
+ from diffusers import HunyuanVideoImageToVideoPipeline, HunyuanVideoTransformer3DModel
16
+ from diffusers.utils import load_image, export_to_video
17
+
18
+ model_id = "hunyuanvideo-community/HunyuanVideo-I2V"
19
+ transformer = HunyuanVideoTransformer3DModel.from_pretrained(
20
+ model_id, subfolder="transformer", torch_dtype=torch.bfloat16
21
+ )
22
+ pipe = HunyuanVideoImageToVideoPipeline.from_pretrained(
23
+ model_id, transformer=transformer, torch_dtype=torch.float16
24
+ )
25
+ pipe.vae.enable_tiling()
26
+ pipe.to("cuda")
27
+
28
+ prompt = "A man with short gray hair plays a red electric guitar."
29
+ image = load_image(
30
+ "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
31
+ )
32
+
33
+ output = pipe(image=image, prompt=prompt).frames[0]
34
+ export_to_video(output, "output.mp4", fps=15)
35
+ ```
36
+
37
+ Refer to the [documentation](https://huggingface.co/docs/diffusers/main/en/api/pipelines/hunyuan_video) for more information.
38
+