#!/usr/bin/env bash set -euo pipefail export http_proxy="http://127.0.0.1:7890" export 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 ! python3 -c "from google import genai" >/dev/null 2>&1; then # echo "Installing dependency: google-genai" # python3 -m pip install --upgrade google-genai # fi datetime=$(date +%m%d%H%M%S) name=leaves_video_drop output_dir="output_video/${name}_${datetime}" # How many times to extend. Final length = duration * (num_extend + 1) num_extend=4 # Must have num_extend+1 prompts (initial + one per extension) prompts=( "Autumn leaves falling down at a fixed speed. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Change the background to gold and with soft sun glows from top. The dropping speed and leaves density should be consistent." "Autumn leaves falling down at a fixed speed. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Change the background to gold and with soft sun glows from top. The dropping speed and leaves density should be consistent." "Autumn leaves falling down at a fixed speed. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Change the background to gold and with soft sun glows from top. The dropping speed and leaves density should be consistent." "Autumn leaves falling down at a fixed speed. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Change the background to gold and with soft sun glows from top. The dropping speed and leaves density should be consistent." "Autumn leaves falling down at a fixed speed. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Change the background to gold and with soft sun glows from top. The dropping speed and leaves density should be consistent." ) prompt_args=() for p in "${prompts[@]}"; do prompt_args+=(--prompt "$p") done # video extension only supports 720p python gen_video_prompt_only_extend.py \ "${prompt_args[@]}" \ --resolution 720p \ --duration 8 \ --aspect-ratio 16:9 \ --num-extend $num_extend \ --start-image /Users/lehongwu/Projects/others/lyrics/VideoGeneration/output_video/leaves_video_0309184011/debug_frame0.png \ --end-image /Users/lehongwu/Projects/others/lyrics/VideoGeneration/output_video/leaves_video_0309184011/debug_frame6_gold.png \ --name $name \ --output_dir $output_dir