Image Generator
Generate AI images using DALL-E, Stable Diffusion, or other providers.
When to Use
- User wants to generate an image from text
- Create variations of existing images
- Edit images with AI inpainting
- Generate thumbnails or illustrations
Configuration
# OpenAI DALL-E
export OPENAI_API_KEY="sk-xxx"
# Stability AI
export STABILITY_API_KEY="sk-xxx"
# Replicate (for SDXL, etc.)
export REPLICATE_API_TOKEN="r8_xxx"
Usage
Generate image
python3 scripts/generate_image.py \
--prompt "A serene mountain landscape at sunset" \
--size "1024x1024" \
--output "./output.png"
Generate variations
python3 scripts/generate_image.py \
--vary "./input.png" \
--count 4 \
--output-dir "./variations"
Edit image (inpainting)
python3 scripts/generate_image.py \
--edit "./input.png" \
--mask "./mask.png" \
--prompt "Add a rainbow in the sky"
With style presets
python3 scripts/generate_image.py \
--prompt "A futuristic city" \
--style "cyberpunk" \
--negative "blurry, low quality"
Output
{
"success": true,
"image_path": "./output.png",
"revised_prompt": "A serene mountain landscape..."
}
