run_hunyuan_i2v.sh 1.08 KB
Newer Older
helloyongyang's avatar
helloyongyang committed
1
2
3
#!/bin/bash

# set path and first
helloyongyang's avatar
helloyongyang committed
4
5
lightx2v_path=
model_path=
helloyongyang's avatar
helloyongyang committed
6
7
8

# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
9
    cuda_devices=0
helloyongyang's avatar
helloyongyang committed
10
    echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: ${cuda_devices}, change at shell script or set env variable."
helloyongyang's avatar
helloyongyang committed
11
12
13
14
15
16
17
18
19
20
21
22
23
    export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi

if [ -z "${lightx2v_path}" ]; then
    echo "Error: lightx2v_path is not set. Please set this variable first."
    exit 1
fi

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

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

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

helloyongyang's avatar
helloyongyang committed
31
python -m lightx2v \
helloyongyang's avatar
helloyongyang committed
32
33
--model_cls hunyuan \
--task i2v \
helloyongyang's avatar
helloyongyang committed
34
35
--model_path $model_path \
--config_json ${lightx2v_path}/configs/hunyuan_i2v.json \
helloyongyang's avatar
helloyongyang committed
36
37
--prompt "An Asian man with short hair in black tactical uniform and white clothes waves a firework stick." \
--image_path ${lightx2v_path}/assets/inputs/imgs/img_1.jpg \
helloyongyang's avatar
helloyongyang committed
38
--save_video_path ${lightx2v_path}/save_results/output_lightx2v_hy_i2v.mp4