kundaja-green commited on
Commit
a723a7c
·
1 Parent(s): 00496ae

Update start.sh to use correct model filenames from dedicated repo

Browse files
Files changed (1) hide show
  1. start.sh +39 -27
start.sh CHANGED
@@ -1,45 +1,57 @@
1
  #!/bin/bash
 
2
 
3
- # --- Final Definitive Startup Script (v21 - Points directly to the single DiT file) ---
4
-
5
- # Exit immediately if a command exits with a non-zero status.
6
  set -e
7
-
8
  echo "--- Startup Script Initialized ---"
9
- echo "--- Models are mounted from two separate repositories. ---"
10
 
11
- # --- Define the mount points for each repository ---
12
- WAN_AI_REPO_DIR="/Wan-AI/Wan2.1-I2V-14B-720P"
13
- COMFY_REPO_DIR="/Comfy-Org/Wan_2.1_ComfyUI_repackaged"
 
 
 
 
 
 
14
  OUTPUT_DIR="/data/output"
15
 
 
 
16
 
17
- # --- Define the full, correct paths for each model component ---
18
- # The DiT model is a single file, so we point directly to its location.
19
- DIT_PATH="${COMFY_REPO_DIR}/split_files/diffusion_models/wan2.1_i2v_720p_14B_fp8_e4m3fn.safetensors"
20
- VAE_PATH="${WAN_AI_REPO_DIR}/Wan2.1-VAE.pth"
21
- CLIP_PATH="${WAN_AI_REPO_DIR}/models/clip_open-clip-xlm-roberta-large-vit-huge-14.pth"
22
- T5_PATH="${WAN_AI_REPO_DIR}/models/t5_umt5-xxl-enc-bf16.pth"
23
 
24
- echo "DiT Path: $DIT_PATH"
25
- echo "VAE Path: $VAE_PATH"
26
- echo "CLIP Path: $CLIP_PATH"
27
- echo "T5 Path: $T5_PATH"
28
- echo "Output Path: $OUTPUT_DIR"
 
29
 
30
- # --- Verify that key files from both repositories exist ---
31
- if [ ! -f "$DIT_PATH" ]; then
32
- echo "CRITICAL ERROR: DiT model not found. Check the path in start.sh and the 'Comfy-Org/Wan_2.1_ComfyUI_repackaged' repository link."
33
- exit 1
 
 
34
  fi
35
 
36
  if [ ! -f "$T5_PATH" ]; then
37
- echo "CRITICAL ERROR: T5 model not found. Check the path in start.sh and the 'Wan-AI/Wan2.1-I2V-14B-720P' repository link."
38
- exit 1
 
 
 
39
  fi
40
 
41
- echo "--- All model repositories appear to be linked correctly. Starting training... ---"
42
- # --- Run the training command with the correct paths from each repository ---
 
 
43
  accelerate launch wan_train_network.py \
44
  --task="i2v-lora" \
45
  --dit="$DIT_PATH" \
 
1
  #!/bin/bash
2
+ # --- Final Definitive Startup Script (v23.2 - Uses USER-VERIFIED filenames) ---
3
 
 
 
 
4
  set -e
 
5
  echo "--- Startup Script Initialized ---"
 
6
 
7
+ # --- Define where models will be downloaded ---
8
+ MODELS_DIR="/data/models"
9
+ mkdir -p $MODELS_DIR # Create the directory if it doesn't exist
10
+
11
+ # --- Define paths to the model files with CORRECTED names ---
12
+ DIT_PATH="$MODELS_DIR/wan2.1_i2v_720p_14B_fp8_e4m3fn.safetensors"
13
+ VAE_PATH="$MODELS_DIR/Wan2.1_VAE.pth"
14
+ CLIP_PATH="$MODELS_DIR/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth" # CORRECTED FILENAME
15
+ T5_PATH="$MODELS_DIR/models_t5_umt5-xxl-enc-bf16.pth" # CORRECTED FILENAME
16
  OUTPUT_DIR="/data/output"
17
 
18
+ # --- Download models from our dedicated model repo IF they don't already exist ---
19
+ echo "--- Checking for model files... ---"
20
 
21
+ if [ ! -f "$DIT_PATH" ]; then
22
+ echo "Downloading DiT model from jujutechnology/WANfortraining..."
23
+ huggingface-cli download jujutechnology/WANfortraining wan2.1_i2v_720p_14B_fp8_e4m3fn.safetensors --local-dir $MODELS_DIR --local-dir-use-symlinks False
24
+ else
25
+ echo "DiT model already exists."
26
+ fi
27
 
28
+ if [ ! -f "$VAE_PATH" ]; then
29
+ echo "Downloading VAE model from jujutechnology/WANfortraining..."
30
+ huggingface-cli download jujutechnology/WANfortraining Wan2.1_VAE.pth --local-dir $MODELS_DIR --local-dir-use-symlinks False
31
+ else
32
+ echo "VAE model already exists."
33
+ fi
34
 
35
+ if [ ! -f "$CLIP_PATH" ]; then
36
+ echo "Downloading CLIP model from jujutechnology/WANfortraining..."
37
+ # CORRECTED FILENAME in download command
38
+ huggingface-cli download jujutechnology/WANfortraining models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth --local-dir $MODELS_DIR --local-dir-use-symlinks False
39
+ else
40
+ echo "CLIP model already exists."
41
  fi
42
 
43
  if [ ! -f "$T5_PATH" ]; then
44
+ echo "Downloading T5 model from jujutechnology/WANfortraining..."
45
+ # CORRECTED FILENAME in download command
46
+ huggingface-cli download jujutechnology/WANfortraining models_t5_umt5-xxl-enc-bf16.pth --local-dir $MODELS_DIR --local-dir-use-symlinks False
47
+ else
48
+ echo "T5 model already exists."
49
  fi
50
 
51
+ echo "--- All models are present. Starting training... ---"
52
+ ls -lh $MODELS_DIR # List the downloaded files to confirm
53
+
54
+ # --- Run the training command ---
55
  accelerate launch wan_train_network.py \
56
  --task="i2v-lora" \
57
  --dit="$DIT_PATH" \