svjack commited on
Commit
1d59c72
·
verified ·
1 Parent(s): 0a77c36

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +230 -0
README.md ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## HunyuanVideo t2v lora tuned by
2
+ ## https://huggingface.co/datasets/svjack/Genshin-Impact-XiangLing-animatediff-with-score-organized-Low-Resolution
3
+ ## In early step
4
+
5
+ ## Installation
6
+
7
+ ### Prerequisites
8
+
9
+ Before you begin, ensure you have the following installed:
10
+
11
+ - `git-lfs`
12
+ - `cbm`
13
+ - `ffmpeg`
14
+
15
+ You can install these prerequisites using the following command:
16
+
17
+ ```bash
18
+ sudo apt-get update && sudo apt-get install git-lfs cbm ffmpeg
19
+ ```
20
+
21
+ ### Installation Steps
22
+
23
+ 1. **Install `comfy-cli`:**
24
+
25
+ ```bash
26
+ pip install comfy-cli
27
+ ```
28
+
29
+ 2. **Initialize ComfyUI:**
30
+
31
+ ```bash
32
+ comfy --here install
33
+ ```
34
+
35
+ 3. **Clone and Install ComfyScript:**
36
+
37
+ ```bash
38
+ cd ComfyUI/custom_nodes
39
+ git clone https://github.com/Chaoses-Ib/ComfyScript.git
40
+ cd ComfyScript
41
+ pip install -e ".[default,cli]"
42
+ pip uninstall aiohttp
43
+ pip install -U aiohttp
44
+ ```
45
+
46
+ 4. **Clone and Install ComfyUI-HunyuanVideoWrapper:**
47
+
48
+ ```bash
49
+ cd ../
50
+ git clone https://github.com/svjack/ComfyUI-HunyuanVideoWrapper
51
+ cd ComfyUI-HunyuanVideoWrapper
52
+ pip install -r requirements.txt
53
+ ```
54
+
55
+ 5. **Load ComfyScript Runtime:**
56
+
57
+ ```python
58
+ from comfy_script.runtime import *
59
+ load()
60
+ from comfy_script.runtime.nodes import *
61
+ ```
62
+
63
+ 6. **Install Example Dependencies:**
64
+
65
+ ```bash
66
+ cd examples
67
+ comfy node install-deps --workflow='hunyuanvideo lora Walking Animation Share.json'
68
+ ```
69
+
70
+ 7. **Update ComfyUI Dependencies:**
71
+
72
+ ```bash
73
+ cd ../../ComfyUI
74
+ pip install --upgrade torch torchvision torchaudio -r requirements.txt
75
+ ```
76
+
77
+ 8. **Transpile Example Workflow:**
78
+
79
+ ```bash
80
+ python -m comfy_script.transpile hyvideo_t2v_example_01.json
81
+ ```
82
+
83
+ 9. **Download and Place Model Files:**
84
+
85
+ Download the required model files from Hugging Face:
86
+
87
+ ```bash
88
+ huggingface-cli download Kijai/HunyuanVideo_comfy --local-dir ./HunyuanVideo_comfy
89
+ ```
90
+
91
+ Copy the downloaded files to the appropriate directories:
92
+
93
+ ```bash
94
+ cp -r HunyuanVideo_comfy/ .
95
+ cp HunyuanVideo_comfy/hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors ComfyUI/models/diffusion_models
96
+ cp HunyuanVideo_comfy/hunyuan_video_vae_bf16.safetensors ComfyUI/models/vae
97
+ ```
98
+
99
+ ### Genshin Impact Character XiangLing LoRA Example (early tuned version)
100
+
101
+ 10. **Download the Makima LoRA Model:**
102
+
103
+ Download the Makima LoRA model from Huggingface:
104
+
105
+ - [Xiangling Character LoRA](https://huggingface.co/svjack/Genshin_Impact_XiangLing_Low_Res_HunyuanVideo_lora_early/)
106
+
107
+ ```bash
108
+ xiangling_ep2_lora.safetensors
109
+ ```
110
+
111
+ Copy the model to the `loras` directory:
112
+
113
+ ```bash
114
+ cp xiangling_ep2_lora.safetensors ComfyUI/models/loras
115
+ ```
116
+
117
+ 11. **Run the Workflow:**
118
+
119
+ Create a Python script `run_t2v_xiangling_lora.py`:
120
+
121
+ ```python
122
+ #### cook rice
123
+ from comfy_script.runtime import *
124
+ load()
125
+ from comfy_script.runtime.nodes import *
126
+ with Workflow():
127
+ vae = HyVideoVAELoader(r'hunyuan_video_vae_bf16.safetensors', 'bf16', None)
128
+ lora = HyVideoLoraSelect('xiangling_ep2_lora.safetensors', 2.0, None, None)
129
+ model = HyVideoModelLoader(r'hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors', 'bf16', 'fp8_e4m3fn', 'offload_device', 'sdpa', None, None, lora)
130
+ hyvid_text_encoder = DownloadAndLoadHyVideoTextEncoder('Kijai/llava-llama-3-8b-text-encoder-tokenizer', 'openai/clip-vit-large-patch14', 'fp16', False, 2, 'disabled')
131
+ hyvid_embeds = HyVideoTextEncode(hyvid_text_encoder, "solo,Xiangling, cook rice in a pot, (genshin impact) ,1girl,highres, dynamic", 'bad quality video', 'video', None, None, None)
132
+ samples = HyVideoSampler(model, hyvid_embeds, 478, 512, 49, 25, 8, 9, 42, 1, None, 1, None)
133
+ images = HyVideoDecode(vae, samples, True, 64, 256, True)
134
+ #_ = VHSVideoCombine(images, 24, 0, 'HunyuanVideo', 'video/h264-mp4', False, True, None, None, None)
135
+ _ = VHSVideoCombine(images, 24, 0, 'HunyuanVideo', 'video/h264-mp4', False, True, None, None, None,
136
+ pix_fmt = 'yuv420p', crf=19, save_metadata = True, trim_to_audio = False)
137
+ ```
138
+
139
+ Run the script:
140
+
141
+ ```bash
142
+ python run_t2v_xiangling_lora.py
143
+ ```
144
+
145
+ <br/>
146
+
147
+ - prompt = "solo,Xiangling, cook rice in a pot, (genshin impact) ,1girl,highres, dynamic"
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <br/>
155
+
156
+
157
+ ```python
158
+ #### drink water
159
+ from comfy_script.runtime import *
160
+ load()
161
+ from comfy_script.runtime.nodes import *
162
+ with Workflow():
163
+ vae = HyVideoVAELoader(r'hunyuan_video_vae_bf16.safetensors', 'bf16', None)
164
+ lora = HyVideoLoraSelect('xiangling_ep2_lora.safetensors', 2.0, None, None)
165
+ model = HyVideoModelLoader(r'hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors', 'bf16', 'fp8_e4m3fn', 'offload_device', 'sdpa', None, None, lora)
166
+ hyvid_text_encoder = DownloadAndLoadHyVideoTextEncoder('Kijai/llava-llama-3-8b-text-encoder-tokenizer', 'openai/clip-vit-large-patch14', 'fp16', False, 2, 'disabled')
167
+ hyvid_embeds = HyVideoTextEncode(hyvid_text_encoder,
168
+ "solo,Xiangling, drink water, (genshin impact) ,1girl,highres, dynamic",
169
+ 'bad quality video', 'video', None, None, None)
170
+ samples = HyVideoSampler(model, hyvid_embeds, 512, 512, 49, 30, 8, 9, 42, 1, None, 1, None)
171
+ images = HyVideoDecode(vae, samples, True, 64, 256, True)
172
+ #_ = VHSVideoCombine(images, 24, 0, 'HunyuanVideo', 'video/h264-mp4', False, True, None, None, None)
173
+ _ = VHSVideoCombine(images, 24, 0, 'HunyuanVideo', 'video/h264-mp4', False, True, None, None, None,
174
+ pix_fmt = 'yuv420p', crf=19, save_metadata = True, trim_to_audio = False)
175
+ ```
176
+
177
+ Run the script:
178
+
179
+ ```bash
180
+ python run_t2v_xiangling_lora.py
181
+ ```
182
+
183
+ <br/>
184
+
185
+ - prompt = "solo,Xiangling, drink water, (genshin impact) ,1girl,highres, dynamic"
186
+
187
+
188
+
189
+
190
+
191
+
192
+ <br/>
193
+
194
+
195
+ ```python
196
+ #### eat bread
197
+ from comfy_script.runtime import *
198
+ load()
199
+ from comfy_script.runtime.nodes import *
200
+ with Workflow():
201
+ vae = HyVideoVAELoader(r'hunyuan_video_vae_bf16.safetensors', 'bf16', None)
202
+ lora = HyVideoLoraSelect('xiangling_ep2_lora.safetensors', 2.0, None, None)
203
+ model = HyVideoModelLoader(r'hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors', 'bf16', 'fp8_e4m3fn', 'offload_device', 'sdpa', None, None, lora)
204
+ hyvid_text_encoder = DownloadAndLoadHyVideoTextEncoder('Kijai/llava-llama-3-8b-text-encoder-tokenizer', 'openai/clip-vit-large-patch14', 'fp16', False, 2, 'disabled')
205
+ hyvid_embeds = HyVideoTextEncode(hyvid_text_encoder,
206
+ "solo,Xiangling, eat bread, (genshin impact) ,1girl,highres, dynamic",
207
+ 'bad quality video', 'video', None, None, None)
208
+ samples = HyVideoSampler(model, hyvid_embeds, 512, 512, 49, 30, 10, 20, 42, 1, None, 1, None)
209
+ images = HyVideoDecode(vae, samples, True, 64, 256, True)
210
+ #_ = VHSVideoCombine(images, 24, 0, 'HunyuanVideo', 'video/h264-mp4', False, True, None, None, None)
211
+ _ = VHSVideoCombine(images, 24, 0, 'HunyuanVideo', 'video/h264-mp4', False, True, None, None, None,
212
+ pix_fmt = 'yuv420p', crf=19, save_metadata = True, trim_to_audio = False)
213
+ ```
214
+
215
+ Run the script:
216
+
217
+ ```bash
218
+ python run_t2v_xiangling_lora.py
219
+ ```
220
+
221
+ <br/>
222
+
223
+ - prompt = "solo,Xiangling, eat bread, (genshin impact) ,1girl,highres, dynamic"
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <br/>