File size: 5,296 Bytes
12819c5
 
 
 
 
 
 
 
 
 
 
 
 
 
3157197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12819c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3157197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12819c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
nautilus sftp://edessale@nexuscfar00.umiacs.umd.edu/fs/vulcan-projects/Force_Learning


/fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun/models/Wan2.1-Fun-V1.1-1.3B-Control-Camera


https://huggingface.co/alibaba-pai/Wan2.2-Fun-5B-Control
https://huggingface.co/alibaba-pai/Wan2.1-Fun-V1.1-1.3B-Control-Camera


export DATASET_NAME=""
export DATASET_META_NAME="/fs/vulcan-projects/Force_Learning/EMG/videoxfun_metadata.json"
export MODEL_NAME="/fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun/models/Wan2.1-Fun-V1.1-1.3B-Control-Camera"

export MODEL_NAME="/fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun/models/Wan2.2-Fun-5B-Control"
export DATASET_NAME=""
export DATASET_META_NAME="/fs/vulcan-projects/Force_Learning/EMG/videoxfun_metadata.json"
accelerate launch --mixed_precision="bf16" scripts/wan2.2_fun/train_control.py \
  --config_path="config/wan2.2/wan_civitai_5b.yaml" \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --train_data_dir=$DATASET_NAME \
  --train_data_meta=$DATASET_META_NAME \
  --image_sample_size=640 \
  --video_sample_size=640 \
  --token_sample_size=640 \
  --video_sample_stride=1 \
  --video_sample_n_frames=49 \
  --train_batch_size=1 \
  --video_repeat=1 \
  --gradient_accumulation_steps=1 \
  --dataloader_num_workers=2 \
  --num_train_epochs=100 \
  --checkpointing_steps=200 \
  --learning_rate=2e-05 \
  --lr_scheduler="constant_with_warmup" \
  --lr_warmup_steps=100 \
  --seed=42 \
  --output_dir="output_dir" \
  --gradient_checkpointing \
  --mixed_precision="bf16" \
  --adam_weight_decay=3e-2 \
  --adam_epsilon=1e-10 \
  --vae_mini_batch=1 \
  --max_grad_norm=0.05 \
  --random_hw_adapt \
  --control_signal_mode emg \
  --training_with_video_token_length \
  --uniform_sampling \
  --boundary_type="full" \
  --train_mode="control_ref" \
  --control_ref_image="first_frame" \
  --add_inpaint_info \
  --add_full_ref_image_in_self_attention \
  --trainable_modules "." 
    
    
    
accelerate launch  --mixed_precision="bf16" scripts/wan2.1_fun/train_control.py \
  --config_path="config/wan2.1/wan_civitai.yaml" \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --train_data_dir=$DATASET_NAME \
  --train_data_meta=$DATASET_META_NAME \
  --image_sample_size=640 \
  --video_sample_size=640 \
  --token_sample_size=640 \
  --video_sample_stride=1 \
  --video_sample_n_frames=49 \
  --train_batch_size=1 \
  --video_repeat=1 \
  --gradient_accumulation_steps=1 \
  --dataloader_num_workers=2 \
  --num_train_epochs=100 \
  --checkpointing_steps=200 \
  --learning_rate=2e-05 \
  --lr_scheduler="constant_with_warmup" \
  --lr_warmup_steps=100 \
  --seed=42 \
  --output_dir="output_dir" \
  --gradient_checkpointing \
  --mixed_precision="bf16" \
  --adam_weight_decay=3e-2 \
  --adam_epsilon=1e-10 \
  --vae_mini_batch=1 \
  --max_grad_norm=0.05 \
  --random_hw_adapt \
  --training_with_video_token_length \
  --uniform_sampling \
  --train_mode="control_ref" \
  --control_ref_image="random" \
  --add_full_ref_image_in_self_attention \
  --trainable_modules "." \
    --profile_timings_every=100 \
  --validation_num_samples 200 \
  --validation_steps 3 \
  --resume_from_checkpoint "/fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun/output_dir/checkpoint-2800"

        
    
cd /fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun

python3 scripts/wan2.1_fun/generate_emg_dataset_wan.py \
  --config_path config/wan2.1/wan_civitai.yaml \
  --pretrained_model_name_or_path "$MODEL_NAME" \
  --transformer_path /fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun/output_dir/checkpoint-2800 \
  --train_data_dir "$DATASET_NAME" \
  --train_data_meta "$DATASET_META_NAME" \
  --image_sample_size 640 \
  --video_sample_size 640 \
  --video_sample_stride 1 \
  --video_sample_n_frames 49 \
  --train_mode "control_ref" \
  --add_full_ref_image_in_self_attention \
  --n_samples 8 \
  --output_dir output_dir/emg_generations
    

export DATASET_NAME=""
export DATASET_META_NAME="/fs/vulcan-projects/Force_Learning/EMG/videoxfun_metadata.json"
export MODEL_NAME="/fs/vulcan-projects/Force_Learning/EMG_Learning/VideoX-Fun/models/Wan2.1-Fun-V1.1-1.3B-Control-Camera"


accelerate launch --mixed_precision="bf16" scripts/wan2.1_fun/train_control_lora.py \
  --config_path="config/wan2.1/wan_civitai.yaml" \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --train_data_dir=$DATASET_NAME \
  --train_data_meta=$DATASET_META_NAME \
  --image_sample_size=640 \
  --video_sample_size=640 \
  --token_sample_size=640 \
  --video_sample_stride=1 \
  --video_sample_n_frames=49 \
  --train_batch_size=4 \
  --video_repeat=1 \
  --gradient_accumulation_steps=1 \
  --dataloader_num_workers=2 \
  --num_train_epochs=100 \
  --checkpointing_steps=200 \
  --learning_rate=1e-04 \
  --seed=42 \
  --output_dir="output_dir" \
  --gradient_checkpointing \
  --mixed_precision="bf16" \
  --adam_weight_decay=3e-2 \
  --adam_epsilon=1e-10 \
  --vae_mini_batch=1 \
  --max_grad_norm=0.05 \
  --random_hw_adapt \
  --training_with_video_token_length \
  --uniform_sampling \
  --train_mode="control_ref" \
  --control_ref_image="random" \
  --add_full_ref_image_in_self_attention \
  --rank=64 \
  --network_alpha=32 \
  --target_name="q,k,v,ffn.0,ffn.2" \
  --use_peft_lora \
  --profile_timings_every=100