forked from kohya-ss/musubi-tuner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfer_rotate5_lightning.sh
More file actions
60 lines (50 loc) · 1.88 KB
/
Copy pathinfer_rotate5_lightning.sh
File metadata and controls
60 lines (50 loc) · 1.88 KB
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
#!/bin/bash
# Wan2.2 I2V Lightning LoRA 推理 - rotate 测试集
# 使用 Lightning merged 权重 + content LoRA,4步推理
set -e
CUDA_VISIBLE_DEVICES=7
PROJECT_DIR="/home/xianwei_wei/code/musubi-tuner"
VENV="/data/xianwei_wei/musubi-venv"
MERGED_DIR="/data/xianwei_wei/models/wan2.2/lightning_merged"
MODEL_DIR="/data/xianwei_wei/models/wan2.2"
DIT_LOW="${MERGED_DIR}/wan2.2_i2v_low_noise_14B_lightning.safetensors"
DIT_HIGH="${MERGED_DIR}/wan2.2_i2v_high_noise_14B_lightning.safetensors"
VAE="${MODEL_DIR}/Wan2.1_VAE.pth"
T5="${MODEL_DIR}/models_t5_umt5-xxl-enc-bf16.pth"
CLIP="${MODEL_DIR}/models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth"
LORA="/home/xianwei_wei/outputs/wan22_i2v_rotate5_lightning/wan22_i2v_rotate5_lightning.safetensors"
IMAGE_DIR="/home/xianwei_wei/code/resource/rotate/image"
OUTPUT_DIR="/home/xianwei_wei/outputs/wan22_i2v_rotate5_lightning/infer_results"
mkdir -p "${OUTPUT_DIR}"
source "${VENV}/bin/activate"
PROMPT="A 3D object rotating smoothly in place"
for img in "${IMAGE_DIR}"/*.jpg; do
name=$(basename "${img}" .jpg)
out_path="${OUTPUT_DIR}/${name}.mp4"
if [ -f "${out_path}" ]; then
echo "Skip ${name}"
continue
fi
echo "Generating ${name}..."
CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES} python3 "${PROJECT_DIR}/src/musubi_tuner/wan_generate_video.py" \
--task i2v-A14B \
--dit "${DIT_LOW}" \
--dit_high_noise "${DIT_HIGH}" \
--vae "${VAE}" \
--t5 "${T5}" \
--clip "${CLIP}" \
--lora_weight "${LORA}" \
--lora_multiplier 1.0 \
--image_path "${img}" \
--prompt "${PROMPT}" \
--video_size 512 512 \
--video_length 49 \
--fps 16 \
--infer_steps 4 \
--flow_shift 17.0 \
--save_path "${out_path}" \
--fp8 \
--blocks_to_swap 20 \
--seed 42
done
echo "Done. Results in ${OUTPUT_DIR}"