image-gen
Installation
SKILL.md
Image Generation
Overview
Generate images from text prompts using OpenAI's image generation API.
Prerequisites
OPENAI_API_KEYenvironment variable set
Usage via API
Generate with curl
curl -s https://api.openai.com/v1/images/generations \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "A futuristic city at sunset, cyberpunk style",
"n": 1,
"size": "1024x1024",
"quality": "hd"
}' | jq -r '.data[0].url'
Download the image
url=$(curl -s https://api.openai.com/v1/images/generations \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"dall-e-3","prompt":"...","n":1,"size":"1024x1024"}' \
| jq -r '.data[0].url')
curl -s "$url" -o /tmp/generated.png
Models & Options
| Model | Sizes | Quality | Notes |
|---|---|---|---|
| dall-e-3 | 1024x1024, 1792x1024, 1024x1792 | standard, hd | Best quality, prompt rewriting |
| dall-e-2 | 256x256, 512x512, 1024x1024 | standard | Faster, cheaper |
Tips
- DALL-E 3 rewrites your prompt for better results — check
revised_promptin response - Use
hdquality for detailed images,standardfor quick drafts - For landscape:
1792x1024, for portrait:1024x1792 - Save to
/tmp/for temporary images, projectassets/for permanent ones - To share: use the returned URL (expires after ~1 hour) or download first
Batch Generation
for i in 1 2 3 4; do
curl -s https://api.openai.com/v1/images/generations \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"model\":\"dall-e-3\",\"prompt\":\"Variation $i of abstract art\",\"n\":1,\"size\":\"1024x1024\"}" \
| jq -r '.data[0].url' | xargs -I{} curl -s {} -o "/tmp/gen-$i.png"
done
Related skills
More from phuetz/code-buddy
blender
Blender 3D modeling, animation, and rendering automation via Python bpy scripting and CLI
19figma
Automate Figma design workflows via REST API, Plugin API, and MCP integration
3github
Interact with GitHub using the gh CLI for issues, PRs, CI runs, releases, and API queries
3gif-search
Search and download GIFs from Tenor and Giphy APIs
3ableton-live
Ableton Live music production automation via OSC protocol, MIDI, and Max for Live
3gitlab
GitLab DevOps platform with CI/CD pipelines, API automation, and glab CLI control
3