Spaces:
Runtime error
Runtime error
kundaja-green
commited on
Commit
·
81ae4f9
1
Parent(s):
170bc28
Final configuration: Link all 4 model repos via README.md
Browse files
README.md
CHANGED
@@ -1,10 +1,19 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
title: wan lora trainer
|
4 |
sdk: docker
|
|
|
|
|
5 |
models:
|
6 |
-
-
|
|
|
|
|
|
|
7 |
---
|
|
|
|
|
|
|
|
|
|
|
8 |
---
|
9 |
# Simple GUI for [Musubi Tuner](https://github.com/kohya-ss/musubi-tuner) (Wan 2.1 models only)
|
10 |
|
@@ -16,57 +25,4 @@ models:
|
|
16 |
|
17 |
- To open the GUI just run `Start_Wan_GUI.bat`.
|
18 |
- All settings can be saved and loaded using the "**Load Settings**" and "**Save Setting**" buttons.
|
19 |
-
- More info about settings see in [Wan2.1 documentation](./docs/wan.md), [Advanced Configuration](./docs/advanced_config.md#fp8-quantization), [Dataset configuration guide](./dataset/dataset_config.md).
|
20 |
-
|
21 |
-
|
22 |
-

|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
# Miscellaneous
|
29 |
-
|
30 |
-
|
31 |
-
## SageAttention Installation
|
32 |
-
|
33 |
-
sdbsd has provided a Windows-compatible SageAttention implementation and pre-built wheels here: https://github.com/sdbds/SageAttention-for-windows. After installing triton, if your Python, PyTorch, and CUDA versions match, you can download and install the pre-built wheel from the [Releases](https://github.com/sdbds/SageAttention-for-windows/releases) page. Thanks to sdbsd for this contribution.
|
34 |
-
|
35 |
-
For reference, the build and installation instructions are as follows. You may need to update Microsoft Visual C++ Redistributable to the latest version.
|
36 |
-
|
37 |
-
1. Download and install triton 3.1.0 wheel matching your Python version from [here](https://github.com/woct0rdho/triton-windows/releases/tag/v3.1.0-windows.post5).
|
38 |
-
|
39 |
-
2. Install Microsoft Visual Studio 2022 or Build Tools for Visual Studio 2022, configured for C++ builds.
|
40 |
-
|
41 |
-
3. Clone the SageAttention repository in your preferred directory:
|
42 |
-
```shell
|
43 |
-
git clone https://github.com/thu-ml/SageAttention.git
|
44 |
-
```
|
45 |
-
|
46 |
-
You can skip step 4 by using the sdbsd repository mentioned above by `git clone https://github.com/sdbds/SageAttention-for-windows.git`.
|
47 |
-
|
48 |
-
4. Open `math.cuh` in the `SageAttention/csrc` folder and change `ushort` to `unsigned short` on lines 71 and 146, then save.
|
49 |
-
|
50 |
-
5. Open `x64 Native Tools Command Prompt for VS 2022` from the Start menu under Visual Studio 2022.
|
51 |
-
|
52 |
-
6. Activate your venv, navigate to the SageAttention folder, and run the following command. If you get a DISTUTILS not configured error, set `set DISTUTILS_USE_SDK=1` and try again:
|
53 |
-
```shell
|
54 |
-
python setup.py install
|
55 |
-
```
|
56 |
-
|
57 |
-
This completes the SageAttention installation.
|
58 |
-
|
59 |
-
### PyTorch version
|
60 |
-
|
61 |
-
If you specify `torch` for `--attn_mode`, use PyTorch 2.5.1 or later (earlier versions may result in black videos).
|
62 |
-
|
63 |
-
If you use an earlier version, use xformers or SageAttention.
|
64 |
-
|
65 |
-
|
66 |
-
# License
|
67 |
-
|
68 |
-
Code under the `hunyuan_model` directory is modified from [HunyuanVideo](https://github.com/Tencent/HunyuanVideo) and follows their license.
|
69 |
-
|
70 |
-
Code under the `wan` directory is modified from [Wan2.1](https://github.com/Wan-Video/Wan2.1). The license is under the Apache License 2.0.
|
71 |
-
|
72 |
-
Other code is under the Apache License 2.0. Some code is copied and modified from Diffusers.
|
|
|
1 |
---
|
2 |
+
title: Wan LoRA Trainer
|
|
|
3 |
sdk: docker
|
4 |
+
# This links all four required model repositories.
|
5 |
+
# Each one will be mounted as a separate folder inside the Space.
|
6 |
models:
|
7 |
+
- wan-video/wan2.1-i2v-14B-fp8-720p
|
8 |
+
- wan-video/wan2.1-vae
|
9 |
+
- wan-video/wan2.1-clip-xlm-roberta
|
10 |
+
- wan-video/wan2.1-t5-xxl
|
11 |
---
|
12 |
+
|
13 |
+
# Wan 2.1 LoRA Trainer
|
14 |
+
|
15 |
+
This Space runs the Wan 2.1 LoRA training script.
|
16 |
+
The required models are linked via the repository configuration above.
|
17 |
---
|
18 |
# Simple GUI for [Musubi Tuner](https://github.com/kohya-ss/musubi-tuner) (Wan 2.1 models only)
|
19 |
|
|
|
25 |
|
26 |
- To open the GUI just run `Start_Wan_GUI.bat`.
|
27 |
- All settings can be saved and loaded using the "**Load Settings**" and "**Save Setting**" buttons.
|
28 |
+
- More info about settings see in [Wan2.1 documentation](./docs/wan.md), [Advanced Configuration](./docs/advanced_config.md#fp8-quantization), [Dataset configuration guide](./dataset/dataset_config.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
start.sh
CHANGED
@@ -1,36 +1,43 @@
|
|
1 |
#!/bin/bash
|
2 |
-
# --- Final
|
3 |
|
4 |
# Exit immediately if a command exits with a non-zero status.
|
5 |
set -e
|
6 |
|
7 |
echo "--- Startup Script Initialized ---"
|
8 |
-
echo "--- Models are mounted by the Space
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
OUTPUT_DIR="/data/output"
|
16 |
|
17 |
-
echo "
|
18 |
-
echo "
|
|
|
|
|
|
|
19 |
|
20 |
-
#
|
21 |
-
if [ ! -f "$
|
22 |
-
echo "CRITICAL ERROR:
|
|
|
|
|
|
|
|
|
23 |
exit 1
|
24 |
fi
|
25 |
|
26 |
-
|
27 |
-
|
28 |
accelerate launch wan_train_network.py \
|
29 |
--task "i2v-14B" \
|
30 |
-
--dit "$
|
31 |
-
--vae "$
|
32 |
-
--clip "$
|
33 |
-
--t5 "$
|
34 |
--dataset_config "dataset/testtoml.toml" \
|
35 |
--output_dir "$OUTPUT_DIR" \
|
36 |
--output_name "My_HF_Lora_v1" \
|
|
|
1 |
#!/bin/bash
|
2 |
+
# --- Final Definitive Startup Script (v11) ---
|
3 |
|
4 |
# Exit immediately if a command exits with a non-zero status.
|
5 |
set -e
|
6 |
|
7 |
echo "--- Startup Script Initialized ---"
|
8 |
+
echo "--- Models are mounted by the Space from multiple repositories. ---"
|
9 |
|
10 |
+
# --- Define the correct paths for each mounted model repository ---
|
11 |
+
DIT_DIR="/wan2.1-i2v-14B-fp8-720p"
|
12 |
+
VAE_DIR="/wan2.1-vae"
|
13 |
+
CLIP_DIR="/wan2.1-clip-xlm-roberta"
|
14 |
+
T5_DIR="/wan2.1-t5-xxl"
|
15 |
OUTPUT_DIR="/data/output"
|
16 |
|
17 |
+
echo "DiT Path: $DIT_DIR"
|
18 |
+
echo "VAE Path: $VAE_DIR"
|
19 |
+
echo "CLIP Path: $CLIP_DIR"
|
20 |
+
echo "T5 Path: $T5_DIR"
|
21 |
+
echo "Output Path: $OUTPUT_DIR"
|
22 |
|
23 |
+
# For robust verification, check for the existence of one file from each repo
|
24 |
+
if [ ! -f "$DIT_DIR/wan2.1_i2v_720p_14B_fp8_e4m3fn.safetensors" ]; then
|
25 |
+
echo "CRITICAL ERROR: DiT model not found. Check README.md linking for 'wan-video/wan2.1-i2v-14B-fp8-720p'."
|
26 |
+
exit 1
|
27 |
+
fi
|
28 |
+
if [ ! -f "$VAE_DIR/Wan2.1_VAE.pth" ]; then
|
29 |
+
echo "CRITICAL ERROR: VAE model not found. Check README.md linking for 'wan-video/wan2.1-vae'."
|
30 |
exit 1
|
31 |
fi
|
32 |
|
33 |
+
echo "All model repositories appear to be linked correctly. Starting training..."
|
34 |
+
# Run the training command with the correct paths
|
35 |
accelerate launch wan_train_network.py \
|
36 |
--task "i2v-14B" \
|
37 |
+
--dit "$DIT_DIR/wan2.1_i2v_720p_14B_fp8_e4m3fn.safetensors" \
|
38 |
+
--vae "$VAE_DIR/Wan2.1_VAE.pth" \
|
39 |
+
--clip "$CLIP_DIR/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth" \
|
40 |
+
--t5 "$T5_DIR/models_t5_umt5-xxl-enc-bf16.pth" \
|
41 |
--dataset_config "dataset/testtoml.toml" \
|
42 |
--output_dir "$OUTPUT_DIR" \
|
43 |
--output_name "My_HF_Lora_v1" \
|