import os
os.makedirs('/root/.openclaw/workspace/phat-deck-images/', exist_ok=True)
os.environ['GEMINI_API_KEY'] = 'AIzaSyC2dTGU667C7l8mzaCjI5S18txWtf0aHPc'
from google import genai
client = genai.Client()

prompts = [
    ("science_v1.png", "A calf nursing from its mother in warm golden light. Intimate, close-up, soft focus. The bond between mother and calf. Warm amber tones, early morning light. 16:9 landscape."),
    ("science_v2.png", "A young calf drinking milk from its mother, side profile. Pastoral, quiet, reverent. Golden hour, shallow depth of field, warm tones. No text. 16:9 landscape."),
    ("science_v3.png", "Close-up of a calf's mouth against its mother, nursing. Macro detail, the texture of fur and skin. Warm amber light, intimate, ancient biology. 16:9 landscape.")
]

for fname, prompt in prompts:
    print(f"Generating {fname}...")
    response = client.models.generate_content(
        model="gemini-2.5-flash-image",
        contents=prompt
    )
    for part in response.candidates[0].content.parts:
        if hasattr(part, 'inline_data') and part.inline_data:
            with open(f'/root/.openclaw/workspace/phat-deck-images/{fname}', 'wb') as f:
                f.write(part.inline_data.data)
            print(f"Saved {fname}")
            break
print("DONE")