name: image_gen description: "Generate images via OpenAI Images API (DALL-E 3, GPT-image). Use when: user asks to generate, create, draw, or design an image, illustration, logo, or artwork. NOT for: editing existing images, image format conversion, or screenshots." dependencies: requests metadata: emoji: "๐ผ๏ธ"
Image Generation
Generate images via the OpenAI Images API.
When to Use
โ USE this skill when:
- "Generate an image of a sunset over mountains"
- "Create a logo for my project"
- "Draw a cartoon cat wearing a hat"
- "Design a banner for my blog"
- "Make me an illustration of X"
When NOT to Use
โ DON'T use this skill when:
- Editing or modifying existing images โ use image editing tools
- Screenshot capture โ use system screenshot tools
- Image format conversion โ use
run_commandwith ImageMagick/Pillow - Web image search โ use
web_searchtool
Setup
Requires an OpenAI API key with Images API access.
Configure in pythonclaw.json:
"skills": {
"image_gen": {
"apiKey": "sk-your-openai-key"
}
}
Or set OPENAI_API_KEY environment variable.
Commands
Generate an image
python {skill_path}/generate.py "a serene mountain lake at sunset, watercolor style"
Options
# Specific model
python {skill_path}/generate.py "prompt" --model dall-e-3
# Size options
python {skill_path}/generate.py "prompt" --size 1792x1024
# Quality
python {skill_path}/generate.py "prompt" --quality hd
# Style (dall-e-3 only)
python {skill_path}/generate.py "prompt" --style vivid
# Output directory
python {skill_path}/generate.py "prompt" --output ./images/
Model-Specific Parameters
DALL-E 3:
- Sizes:
1024x1024,1792x1024,1024x1792 - Quality:
standard,hd - Style:
vivid,natural - Generates 1 image at a time
DALL-E 2:
- Sizes:
256x256,512x512,1024x1024 - Quality:
standardonly - Can generate multiple images
Notes
- Output is saved as PNG files in the specified directory (default: current dir)
- Each generation costs API credits (DALL-E 3 HD ~$0.08/image)
- Prompts are sometimes rewritten by the API for safety
- Use
--style naturalfor more photographic results
Resources
| File | Description |
|---|---|
generate.py |
OpenAI Images API wrapper |