Gemini-VideoGeneration / run_gen_video_prompt_only_extend.sh
LehongWu's picture
Upload folder using huggingface_hub
6cc3d86 verified
#!/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_emit
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 drifting slowly on the black background. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Overall the leaves should be sparse and extremely small. Start from a black image."
"Autumn leaves drifting slowly on the black background. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Overall the leaves should be sparse and extremely small. The density and speed of the leaves should be consistent."
"Autumn leaves drifting slowly on the black background. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. Overall the leaves should be sparse and extremely small. The density and speed of the leaves should be consistent. More leaves are coming in the back."
"Autumn leaves drifting slowly on the black background. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. More leaves. Even more leaves are coming in the back."
"Autumn leaves drifting slowly on the black background. The leaves are of different shapes, colors ranging from red to gold, and distances to camera are diverse. The density of leaves are consistent. Finally disappear and ends with a black image."
)
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_emit_0310100712/leaves_video_debug_frame0.2.png \
--end-image /Users/lehongwu/Projects/others/lyrics/VideoGeneration/output_video/leaves_video_emit_0310100712/leaves_video_debug_frame11.png \
--name $name \
--output_dir $output_dir