Gemini-VideoGeneration / generate_lyrics.sh
LehongWu's picture
Upload folder using huggingface_hub
6cc3d86 verified
#!/usr/bin/env bash
set -euo pipefail
input_image_path=/Users/lehongwu/Projects/others/lyrics/VideoGeneration/contents_zhuyu/qilin_example.png
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=gen_lyrics
output_dir="output_image/${name}_${datetime}"
# prompt="
# A title 'Autumn Leaves' appears in the image, as if composed of leaves.
# 'Autumn' in the first row and 'Leaves' in the second row.
# Some leaves of different sizes and positions scatterred around the title, some are partially out of the image.
# The leaves should look diverse in shapes, sizes, and colors should be red and gold. They come from the example image.
# Black background.
# "
prompt="
Put chinese characters '雪白的天色' in the center of the image.
The sizes of each character should be consistent, and similar with the original image.
Follow the font style of the original image. Black calligraphy on white background.
"
python gen_image_image_cond.py \
--prompt "$prompt" \
--input-image-path "$input_image_path" \
--model gemini-3.1-flash-image-preview \
--aspect-ratio 16:9 \
--resolution 2K \
--number-of-images 1 \
--name "$name" \
--output-dir "$output_dir"