Generate professional carousel images from text content using Gemini image generation API.
gemini-3-pro-image-preview (REQUIRED for correct Chinese/CJK text rendering)Determine carousel content from one of:
Collect:
For health/product carousels, use this proven 6-slide structure:
#TypePurpose1CoverHook + brand + topic2ProblemWhy reader should care3SolutionHow product/topic solves it4DetailsKey features, data, ingredients5Social ProofTestimonials, results, evidence6CTAProduct image + buy/contact
For other structures, see references/prompt-patterns.md.
For each slide, write a Gemini prompt following these rules:
Design prompt structure:
text
Create a [SIZE] [STYLE_PRESET] Instagram slide for [BRAND].
LAYOUT:
- Background: [COLORS/GRADIENT]
- [ELEMENT DESCRIPTIONS WITH EXACT TEXT]
- "[SLIDE_NUM] / [TOTAL]" bottom right
CRITICAL: All Chinese/CJK text must be exactly as written above.
Key rules:
inlineData in API callreferences/prompt-patterns.mdUse scripts/generate_carousel.py or call Gemini API directly:
python
import urllib.request, json, base64
API_KEY = "..." # from TOOLS.md
MODEL = "gemini-3-pro-image-preview" # REQUIRED for CJK text
url = f"https://generativelanguage.googleapis.com/v1beta/models/{MODEL}:generateContent?key={API_KEY}"
parts = [{"text": prompt}]
# For CTA slide with product image:
# parts.insert(0, {"inlineData": {"mimeType": "image/jpeg", "data": base64_image}})
payload = {
"contents": [{"parts": parts}],
"generationConfig": {"responseModalities": ["image", "text"]}
}
data = json.dumps(payload).encode("utf-8")
req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})
resp = urllib.request.urlopen(req, timeout=180)
result = json.loads(resp.read())
Add 5-second delay between slides to avoid rate limits.
After generation, verify each slide with vision model:
If text is garbled, regenerate that slide. Pro model rarely fails on Chinese but verify anyway.
ModelChinese TextDesign QualitySpeedUse Whengemini-3-pro-image-preview✅ Perfect✅ HighSlowerDefault choice — CJK contentgemini-2.5-flash-image❌ Garbled✅ HighFastEnglish-only contentgemini-3.1-flash-image-preview⚠️ Untested✅ HighFastTry for English content
ProblemSolution429 quota exceededCheck billing is linked to correct GCP projectLocation not supportedUse US VPNChinese text garbledSwitch to gemini-3-pro-image-previewProduct image not matchingAttach actual product image via inlineDataInconsistent design across slidesInclude brand color hex codes and style description in every prompt
text
text-to-carousel/
├── SKILL.md # This file
├── scripts/
│ └── generate_carousel.py # Batch generation script (config-driven)
└── references/
└── prompt-patterns.md # Design presets, slide templates, tips