Generate images using AI APIs (Google Gemini and OpenAI GPT). This skill teaches the prompting patterns and API mechanics for producing professional images directly from Claude Code.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionai-image-generatorExecute the skills CLI command in your project's root directory to begin installation:
Fetches ai-image-generator from jezweb/claude-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate ai-image-generator. Access via /ai-image-generator in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
697
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
697
stars
Generate images using AI APIs (Google Gemini and OpenAI GPT). This skill teaches the prompting patterns and API mechanics for producing professional images directly from Claude Code.
Managed alternative: If you don't want to manage API keys, ImageBot provides a managed image generation service with album templates and brand kit support.
Choose the right model for the job:
| Need | Model | Why |
|---|---|---|
| Scenes / stock photos | Gemini 3.1 Flash Image | Best depth, complexity, environmental context |
| Transparent icons / logos | GPT Image 1.5 | Native RGBA alpha channel (background: "transparent") |
| Text on images | GPT Image 1.5 | 90% accurate text rendering |
| Drafts / iteration | Gemini 2.5 Flash Image | Free tier (~500/day) |
| Final client assets | Gemini 3 Pro Image | Higher detail, better style consistency |
| Model | API ID | Provider |
|---|---|---|
| Gemini 3.1 Flash Image | gemini-3.1-flash-image-preview |
Google AI |
| Gemini 3 Pro Image | gemini-3-pro-image-preview |
Google AI |
| Gemini 2.5 Flash Image | gemini-2.5-flash-image |
Google AI |
| GPT Image 1.5 | gpt-image-1.5 |
OpenAI |
Verify model IDs before use — they change frequently:
curl -s "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY" | python3 -c "import sys,json; [print(m['name']) for m in json.load(sys.stdin)['models'] if 'image' in m['name'].lower()]"
Build prompts in this order for consistent results:
Set the genre: "A photorealistic photograph", "An isometric illustration", "A flat vector icon"
Who or what, with specific details: "of a warm, approachable Australian woman in her early 30s, smiling naturally"
Setting and spatial relationships: "in a bright modern home with terracotta decor on wooden shelves behind her"
Camera and lighting: "Shot at 85mm f/2.0, natural window light, head and shoulders framing"
What to exclude: "Photorealistic, no text, no watermarks, no logos"
BAD — keyword soup:
"professional woman, spa, warm lighting, high quality, 4K"
GOOD — narrative direction:
"A professional skin treatment scene in a warm clinical setting.
A practitioner wearing blue medical gloves uses a microneedling pen
on the client's forehead. The client lies on a white treatment bed,
eyes closed, relaxed. Warm golden-hour light from a window to the
left. Terracotta-toned wall visible in the background. Shot at
85mm f/2.0, shallow depth of field. No text, no watermarks."
| Purpose | Aspect Ratio | Model |
|---|---|---|
| Hero banner | 16:9 or 21:9 | Gemini |
| Service card | 4:3 or 3:4 | Gemini |
| Profile / avatar | 1:1 | Gemini |
| Icon / badge | 1:1 | GPT (transparent) |
| OG / social share | 1.91:1 | Gemini |
| Instagram post | 1:1 or 4:5 | Gemini |
| Mobile hero | 9:16 | Gemini |
Use the 5-part framework. Refer to references/prompting-guide.md for detailed photography parameters.
python3 << 'PYEOF'
import json, base64, urllib.request, os, sys
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
if not GEMINI_API_KEY:
print("Set GEMINI_API_KEY environment variable"); sys.exit(1)
model = "gemini-3.1-flash-image-preview"
url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={GEMINI_API_KEY}"
prompt = """A professional photograph of a modern co-working space in
Newcastle, Australia. Natural light floods through floor-to-ceiling
windows. Three people collaborate at a standing desk — one pointing
at a laptop screen. Exposed brick wall, potted fiddle-leaf fig,
coffee cups on the desk. Shot at 35mm f/4.0, environmental portrait
style. No text, no watermarks, no logos."""
payload = json.dumps({
"contents": [{"parts": [{"text": prompt}]}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"temperature": 0.8
}
}).encode()
req = urllib.request.Request(url, data=payload, headers={
"Content-Type": "application/json",
"User-Agent": "ImageGen/1.0"
})
resp = urllib.request.urlopen(req, timeout=120)
result = json.loads(resp.read())
# Extract image from response
for part in result["candidates"][0]["content"]["parts"]:
if "inlineData" in part:
img_data = base64.b64decode(part["inlineData"]["data"])
output_path = "hero-image.png"
with open(output_path, "wb") as f:
f.write(img_data)
print(f"Saved: {output_path} ({len(img_data):,} bytes)")
break
PYEOF
python3 << 'PYEOF'
import json, base64, urllib.request, os, sys
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
if not OPENAI_API_KEY:
print("Set OPENAI_API_KEY environment variable"); sys.exit(1)
url = "https://api.openai.com/v1/images/generations"
payload = json.dumps({
"model": "gpt-image-1.5",
"prompt": "A minimal, clean plumbing wrench icon. Flat design, single consistent stroke weight, modern style. On a transparent background.",
"n": 1,
"size": "1024x1024",
"background": "transparent",
"output_format": "png"
}).encode()
req = urllib.request.Request(url, data=payload, headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {OPENAI_API_KEY}"
})
resp = urllib.request.urlopen(req, timeout=120)
result = json.loads(resp.read())
img_data = base64.b64decode(result["data"][0]["b64_json"])
with open("icon-wrench.png", "wb") as f:
f.write(img_data)
print(f"Saved: icon-wrench.png ({len(img_data):,} bytes)")
PYEOF
Save generated images to .jez/artifacts/ or the user's specified path.
Post-processing (optional):
# Convert to WebP for web use
python3 -c "
from PIL import Image
img = Image.open('hero-image.png')
img.save('hero-image.webp', 'WEBP', quality=85)
print(f'WebP: {img.size[0]}x{img.size[1]}')
"
# Trim whitespace from transparent icons
python3 -c "
from PIL import Image
img = Image.open('icon.png')
trimmed = img.crop(img.getbbox())
trimmed.save('icon-trimmed.png')
"
Send the generated image back to a vision model for QA:
Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
wordpress-elementor
137jezweb/claude-skills
Productivitysame reporeact-native
22jezweb/claude-skills
Frontendsame repozustand-state-management
7jezweb/claude-skills
Productivitysame repomodly-image-to-3d
37aradotso/trending-skills
Productivitytag: imagebrand-name-generator
24shipshitdev/library
Productivitytag: generatorimage-to-code
14Leonxlnx/taste-skill
image-to-codetag: imageReviews
4.6★★★★★73 reviews- KKwame Taylor★★★★★Dec 24, 2024
Solid pick for teams standardizing on skills: ai-image-generator is focused, and the summary matches what you get after install.
- AAarav Liu★★★★★Dec 16, 2024
ai-image-generator is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- AAanya Brown★★★★★Dec 16, 2024
ai-image-generator reduced setup friction for our internal harness; good balance of opinion and flexibility.
- AAarav Yang★★★★★Dec 12, 2024
ai-image-generator has been reliable in day-to-day use. Documentation quality is above average for community skills.
- GGanesh Mohane★★★★★Dec 8, 2024
ai-image-generator reduced setup friction for our internal harness; good balance of opinion and flexibility.
- DDaniel Bansal★★★★★Dec 8, 2024
Registry listing for ai-image-generator matched our evaluation — installs cleanly and behaves as described in the markdown.
- SSakshi Patil★★★★★Nov 27, 2024
I recommend ai-image-generator for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- AAanya Verma★★★★★Nov 27, 2024
Useful defaults in ai-image-generator — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- DDaniel Rahman★★★★★Nov 15, 2024
We added ai-image-generator from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- AAma Shah★★★★★Nov 11, 2024
Solid pick for teams standardizing on skills: ai-image-generator is focused, and the summary matches what you get after install.
showing 1-10 of 73
1 / 8Discussion
Comments — not star reviews- No comments yet — start the thread.