run_hunyuan_t2v_dist.sh 1.32 KB
Newer Older
helloyongyang's avatar
update  
helloyongyang committed
1
#!/bin/bash
Xinchi Huang's avatar
Xinchi Huang committed
2

3
4
5
6
7
8
# set path and first
lightx2v_path=""
model_path=""

# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
helloyongyang's avatar
helloyongyang committed
9
10
    cuda_devices=0,1,2,3
    echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: ${cuda_devices}, change at shell script or set env variable."
11
12
    export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
Xinchi Huang's avatar
Xinchi Huang committed
13

14
15
16
17
if [ -z "${lightx2v_path}" ]; then
    echo "Error: lightx2v_path is not set. Please set this variable first."
    exit 1
fi
helloyongyang's avatar
update  
helloyongyang committed
18

19
20
21
22
23
if [ -z "${model_path}" ]; then
    echo "Error: model_path is not set. Please set this variable first."
    exit 1
fi

24
25
export TOKENIZERS_PARALLELISM=false

26
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
helloyongyang's avatar
update  
helloyongyang committed
27

28
export ENABLE_PROFILING_DEBUG=true
helloyongyang's avatar
update  
helloyongyang committed
29
30

torchrun --nproc_per_node=4 ${lightx2v_path}/lightx2v/__main__.py \
Xinchi Huang's avatar
Xinchi Huang committed
31
--model_cls hunyuan \
helloyongyang's avatar
helloyongyang committed
32
--task t2v \
Xinchi Huang's avatar
Xinchi Huang committed
33
--model_path $model_path \
helloyongyang's avatar
helloyongyang committed
34
--config_json ${lightx2v_path}/configs/dist/hunyuan_t2v_dist_ulysses.json \
Xinchi Huang's avatar
Xinchi Huang committed
35
--prompt "A cat walks on the grass, realistic style." \
Xinchi Huang's avatar
Xinchi Huang committed
36
37
38
39
--save_video_path ./output_lightx2v_hunyuan_t2v_dist_ulysses.mp4

torchrun --nproc_per_node=4 ${lightx2v_path}/lightx2v/__main__.py \
--model_cls hunyuan \
helloyongyang's avatar
helloyongyang committed
40
--task t2v \
Xinchi Huang's avatar
Xinchi Huang committed
41
--model_path $model_path \
helloyongyang's avatar
helloyongyang committed
42
--config_json ${lightx2v_path}/configs/dist/hunyuan_t2v_dist_ring.json \
Xinchi Huang's avatar
Xinchi Huang committed
43
44
--prompt "A cat walks on the grass, realistic style." \
--save_video_path ./output_lightx2v_hunyuan_t2v_dist_ring.mp4