kundaja-green commited on
Commit
20aa7e9
·
1 Parent(s): 81ae4f9

Final config: Link correct multi-repo model sources

Browse files
Files changed (2) hide show
  1. README.md +3 -5
  2. start.sh +26 -21
README.md CHANGED
@@ -1,13 +1,11 @@
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
 
1
  ---
2
  title: Wan LoRA Trainer
3
  sdk: docker
4
+ # This links the TWO required model repositories.
5
  # Each one will be mounted as a separate folder inside the Space.
6
  models:
7
+ - Wan-AI/Wan2.1-I2V-14B-720P
8
+ - Comfy-Org/Wan_2.1_ComfyUI_repackaged
 
 
9
  ---
10
 
11
  # Wan 2.1 LoRA Trainer
start.sh CHANGED
@@ -1,43 +1,48 @@
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" \
 
1
  #!/bin/bash
2
+ # --- Final Definitive Startup Script (v13 - Correct Multi-Repo Paths) ---
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 from two separate repositories. ---"
9
 
10
+ # --- Define the mount points for each repository ---
11
+ # These names are automatically created by Hugging Face based on the repo names.
12
+ WAN_AI_REPO_DIR="/Wan2.1-I2V-14B-720P"
13
+ COMFY_REPO_DIR="/Wan_2.1_ComfyUI_repackaged"
 
14
  OUTPUT_DIR="/data/output"
15
 
16
+ # --- Define the full, correct paths for each model component ---
17
+ DIT_PATH="$COMFY_REPO_DIR/split_files/diffusion_models/wan2.1_i2v_720p_14B_fp8_e4m3fn.safetensors"
18
+ VAE_PATH="$COMFY_REPO_DIR/split_files/vae/Wan2.1_VAE.pth"
19
+ CLIP_PATH="$WAN_AI_REPO_DIR/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth"
20
+ T5_PATH="$WAN_AI_REPO_DIR/models_t5_umt5-xxl-enc-bf16.pth"
21
+
22
+ echo "DiT Path: $DIT_PATH"
23
+ echo "VAE Path: $VAE_PATH"
24
+ echo "CLIP Path: $CLIP_PATH"
25
+ echo "T5 Path: $T5_PATH"
26
  echo "Output Path: $OUTPUT_DIR"
27
 
28
+ # Verify that key files from both repositories exist
29
+ if [ ! -f "$DIT_PATH" ]; then
30
+ echo "CRITICAL ERROR: DiT model not found. Check README.md linking for 'Comfy-Org/Wan_2.1_ComfyUI_repackaged'."
31
  exit 1
32
  fi
33
+ if [ ! -f "$T5_PATH" ]; then
34
+ echo "CRITICAL ERROR: T5 model not found. Check README.md linking for 'Wan-AI/Wan2.1-I2V-14B-720P'."
35
  exit 1
36
  fi
37
 
38
  echo "All model repositories appear to be linked correctly. Starting training..."
39
+ # Run the training command with the correct paths from each repository
40
  accelerate launch wan_train_network.py \
41
  --task "i2v-14B" \
42
+ --dit "$DIT_PATH" \
43
+ --vae "$VAE_PATH" \
44
+ --clip "$CLIP_PATH" \
45
+ --t5 "$T5_PATH" \
46
  --dataset_config "dataset/testtoml.toml" \
47
  --output_dir "$OUTPUT_DIR" \
48
  --output_name "My_HF_Lora_v1" \