image-gen

Generate images using AI APIs (OpenAI gpt-image-1, Google Imagen 4, Nano Banana Pro, fal.ai Flux). Use when user asks to generate, create, or make an image.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "image-gen" with this command: npx skills add fairchild/dotclaude/fairchild-dotclaude-image-gen

Image Generation

Generate images from text prompts using OpenAI, Google Imagen, Nano Banana Pro (Gemini), or fal.ai.

Usage

OpenAI (gpt-image-1)

uv run ~/.claude/skills/image-gen/scripts/generate_openai.py \
  --prompt "a cat wearing a top hat" \
  --output /tmp/cat.png

Options:

  • --prompt (required): Text description of the image
  • --output, -o: Output file path (default: ./generated-{timestamp}.png)
  • --size: Image size (default: 1024x1024, options: 1024x1024, 1024x1792, 1792x1024)
  • --quality: Image quality (default: auto, options: low, medium, high, auto)

Google Imagen 4

uv run ~/.claude/skills/image-gen/scripts/generate_imagen.py \
  --prompt "a cat wearing a top hat" \
  --output /tmp/cat.png

Options:

  • --prompt (required): Text description of the image
  • --output, -o: Output file path (default: ./generated-{timestamp}.png)
  • --model: Model to use (default: imagen-4.0-generate-001, options: imagen-4.0-fast-generate-001, imagen-4.0-ultra-generate-001)

Nano Banana Pro (Gemini)

uv run ~/.claude/skills/image-gen/scripts/generate_gemini.py \
  --prompt "a cat wearing a top hat" \
  --output /tmp/cat.png

Options:

  • --prompt (required): Text description of the image
  • --output, -o: Output file path (default: ./generated-{timestamp}.jpg)
  • --model: Model to use (default: gemini-3-pro-image-preview)
  • --aspect-ratio, -a: Aspect ratio (default: 1:1, options: 1:1, 16:9, 9:16, 21:9)
  • --image-size, -s: Output size for Pro model (options: 1K, 2K, 4K)

fal.ai (Flux)

uv run ~/.claude/skills/image-gen/scripts/generate_fal.py \
  --prompt "a cat wearing a top hat" \
  --output /tmp/cat.png

Options:

  • --prompt (required): Text description of the image
  • --output, -o: Output file path (default: ./generated-{timestamp}.png)
  • --model: Model to use (default: fal-ai/flux/dev)

Provider Comparison

ProviderModelSpeedQualityCost
OpenAIgpt-image-1MediumExcellent~$0.04/img
GoogleImagen 4MediumExcellent~$0.04/img
GoogleNano Banana ProFastExcellent~$0.13/img (2K)
fal.aiFlux devFastVery goodPay-per-compute

Environment Variables

ProviderVariableRequired
OpenAIOPENAI_API_KEYYes
GoogleGOOGLE_API_KEYYes
fal.aiFAL_KEYYes

Set in ~/.env or export in shell.

Troubleshooting

Getting API Keys

Common Errors

"API key not set"

# Add to ~/.env
echo "GOOGLE_API_KEY=your-key-here" >> ~/.env

# Or export in current shell
export GOOGLE_API_KEY=your-key-here

"API key is invalid"

  • Regenerate your key at the provider's dashboard
  • Ensure no extra whitespace when copying the key
  • Check the key hasn't expired

"Rate limit exceeded"

  • Wait 1-2 minutes and retry
  • Check your usage quota at the provider's dashboard

"Content blocked"

  • The prompt triggered safety filters
  • Rephrase to avoid restricted content

"Cannot connect"

  • Check your internet connection
  • Verify the API service isn't experiencing outages

File Format Notes

  • OpenAI: Returns PNG
  • Google Imagen: Returns PNG
  • Google Gemini: Returns JPEG (scripts auto-correct extension if needed)
  • fal.ai Flux: Returns JPEG (scripts auto-correct extension if needed)

Testing

uv run ~/.claude/skills/image-gen/tests/test_image_gen.py --help

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

backlog

No summary provided by upstream source.

Repository SourceNeeds Review
General

skills-manager

No summary provided by upstream source.

Repository SourceNeeds Review
General

youtube-content

No summary provided by upstream source.

Repository SourceNeeds Review
General

update-dependencies

No summary provided by upstream source.

Repository SourceNeeds Review