Spaces:
Sleeping
Sleeping
| set -euo pipefail | |
| # Edit these variables as needed | |
| script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| lyrics_file="/Users/lehongwu/Projects/others/lyrics/VideoGeneration/contents_zhuyu/zhuyu_lyrics_v1.txt" | |
| input_image_path="/Users/lehongwu/Projects/others/lyrics/VideoGeneration/output_image/midian_example_0312135300/midian_example_2.png" | |
| model="gemini-3.1-flash-image-preview" | |
| aspect_ratio="16:9" | |
| resolution="1080p" | |
| # Output dir (default: output_image/gen_lyrics_batch_<timestamp>) | |
| datetime=$(date +%m%d%H%M%S) | |
| output_dir="${script_dir}/output_image/gen_lyrics_batch_${datetime}" | |
| # Specific row IDs to generate (empty = all). e.g. row_ids="1 5 10" | |
| row_ids="48 49 50 51 52 53 54 55 56 57" | |
| # Proxy (optional) | |
| export http_proxy="${http_proxy:-http://127.0.0.1:7890}" | |
| export https_proxy="${https_proxy:-http://127.0.0.1:7890}" | |
| if [[ -z "${GEMINI_API_KEY:-}" ]]; then | |
| echo "Error: GEMINI_API_KEY is not set." | |
| echo 'Run: export GEMINI_API_KEY="your_api_key"' | |
| exit 1 | |
| fi | |
| if [[ ! -f "$lyrics_file" ]]; then | |
| echo "Error: Lyrics file not found: $lyrics_file" | |
| exit 1 | |
| fi | |
| echo "Lyrics file: $lyrics_file" | |
| echo "Input image: $input_image_path" | |
| echo "Output dir: $output_dir" | |
| [[ -n "$row_ids" ]] && echo "Row IDs: $row_ids" | |
| echo "" | |
| cmd=(python "$script_dir/gen_lyrics_batch.py" \ | |
| --lyrics-file "$lyrics_file" \ | |
| --input-image-path "$input_image_path" \ | |
| --output-dir "$output_dir" \ | |
| --model "$model" \ | |
| --aspect-ratio "$aspect_ratio" \ | |
| --resolution "$resolution") | |
| [[ -n "$row_ids" ]] && cmd+=(--row-ids $row_ids) | |
| "${cmd[@]}" | |