Instructions to use hanzogak/Freeway_Animation_HunYuan_Demo_comfyui with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use hanzogak/Freeway_Animation_HunYuan_Demo_comfyui with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Upload converter.py
Browse files- converter.py +12 -0
converter.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from safetensors.torch import load_file, save_file
|
| 3 |
+
file_path = "./hunyuan_dit_1.1.safetensors"
|
| 4 |
+
model_path = ("./mp_rank_00_model_states.pt")
|
| 5 |
+
|
| 6 |
+
loaded = load_file(file_path)
|
| 7 |
+
sd = torch.load(model_path, map_location=lambda storage, loc: storage)
|
| 8 |
+
for i in sd["module"]:
|
| 9 |
+
loaded["model."+str(i)] = sd["module"][i]
|
| 10 |
+
|
| 11 |
+
save_file(loaded, "Freeway_Animation_HunYuan_Demo_comfyui.safetensors")
|
| 12 |
+
# manual surgery
|