Upload VideoX-Fun/gen_ref_videos.sh
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#!/bin/bash
echo "正在启动 8 个并行的独立任务,并为每个任务分配不同参数..."
# 1. 在这里预先定义你的参数数组 (a_i)# 数组元素的数量应该与你的任务数量(8)相匹配。# 参数可以是任何字符串,比如文件名、配置名、数值等。save_folder='data/ref_videos'sampler_name='Flow'prompt_list_path='/nfs/ywang29/Reward_finetuning/VideoX-Fun/VBench/prompts/all_dimension.txt'num_inference_steps=50# enable_teacache=False# params=(# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_4/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_7/checkpoint-1000/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_5/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_6/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_6/checkpoint-1000/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_6/checkpoint-2000/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_7/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"# "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_7/checkpoint-2000/transformer/diffusion_pytorch_model.safetensors"# )params=( "--prompt_list_path ref_video_prompt_list_part_0.txt" "--prompt_list_path ref_video_prompt_list_part_1.txt" "--prompt_list_path ref_video_prompt_list_part_2.txt" "--prompt_list_path ref_video_prompt_list_part_3.txt" "--prompt_list_path ref_video_prompt_list_part_4.txt" "--prompt_list_path ref_video_prompt_list_part_5.txt" "--prompt_list_path ref_video_prompt_list_part_6.txt" "--prompt_list_path ref_video_prompt_list_part_7.txt")
# 2. 修改循环以遍历数组的索引# ${!params[@]} 会获取数组 params 的所有索引 (0 1 2 3 4 5 6 7)for i in "${!params[@]}"do # 从数组中获取当前索引对应的参数值 current_param="${params[$i]}"
# CUDA_VISIBLE_DEVICES=$i 告诉程序只能“看见”并使用第 i 张 GPU # python X.py --p "$current_param" 将当前参数传递给脚本 # & 让命令在后台运行 echo "启动任务 $i (GPU $i),参数为: $current_param" CUDA_VISIBLE_DEVICES=$i python ./examples/wan2.1/predict_t2v_14B_vqref.py --prompt_list_path $prompt_list_path --num_inference_steps $num_inference_steps --save_folder $save_folder --sampler_name $sampler_name $current_param &done
# 'wait' 命令会等待所有后台任务都执行完毕echo "所有任务已启动。等待它们全部完成..."waitecho "所有任务已完成。"VideoX-Fun/gen_ref_videos.shAdded+53