Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
base_model:
|
6 |
+
- Wan-AI/Wan2.1-I2V-14B-720P
|
7 |
+
- Wan-AI/Wan2.1-I2V-14B-720P-Diffusers
|
8 |
+
pipeline_tag: image-to-video
|
9 |
+
tags:
|
10 |
+
- text-to-image
|
11 |
+
- lora
|
12 |
+
- diffusers
|
13 |
+
- template:diffusion-lora
|
14 |
+
widget:
|
15 |
+
- text: >-
|
16 |
+
dajia,这是一个两个人对打得视频,镜头拉远,保持人物不变,这两个人开始对打,两个人不断旋转,拳打脚踢,姿势像是传统武术,
|
17 |
+
十分专业,两个人相互比试,打的有来有回,突然左边的人腾空跳起,保持飞在空中用腿不停踢另一个人上半身,
|
18 |
+
男人被踢得一边用手阻挡女人的飞踢一边后退,镜头跟随,保持背景和人物的服装不改变.
|
19 |
+
output:
|
20 |
+
url: result/people_fight1.mp4
|
21 |
+
- text: >-
|
22 |
+
dajia,这是一对情侣对打得视频,镜头拉远,保持人物不变,这两个人开始对打,两个人不断旋转,拳打脚踢,姿势像是传统武术,
|
23 |
+
十分专业,两个人相互比试,打的有来有回,突然左边的人腾空跳起,保持飞在空中用腿不停踢另一个人上半身,
|
24 |
+
男人被踢得一边用手阻挡女人的飞踢一边后退,镜头跟随,保持背景和人物的服装不改变。
|
25 |
+
output:
|
26 |
+
url: result/people_fight2.mp4
|
27 |
+
- text: >-
|
28 |
+
dajia,这是一对闺蜜对打得视频,镜头拉远,保持人物不变,这两个人开始对打,两个人不断旋转,拳打脚踢,姿势像是传统武术,
|
29 |
+
十分专业,两个人相互比试,打的有来有回,突然右边的人腾空跳起,保持飞在空中用腿不停踢另一个人上半身,
|
30 |
+
右边的女人被踢得一边用手阻挡女人的飞踢一边后退,镜头跟随,保持背景和人物的服装不改变。
|
31 |
+
output:
|
32 |
+
url: result/people_fight3.mp4
|
33 |
+
|
34 |
+
---
|
35 |
+
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
36 |
+
<h1 style="color: #24292e; margin-top: 0;">valiantcat LoRA for Wan2.1 14B I2V 720p</h1>
|
37 |
+
|
38 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
39 |
+
<h2 style="color: #24292e; margin-top: 0;">Overview</h2>
|
40 |
+
<p>This LoRA is trained on the Wan2.1 14B I2V 720p model.</p>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
44 |
+
<h2 style="color: #24292e; margin-top: 0;">Features</h2>
|
45 |
+
<ul style="margin-bottom: 0;">
|
46 |
+
<li>Transform any image into a video of two people began to fight</li>
|
47 |
+
<li>Trained on the Wan2.1 14B 720p I2V base model</li>
|
48 |
+
<li>Consistent results across different object types</li>
|
49 |
+
<li>Simple prompt structure that's easy to adapt</li>
|
50 |
+
</ul>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
54 |
+
<h2 style="color: #24292e; margin-top: 0;">Community</h2>
|
55 |
+
<ul style="margin-bottom: 0;">
|
56 |
+
<li>
|
57 |
+
<b>Company:</b>
|
58 |
+
<a href="https://www.vvicat.com/" style="color: #0366d6; text-decoration: none;">
|
59 |
+
Join us to generate interesting video models together
|
60 |
+
</a> to generate videos with this LoRA for free
|
61 |
+
</li>
|
62 |
+
</ul>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<Gallery />
|
66 |
+
|
67 |
+
# Model File and Inference Workflow
|
68 |
+
|
69 |
+
## 📥 Download Links:
|
70 |
+
|
71 |
+
- [wan2.1-divine-power.safetensors](./divine-power.safetensors) - LoRA Model File
|
72 |
+
- [wan_img2video_lora_workflow.json](./result/wan2.1-exmple.json) - Wan I2V with LoRA Workflow for ComfyUI
|
73 |
+
|
74 |
+
## Using with Diffusers
|
75 |
+
```py
|
76 |
+
pip install git+https://github.com/huggingface/diffusers.git
|
77 |
+
```
|
78 |
+
|
79 |
+
```py
|
80 |
+
import torch
|
81 |
+
from diffusers.utils import export_to_video, load_image
|
82 |
+
from diffusers import AutoencoderKLWan, WanImageToVideoPipeline
|
83 |
+
from transformers import CLIPVisionModel
|
84 |
+
import numpy as np
|
85 |
+
|
86 |
+
model_id = "Wan-AI/Wan2.1-I2V-14B-720P-Diffusers"
|
87 |
+
image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", torch_dtype=torch.float32)
|
88 |
+
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
|
89 |
+
pipe = WanImageToVideoPipeline.from_pretrained(model_id, vae=vae, image_encoder=image_encoder, torch_dtype=torch.bfloat16)
|
90 |
+
pipe.to("cuda")
|
91 |
+
|
92 |
+
pipe.load_lora_weights("valiantcat/Wan2.1-Fight-LoRA")
|
93 |
+
|
94 |
+
pipe.enable_model_cpu_offload() #for low-vram environments
|
95 |
+
|
96 |
+
prompt = "faxiang,背景保持不变,这个女人双手合十,身后出现巨大半透明粉色虚影法相,与女人动作同步."
|
97 |
+
|
98 |
+
image = load_image("https://huggingface.co/valiantcat/Wan2.1-Fight-LoRA/blob/main/result/test.jpg")
|
99 |
+
|
100 |
+
max_area = 512 * 768
|
101 |
+
aspect_ratio = image.height / image.width
|
102 |
+
mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
|
103 |
+
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
|
104 |
+
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
|
105 |
+
image = image.resize((width, height))
|
106 |
+
|
107 |
+
output = pipe(
|
108 |
+
image=image,
|
109 |
+
prompt=prompt,
|
110 |
+
height=height,
|
111 |
+
width=width,
|
112 |
+
num_frames=81,
|
113 |
+
guidance_scale=5.0,
|
114 |
+
num_inference_steps=25
|
115 |
+
).frames[0]
|
116 |
+
export_to_video(output, "output.mp4", fps=16)
|
117 |
+
```
|
118 |
+
|
119 |
+
---
|
120 |
+
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 10px; margin-bottom: 20px;">
|
121 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
122 |
+
<h2 style="color: #24292e; margin-top: 0;">Recommended Settings</h2>
|
123 |
+
<ul style="margin-bottom: 0;">
|
124 |
+
<li><b>LoRA Strength:</b> 1.0</li>
|
125 |
+
<li><b>Embedded Guidance Scale:</b> 6.0</li>
|
126 |
+
<li><b>Flow Shift:</b> 5.0</li>
|
127 |
+
</ul>
|
128 |
+
</div>
|
129 |
+
|
130 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
131 |
+
<h2 style="color: #24292e; margin-top: 0;">Trigger Words</h2>
|
132 |
+
<p>The key trigger phrase is: <code style="background-color: #f0f0f0; padding: 3px 6px; border-radius: 4px;">dajia</code></p>
|
133 |
+
</div>
|
134 |
+
|
135 |
+
<div style="background-color: white; padding: 15px; border-radius: 8px; margin: 15px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
|
136 |
+
<h2 style="color: #24292e; margin-top: 0;">Prompt Template</h2>
|
137 |
+
<p>For best results, use this prompt structure:</p>
|
138 |
+
<div style="background-color: #f0f0f0; padding: 12px; border-radius: 6px; margin: 10px 0;">
|
139 |
+
<i>faxiang,背景保持不变,[gender]双手合十,身后出现巨大半透明粉色虚影法相,与[gender]动作同步。</i>
|
140 |
+
</div>
|
141 |
+
<p>Simply replace <code style="background-color: #f0f0f0; padding: 3px 6px; border-radius: 4px;">[gender]</code> with whatever you want to let this person manifest their supernatural powers!</p>
|
142 |
+
</div>
|