Generate advertising images via Gemini 2.0 Flash Experimental.
Workflow
Step 1: Identify the account
Ask the user which account the creative is for. Check the list of accounts in .claude/ads-agent/config/ad_accounts.md
Step 2: Read the brief
CRITICAL: Read .claude/ads-agent/config/briefs/{account}.md
Step 3: Gather the texts
Get from the user or call /creative-copywriter:
- offer — headline (6-12 words)
- bullets — 3 bullets via
\n - profits — benefit/bonus
- cta — call to action
Step 4: Ask for the prompt
Find out from the user:
- What style/mood?
- What colors?
- What objects in the background?
- Is there a reference? (path to image)
Step 5: Generate
Call MCP tool generate_creative_image() with parameters
Step 6: Show the result
- Read the created file via Read tool → show a preview to the user
- Output the file path for opening in Finder/Preview
Step 7: Stories format (optional)
If 9:16 Stories is needed → call expand_to_stories()
MCP Tools
generate_creative_image
Generate a 4:5 creative (1080×1350).
Parameters:
prompt— style, colors, objects, moodoffer— headlinebullets— 3 bullets via\nprofits— benefitcta— call to action (default: "Learn more")reference_image_path— (optional) path to referenceoutput_dir— (optional) directory for saving
Result: JSON с file_path to PNG file
expand_to_stories
Extend 4:5 to 9:16 via outpainting.
Parameters:
image_path— path to the 4:5 imageoutput_path— (optional) path for the result
Result: JSON с file_path to 9:16 PNG file
References
The user can attach a reference image for the style:
- Pass the path to
reference_image_path - Gemini will take colors, composition, mood from the reference
- Texts will be added on top in the style of the reference
Viewing the result
After generation:
- Read tool — show a preview in the chat (Claude Code multimodal)
- File path — the user will open it in Finder/Preview
- The file is saved to the working directory
Requirements
- GEMINI_API_KEY — environment variable with the Gemini API key
- google-generativeai — Python package (
pip install google-generativeai)
Workflow example
Request: "Generate a creative for bas_dent about implantation"
Actions:
- I read the brief
.claude/ads-agent/config/briefs/bas_dent.md - I ask for the texts or call
/creative-copywriter - I ask for the style:
- "What style? (minimalism, UGC, bright...)"
- "What colors? (blue, white...)"
- "Is there a reference?"
- I call
generate_creative_image() - I read the file via Read → show a preview
- I ask: "Do you need the Stories format 9:16?"
- If yes →
expand_to_stories()