Gemini-VideoGeneration / image_super_resolution.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/midian_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=super_resolution
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="
Make it higher resolution. Extract black characters on white background, but style unchanged.
Only keep the second row of text "潮湿的路上" and place it in the center of the image.
"
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 1080p \
--number-of-images 1 \
--name "$name" \
--output-dir "$output_dir"