#!/bin/bash
PROMPTS=(
  "35mm film photography, extreme macro close-up of a golden butter block melting slowly on a dark warm surface. Single subject, no props. Warm golden hour side lighting illuminating the butter with rich amber highlights. Dark moody edges fading to shadow, chiaroscuro lighting. Visible film grain texture throughout. Cream and gold tones on the butter, deep warm brown-black shadows. Intimate, luxurious, tactile. Shot on vintage 35mm film stock. Premium editorial food photography with analog warmth."
  "35mm film photography, extreme macro of golden liquid oil being poured in a thin stream. Dark background. Warm golden hour lighting catching the stream with amber highlights. Film grain. Chiaroscuro. Single subject, no props. Cream and gold tones, deep warm shadows. Luxurious viscosity visible. Analog warmth. Premium editorial."
  "35mm film photography, extreme macro cross-section of a freshly baked croissant showing golden flaky lamination layers. Dark warm background. Golden hour side lighting on the layers. Film grain texture. Chiaroscuro. Rich amber and gold tones. Intimate, tactile. Analog warmth. Premium editorial food photography."
  "35mm film photography, extreme macro of golden cream being swirled. Dark warm background. Rich amber highlights from golden hour lighting. Film grain. Chiaroscuro. Single subject. Cream and gold palette, deep shadows. Luxurious texture. Analog warmth. Premium editorial."
)
FILENAMES=("style-test-01.png" "style-test-02-pour.png" "style-test-03-croissant.png" "style-test-04-cream.png")
DIR="/root/.openclaw/workspace/products/phat-foods/hero-shots"

for i in 0 1 2 3; do
  for attempt in 1 2 3 4 5 6 7 8 9 10; do
    if [ -f "$DIR/${FILENAMES[$i]}" ]; then
      echo "✅ ${FILENAMES[$i]} already exists, skipping"
      break
    fi
    echo "Attempt $attempt for ${FILENAMES[$i]}..."
    GEMINI_API_KEY="AIzaSyC2dTGU667C7l8mzaCjI5S18txWtf0aHPc" uv run /usr/lib/node_modules/openclaw/skills/nano-banana-pro/scripts/generate_image.py --prompt "${PROMPTS[$i]}" --filename "$DIR/${FILENAMES[$i]}" --resolution 1K 2>&1
    if [ -f "$DIR/${FILENAMES[$i]}" ]; then
      echo "✅ ${FILENAMES[$i]} generated!"
      break
    fi
    echo "Failed, waiting 30s..."
    sleep 30
  done
done
echo "DONE - $(ls $DIR/*.png 2>/dev/null | wc -l) images generated"
